[Nagiosplug-devel] Plugin question
Ryan Czyz
rczyz at scsinet.com
Fri Jun 20 10:44:02 CEST 2003
I am trying to write a basic pluging to compare the results off a "GET"
to a file which has the reqiured output. If it is ok, it should exit
with code status 0 and if it is bad it should exit with status 2 right?
Here is the code:
########START CODE#######
#!/bin/sh
wget
http://www.<SOMESITE>.com/webapp/wcs/stores/servlet/TestPage?catalogId=1
0551\&storeId=10201 -O http_out -q
diff -w -q /usr/local/nagios/bin/http_out
/usr/local/nagios/libexec/http2.txt
# If they're not different, it is ok.
if [ $? -eq 0 ]; then
echo "Site ok"
exit 0
else
echo "Critical"
exit 3
fi
####END CODE#####
We just did a shell script bceause it is quick and dirty and it will
actually send the right info. The only problem is that when I look at
the status in the web interface in Nagios, I see the status as OK (all
the time) and then it will give the error CRITICAL, so I know that the
conditions I the script are met. Is there something else that the CGIs
are looking for that I am missing?
Thanks.....
Ryan Czyz
More information about the Devel
mailing list