I have created a script to check some disk statuses on some remote hosts. The status is returned OK back to Nagios and Nagios picks that return code up for all except one the hosts. That means that the green status remains even if the script returns a nonezero number for the mentioned host. If I run the command from the monitoring/nagios server to the remote host, the status is returned as expected.
I have forced the script to return a return code=2 (critical) just to debug and the output and return code are returned back to Nagios for all the remote hosts like this:
mon@svg022 > ssh svg010 /net/svg022/export/monitor/nagios/libexec/raidctlchk
Raid Status: OK, Disk Status: OK, Mirror Status: Error
mon@svg022 > echo $?
All the hosts turns up red after a while except for the one!?
Any Ideas ?