<span class="gI">Hi Folks,<br>
<br>
Nagios is acting a little weird for me, I have this external script
which I hooked into Nagios, it merely does a curl/wget on a URL and
returns the status based on string in the content/output. Initially for
2-3 hrs the script returns the right status and Nagios reports correctly
i.e. OK, WARN, ERROR based on the exit from the script. After 2-3 hrs
output which was (and should be) OK or WARN starts returning CRITICAL
and the output line says "Application is" and not even "Application is
ERROR" or "Application is FATAL".<br>
<br>
There is nothing in the logs to suggest what could be the problem. Have
you experienced this before and let me know the corrective action. I am
running Nagios on Mac OSX. <br>
<br>
Here is the script for the curious - <br>
<br>
#!/bin/bash<br>
<br>
read URL < "$1"<br>
<br>
STATUS=`curl -s $URL |grep summary|awk -F\" '{print $2}'`<br>
echo "Application is $STATUS"<br>
echo "curl $URL"<br>
<br>
case $STATUS in<br>
OK)<br>
exit 0<br>
;;<br>
WARN)<br>
exit 1<br>
;;<br>
ERROR)<br>
exit 2<br>
;;<br>
FATAL)<br>
exit 2<br>
;;<br>
*)<br>
exit 2<br>
;;<br>
esac<br>
<br>
Thanks,<br>
<br>
Allan.</span>