I have a problem with Nagios, and in particular with the check_tcp plugin, used to check the Citrix connection on a Windows server. Nagios is in version 3.3.1 and nagios plugins are in version 1.4.15 (which seems to be the last ones).
When the connection is OK, the service's status is OK with Status Information saying : "TCP OK". But when the Citrix service is not responding, the service's status is still OK with Status Information saying : "Connection refused", which indicate clearly that the Citrix connection is not OK.
One more thing, when launching the check command by hand it returns 0, which explains the OK status on the web interface, while it must returns 1 or something else to indicate the error.
Did someone already have the same problem ? And is there something that I can do to correct this check ?
Thanks in advance,
Jeremy
I'm not sure we know enough about the problem to be definitive. This isn't normal behaviour for the
check_tcp
plugin:Can you tell us what happens when you invoke the plugin manually? How is your NAGIOS invoking it right now?
Edit: then you will have to wade through your NAGIOS config, from the
check_command
entry in the service definition, through the commands definition file, until we know exactly what on-disc command is being run, and with what flags.Edit 2: I suspect the problem is in the pipeline. I don't know who decided that
| sed 's/,/./g'
needed to be added, nor why, but the exit status of a pipeline is the exit status of the last command therein. Compare this with the output above:The
sed
, being the last command in the pipeline, works fine, so the exit status of the pipeline is 0, meaning "yes, i'm fine", causing NAGIOS to say "yes, everything is fine".If you feel that you must have that tidying-up, you will need to write a shell script that performs the actual
check_tcp
, saves the termination status and the output, outputs the output run through sed but terminates with the stored termination status. Better still, stop worrying about dots and commas, and start worrying about whether the server is down or not.Check if on your server you have added
-r
as an option to the tcp_check command.