monit-general
[Top][All Lists]
Advanced

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

Monitoring a network interface


From: Chris Boot
Subject: Monitoring a network interface
Date: Wed, 11 Aug 2004 11:19:33 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616

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





reply via email to

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