I needed to monitor a temperature monitor on my network. I wrote my own shell script and put it in the check commands folder as normal.
temp=$(/sbin/gettemp | sed 's/\..*//')
if $temp -gt "100" ]; then
echo "Critcal Temperature: $origtemp"
echo "Temperature OK: $origtemp"
However while monitoring the script in nagios I never get notifications. However I have it setup just like every other single service that we monitor. From what I know about writing scripts it should get all its info from exit codes. Which is what I used in my script.
I also noticed that current attempt never changes from 1/2 and is always in HARD state.
Current Attempt: 1/2 (HARD state)
Here is my config:
What is wrong why will it not give me any emails when in critical state?