[CentOS] Recommendation On Ping And Alert Tool

Thu Sep 22 19:59:38 UTC 2005
CentOS mailing list <centos at 911networks.com>

Kennedy Clark wrote:
> A bit off topic, but I keep looking for an answer to this question and 
> coming up with nothing... so I thought I would go to the gurus. :-)
>  
> Can anyone recommend a good package for pinging other devices and 
> sending an email/alert when they go down?  I'm aware of all kinds of 
> more complex things with GUIs and a zillion other bells and whistles we 
> aren't looking for, but we just want a simple tool (could be daemon or 
> something run from cron) that runs every 1 - 5 minutes and alerts us 
> when stuff disappears.  Would need some basic logic like only sending 
> one email/alert when something goes down (vs sending an email every 1-5 
> minutes until it comes back up). :-)  We need to avoid a requirement for 
> an X-windows GUI, but a web-GUI would probably be fine (a GUI-less 
> command-line thing would probably be best).

Bash. Here is what I use for monitoring my website

#!/bin/bash

URL="http://www.911networks.com"
EMAIL="artsi at fartsi.com"

lynx -dump "$URL" > /dev/null
if [ $? -ne 0 ]; then
     echo "`date "+%F %T"` - $URL is down" | mail -s "$URL is 
down" $EMAIL
fi

Watch for the wraps and make it executable [chmod 7xx]


-- 
Thanks
http://www.911networks.com
When the network has to work Cisco/Microsoft