[Pkg-nagios-devel] Bug#608455: Bug#608455: nagios3: return_code of passive checks sent via nsca to central server are in wrong format

Alexander Wirt formorer at formorer.de
Sun Jan 2 09:00:42 UTC 2011


tag 608455 unreproducible moreinfo
thanks

Lee Elliott schrieb am Friday, den 31. December 2010:

Hi, 

> Package: nagios3
> Version: 3.0.6-4~lenny2
> Severity: important
> 
> When a passive check is sent by a remote/distributed server via nsca the return_code is in the form of a string i.e. "OK/WARNING/CRITICAL/UNKNOWN" but this results in the central nagios 
> monitoring server always interpreting the return_code as "OK" in the nagios web interface, even when it is not (although the plugin output data/'Status Information' details are correctly 
> shown in the nagios web-interface).  As a result, no notifications are issued when a passive check returns a warning, failure or unknown status.
> 
> The cause of this problem seems to be that the passive check return_code should be an integer, with values of "0/1/2/3", corresponding to the "OK/WARNING/CRITICAL/UNKNOWN" string values 
> that are actually sent.
> 
> Using an amended version of the SUBMIT_CHECK_RESULT_VIA_NSCA bash shell script, which substitutes the appropriate integer value for the supplied string (and which is invoked to execute 
> the [/usr/sbin/]send_nsca command that transmits the passive check data to the central monitoring server) results in the correct 'Status' being displayed in the central nagios web 
> interface and the corresponding notifications being issued.
> 
> The underlying cause of the problem seems to be inconsistancy between the use of integer and string return_codes deeper within the nagios logic i.e. the passive check return_code should be 
> supplied to the SUBMIT_CHECK_RESULT_VIA_NSCA script as an integer and not as a string.
I can't follow your problem, the script submit_check_result_via_nsca expect
the returncode as an integer and forwards that to the nagios daemon. I don't
know any location where strings are accepted. If I submit a passive
checkresult to the script like: 
 submit_check_result_via_nsca localhost SSH 2 "CRIT: foo bar baz"
Everything goes as expected:
 nsca[19632]: SERVICE CHECK -> Host Name: 'localhost', Service Description:
 'SSH', Return Code: '2', Output: 'CRIT: foo bar baz'
which results to: 
[1293958612] PASSIVE SERVICE CHECK: localhost;SSH;2;CRIT: foo bar baz
[1293958612] SERVICE ALERT: localhost;SSH;CRITICAL;SOFT;1;CRIT: foo bar baz

So unfortunatly I can't see your problem. 

Alex






More information about the Pkg-nagios-devel mailing list