[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
monitor only when IP address is local
From: |
Werner Flamme |
Subject: |
monitor only when IP address is local |
Date: |
Tue, 07 Feb 2012 14:58:37 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120129 Thunderbird/10.0 |
-----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-----
- monitor only when IP address is local,
Werner Flamme <=