Hi all,
I've recently begun to use monit to monitor my server, and boy does it
come in handy! Cheers for this great little piece of software.
Now I'd like to set up a monitor to test network connectivity. Ideally,
what I'd like to do, is to ping and HTTP connect to a couple of hosts
and if they're down, bring down and bring back up again my external
interface, eth1. If they are brought down say 5 times in 5 cycles and
it's still not working, reboot. At the moment I have:
check host debian with address www.debian.org
group connectivity
start program = "/sbin/ifup eth1"
stop program = "/sbin/ifdown eth1"
if failed icmp type echo with timeout 15 seconds then alert
if failed port 80 proto http then restart
check host apple with address www.apple.com
group connectivity
start program = "/sbin/ifup eth1"
stop program = "/sbin/ifdown eth1"
if failed port 80 proto http then restart
Now this just restarts the interfaces as soon as a problem is detected,
which works but is a bit clunky, as you might imagine. Is there any way
to make, for example, something like the following (that monit doesn't
like)?
check host debian with address www.debian.org
group connectivity
start program = "/sbin/ifup eth1"
stop program = "/sbin/ifdown eth1"
if failed icmp type echo with timeout 15 seconds then alert
if failed port 80 proto http then alert
if 3 alerts within 3 cycles then restart
if 3 restarts within 20 cycles then exec "/sbin/reboot"
Thanks for any help!
Chris
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general