[Nagios-devel] command pipe concatenated messages

Jim Mozley jim.mozley at exponential-e.com
Tue Dec 23 02:52:02 UTC 2003


Hi All,

Hope I am starting a discussion in the correct forum, I think this is 
more of a development issue rather than anything else.

I have been seeing a problem with submitting passive checks using 
version 1.0 on Solaris 8. I had some discusions on this originally on 
the nagios-users list, asked some questions on comp.lang.misc.perl and 
finally ended up discussing this with Al Tobey as he I had some 
questions on how he implemented command submission via in his perl module.

The issue I see is with multiple passive checks becoming concatenated, 
so I end up with events like this:

My service is Up Some description[1065056739]
PROCESS_SERVICE_CHECK_RESULT:my-host:my-service:0:Some description.

Where another passive check becomes part of the description field of the 
previous check.

I am using some perl code to submit commands containing:


open(PIPE, "> $pipe") or croak "Cannot open pipe $!";
flock(PIPE, LOCK_EX);
print PIPE "$cmd";
# wait before releasing lock so we don't overlap cmds to Nagios
sleep 2;
close PIPE or croak "Cannot close pipe $!"; # also releases lock


I ended up with having command_check_interval=1s (originally I had not 
added the "s") on the theory that if the pipe was read every second and 
commands submitted only every two seconds I should never see over 
lapping commands. In general this is the case, however, during an "event 
storm" (generated from network device syslog messages) I am still seeing 
these concatenated messages. I cannot recreate the problem by testing 
and Al added a test to his module for this which passes OK. But I still 
see it occasionaly on our system.

As a result of all this I have a few questions:

Has anyone seen this issue?
Is this a problem with the approach/code I am using?
Is it a Solaris specific issue?
I'm not able to upgrade to 1.1 yet but would this help (I couldn't see 
anything indicating a fix for this)?

Thanks,

Jim




More information about the Nagios-devel mailing list