« My attempt at a #nowplaying app for Mac OS X! | Main | Recovering a corrupt LDAP DB on OS X Server »
Friday
Jul162010

OpsView/Nagios check for Blacknight.ie Status Page

As part of my placement, we monitor websites hosted by Blacknight.ie.

If Blacknight are having issues we tend to get alerts messages about "Connection Refused" which tend to cause some consternation!

To cut down on the amount of clicking, I've wrote a small bash script that can be run by OpsView/Nagios that will check the Blacknight Status Page and return a count of the number of times that the "NOTOK" image is shown!

 

If that number is more than one, Blacknight's servers are reporting problems!

#!/bin/bash
#
#       Nagios Check Plugin for Blacknight.ie
#       Displays message if Blacknight are having technical issues with any of their servers
#
NOTOK=`curl --silent "http://www.blacknightstatus.com/server_monitor.php" | grep -E "http://blacknightstatus.com/statusmon/images/notok.gif" | wc -l`

if [ "$NOTOK" -eq "0" ] ; then
{
echo "Plugin failure: Information not found, log incident with N&S";
exit 1;
}
elif [ "$NOTOK" -eq "1" ] ; then
{
echo "All OK";
exit 0;
}
elif [ "$NOTOK"  -ge "2" ] ; then
{
echo "Blacknight Status Page reporting issues";
exit 2;
}
else
{
echo "Plugin failure: Unexpected output!";
exit 2;
}
fi

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.