Script to parse status.log
Naoki
naoki at valuecommerce.ne.jp
Thu Dec 5 08:19:58 CET 2002
Who wants to help clean this up?
#!/bin/bash
echo
echo " -= NAGIOS STATUS =-"
date
echo
grep HOST /usr/local/nagios/var/status.log | awk -F\; '{if ($3=="DOWN")
{print $2," - \033[0;31m",$3,"\033[0;0m"} else if ($3=="UP") { print
"\033[0;0m",$2," - ",$3} }'
grep SERVICE /usr/local/nagios/var/status.log | awk -F\; '{if
($4=="CRITICAL") {print $2,"\t \t",$3,"\t \t\033[0;31m",$4,"\033[0;0m"}
else if ($4="OK") { print "\033[0m",$2,"\t \t",$3,"\t \t",$4} }'
Prints out this :
-= NAGIOS STATUS =-
Thu Dec 5 15:18:50 JST 2002
bugger - UP
booger - UP
mundane - DOWN
asym - DOWN
snort check_ssh OK
kampai check_ssh OK
zinc check_ssh CRITICAL
With nice ansi colours.
-------------------------------------------------------
This SF.net email is sponsored by: Microsoft Visual Studio.NET
comprehensive development tool, built to increase your
productivity. Try a free online hosted session at:
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr0003en
More information about the Users
mailing list