[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [K12OSN] Script for checking if servers are up.
- From: Craig White <craig tobyhouse com>
- To: "Support list for open source software in schools." <k12osn redhat com>
- Subject: Re: [K12OSN] Script for checking if servers are up.
- Date: Thu, 18 Oct 2007 10:56:01 -0700
On Thu, 2007-10-18 at 12:33 -0500, Doug Simpson wrote:
> I am trying to make a script that will ping servers and if they are down, send a message. If they are up it won't send a message.
>
> The problem I am having is if there are more than one, it won't work.
>
> Here is a sample of my script:
> **********sample begins below*************
> while (true)
> do
> sleep 30
> if ping -i 3 -c 3 192.168.0.222
> then
> continue
> else
> echo "192.168.0.222 down!" | mail -s "222 down" veewee77 alltel net
> break
> fi
> done
> **********sample ends above***************
>
>
> If I add a second (or more) to it, it fails to work properly.
> **********broken sample begins below********
> while (true)
> do
> sleep 30
> if ping -i 3 -c 3 192.168.0.222
> then
> continue
> else
> echo "192.168.0.222 down!" | mail -s "222 down" me here there
> break
> fi
> if ping -i 3 -c 3 192.168.0.223
> then
> continue
> else
> echo "192.168.0.223 down!" |mail -s "223 down" me here there
> done
> ***********broken sample ends above**************
>
> Obviously a bogus email address, but it is for reference.
> Any ideas?
----
webmin has all sorts of monitoring available built-in. See System and
Server status under 'Others'
--
Craig White <craig tobyhouse com>
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]