Failing event_handlers and ocsp/ochp_command not logged?

Brian A. Seklecki lavalamp at spiritual-machines.org
Wed Jan 2 21:06:43 CET 2008


What happens if ocsp/ohcp commands return non-zero status?

# send_nsca -H doesnt.fucking.exist -c foo/etc/nagios/send_nsca.cfg
Invalid host name 'doesnt.fucking.exist'
Error: Could not connect to host doesnt.fucking.exist on port 5667
# echo $?
2

When this happens, its a very serious problem.  Nothing is logged. This
results in a silent failure. 

Obviously, send_nsca should transmit to a hostname in hosts(5) and/or to
an IP address that is highly available resolving any dependency on DNS. 

But even with that in mind, this exec()/fork() model behavior is
pragmatically incorrect.

The code should be checking result code for return values != 0, and
printing a critical error to the logs.

Moreover, even with debug_level=99999999999999999999999999

No warning / error / notice occurs:


[1199302511.076169] [001.0] [pid=75615] handle_host_state()
[1199302511.076189] [001.0] [pid=75615]
obsessive_compulsive_host_check_processor()
[1199302511.076229] [001.0] [pid=75615] get_raw_command_line()
[1199302511.076261] [2320.2] [pid=75615] Raw Command Input: /bin/echo
$HOSTNAME$//$HOSTSTATEID$//'$HOSTOUTPUT$' | /usr/local/sbin/send_nsca -H
fbsd01.cfi.biz -c /usr/local/etc/nagios/send_nsca.cfg -d "//"
[1199302511.076284] [2320.2] [pid=75615] Expanded Command
Output: /bin/echo $HOSTNAME$//$HOSTSTATEID$//'$HOSTOUTPUT$'
| /usr/local/sbin/send_nsca -H fbsd01.cfi.biz
-c /usr/local/etc/nagios/send_nsca.cfg -d "//"
[1199302511.076289] [016.2] [pid=75615] Raw obsessive compulsive host
processor command line: /bin/echo $HOSTNAME$//$HOSTSTATEID
$//'$HOSTOUTPUT$' | /usr/local/sbin/send_nsca -H fbsd01.cfi.biz
-c /usr/local/etc/nagios/send_nsca.cfg -d "//"
[1199302511.076664] [001.0] [pid=75615] process_macros()
[1199302511.076683] [2048.1] [pid=75615] **** BEGIN MACRO PROCESSING
***********
[1199302511.076700] [2048.1] [pid=75615] Processing: '/bin/echo
$HOSTNAME$//$HOSTSTATEID$//'$HOSTOUTPUT$' | /usr/local/sbin/send_nsca -H
fbsd01.cfi.biz -c /usr/local/etc/nagios/send_nsca.cfg -d "//"'
[1199302511.076720] [2048.2] [pid=75615]   Processing part: '/bin/echo '
[1199302511.076739] [2048.2] [pid=75615]   Not currently in macro.
Running output (10): '/bin/echo '
[1199302511.076758] [2048.2] [pid=75615]   Processing part: 'HOSTNAME'
[1199302511.076780] [2048.2] [pid=75615]   Uncleaned macro.  Running
output (16): '/bin/echo fbsd01'
[1199302511.077138] [2048.2] [pid=75615]   Just finished macro.  Running
output (16): '/bin/echo fbsd01'
[1199302511.077157] [2048.2] [pid=75615]   Processing part: '//'
[1199302511.077176] [2048.2] [pid=75615]   Not currently in macro.
Running output (18): '/bin/echo fbsd01//'
[1199302511.077194] [2048.2] [pid=75615]   Processing part:
'HOSTSTATEID'
[1199302511.077216] [2048.2] [pid=75615]   Uncleaned macro.  Running
output (19): '/bin/echo fbsd01//0'
[1199302511.077235] [2048.2] [pid=75615]   Just finished macro.  Running
output (19): '/bin/echo fbsd01//0'
[1199302511.077254] [2048.2] [pid=75615]   Processing part: '//''
[1199302511.077273] [2048.2] [pid=75615]   Not currently in macro.
Running output (22): '/bin/echo fbsd01//0//''
[1199302511.077291] [2048.2] [pid=75615]   Processing part: 'HOSTOUTPUT'
[1199302511.079235] [2048.2] [pid=75615]   Uncleaned macro.  Running
output (63): '/bin/echo fbsd01//0//'PING OK - Packet loss = 0%, RTA =
0.97 ms'
[1199302511.079337] [2048.2] [pid=75615]   Just finished macro.  Running
output (63): '/bin/echo fbsd01//0//'PING OK - Packet loss = 0%, RTA =
0.97 ms'
[1199302511.079805] [2048.2] [pid=75615]   Processing part: ''
| /usr/local/sbin/send_nsca -H fbsd01.cfi.biz
-c /usr/local/etc/nagios/send_nsca.cfg -d "//"'
[1199302511.080427] [2048.2] [pid=75615]   Not currently in macro.
Running output (157): '/bin/echo fbsd01//0//'PING OK - Packet loss = 0%,
RTA = 0.97 ms' | /usr/local/sbin/send_nsca -H fbsd01.cfi.biz
-c /usr/local/etc/nagios/send_nsca.cfg -d "//"'
[1199302511.081348] [2048.1] [pid=75615]   Done.  Final output:
'/bin/echo fbsd01//0//'PING OK - Packet loss = 0%, RTA = 0.97 ms'
| /usr/local/sbin/send_nsca -H fbsd01.cfi.biz
-c /usr/local/etc/nagios/send_nsca.cfg -d "//"'
[1199302511.081823] [2048.1] [pid=75615] **** END MACRO PROCESSING
*************
[1199302511.082308] [016.2] [pid=75615] Processed obsessive compulsive
host processor command line: /bin/echo fbsd01//0//'PING OK - Packet loss
= 0%, RTA = 0.97 ms' | /usr/local/sbin/send_nsca -H fbsd01.cfi.biz
-c /usr/local/etc/nagios/send_nsca.cfg -d "//"
[1199302511.083217] [001.0] [pid=75615] my_system()
[1199302511.084280] [256.1] [pid=75615] Running command '/bin/echo
fbsd01//0//'PING OK - Packet loss = 0%, RTA = 0.97 ms'
| /usr/local/sbin/send_nsca -H fbsd01.cfi.biz
-c /usr/local/etc/nagios/send_nsca.cfg -d "//"'...
[1199302511.091760] [001.0] [pid=80369] process_macros()
[1199302511.092248] [001.0] [pid=80369] process_macros()
[1199302511.093349] [001.0] [pid=80369] process_macros()
[1199302511.094769] [001.0] [pid=80369] process_macros()
[1199302511.095734] [001.0] [pid=80369] process_macros()
[1199302511.096702] [001.0] [pid=80369] process_macros()



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list