monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: monitor only when IP address is local


From: Martin Pala
Subject: Re: monitor only when IP address is local
Date: Tue, 7 Feb 2012 15:06:57 +0100

Hi,

you can set the monitoring mode to "mode manual" (so the service is not 
monitored by default) and enable/disable the monitoring when you migrate the IP 
address using monit CLI utility ("monit unmonitor <servicename>" and "monit 
monitor <servicename>")

If you have more active/passive services like this, you can put them into 
service group and monitor/start the whole service group:

   monit -g mygroup monitor

Regards,
Martin


On Feb 7, 2012, at 2:58 PM, Werner Flamme wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi everyone,
> 
> it's my first post on this mailing list, and I am not very used to
> monit...
> 
> I have a service that runs on a server with a certain IP address
> (let's say, 192.168.171.121). But this address can be given (manually)
> to serverA or to serverB. So I only have to check the service on that
> machine that got this address.
> 
> The check itself is not hard to do, but how can I "unmonitor" when the
> host where monit is running on does not have this certain IP address?
> 
> To check if the host has the address, I can use something like
> 
> HAS_IP=0
> /sbin/ifconfig | /usr/bin/grep -q '192.168.171.121' && HAS_IP=1
> if [ $HAS_IP -eq 1  ]; then
> ... #/* monitor the service */
> 
> If all else fails, I have to include some code like this in
> /etc/init.d/monit to prevent monit from starting :-(
> 
> Regards,
> Werner
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.18 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk8xLg0ACgkQk33Krq8b42OhpQCfdVy/tB4eMsrTnWiqydbM1MZ+
> ZrMAn15ZGF69FSsY4Bjsj+awP8hw4tSg
> =H4TO
> -----END PGP SIGNATURE-----
> 
> --
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

[Prev in Thread] Current Thread [Next in Thread]