I am using Nagios XI (R1.9)
I have a service with a check command that returns a 2 (Critical). To verify, I can run the command at the command line and I get the same (text) output that nagios gets/shows in the Status Information on the service status page, then I do an echo $? and get a 2.
However, when I look at the service on the service status page, the service status for that host shows “Ok” but the status information (ie. output from the check command) shows “Critical: File service…..” which, as I mentioned, is the same text I see with when I run at the command line and get a return code of 2.
There are multiple hosts and services in this nagios instance that are running correctly. This service was recently added.
Any thoughts about what the issue could be or how to test?
The issue was that I was using a tee to redirect output to a log file, like:
Nagios was getting exit code 0 from the tee :-/