[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Pinging more than one host?
From: |
Jan-Henrik Haukeland |
Subject: |
Re: Pinging more than one host? |
Date: |
Wed, 26 May 2004 12:07:41 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Reasonable Discussion, linux) |
As Christian said this cannot be done without changing the monit
code. However if this is a problem for maintenance only you can just
disable monitoring of the hosts during maintainance and remember to
re-enable it again when finish. This can be done fairly easy using a
script such as the one drafted here;
..
case $1 in
umonitor)
GET http://admin:monit@<openbsd-server>:2812/sybase?OPENBSD-server=unmonitor
GET http://admin:monit@<nas-server>:2812/sybase?NAS-server=unmonitor
;;
monitor)
GET http://admin:monit@<openbsd-server>:2812/sybase?OPENBSD-server=monitor
GET http://admin:monit@<nas-server>:2812/sybase?NAS-server=monitor
;;
*) echo "Usage: ...";
exit 1;;
esac
Ps. Using a script such as the one above is probably easiest, but you
can also use m/monit to do it from a web-interface and handle both
servers from this interface (see
http://www.tildeslash.com/monit/mmonit/mmonit_status2.gif and you can
download m/monit here http://www.tildeslash.com/monit/dist/mmonit/)
Vincent FLEURANCEAU <address@hidden> writes:
> Hi all!
>
> I'm new to Monit. But I've read the doc before posting ;-)
>
> I use Monit to synchronize shutdown between my OpenBSD box (running
> Monit) and another host (NAS-server) running an UPS monitoring
> software. The UPS provides power for both hosts of course.
>
> I've tried the following config and it works well:
>
> Check host NAS-server with address 192.168.1.112
> if failed icmp type echo with timeout 120 seconds
> then exec "/sbin/shutdown -p -h +1"
> alert address@hidden
>
>
> But if I need to halt the NAS-server for more than 120 seconds
> (regular maintenance), Monit will halt the OpenBSD box, too!
>
> So, I would like to know if there is a way to ping ** many ** hosts?
> What I'm looking would be:
>
> [ Check host NAS-server with address 192.168.1.xxx
> and
> Check host another-server with address 192.168.1.yyy ]
>
> if failed icmp type echo with timeout 180 seconds
> then exec "/sbin/shutdown -p -h +2"
>
> I know that 'and' is ignored by the config parser, so: either there's
> another way of doing it or changes have to be made in Monit's code :-(
>
> Any idea? Maybe I've missed something in the doc? Can dependencies
> help me, for example?
>
> Thanks in advance,
>
> -- Vincent
--
Jan-Henrik Haukeland