FYI, nagios command file pipe may cause passive service corruption

Mooney, Ryan ryan.mooney at pnl.gov
Sat Jun 14 01:28:30 CEST 2003


Interesting because I clearly saw messages stomping on each other with smaller
messages than PIPE_BUF.  Hmm...  Looking closer my external commands scripts 
that pump the data in are all perl and I didn't set the output to the pipe to 
be unbuffered.  I pre-generate the results for N hosts (where N is big) and shove 
them in all at once (well I do a seperate printf("...") for each one) perl was 
probably buffering my write up for me and then blasting a rather large chunk in 
all at once thus causing the problem.  Still a little scary since I have to make 
sure all my write to pipe programs are well behaved in that regard and flush
thier output after each message (not a big deal, but..).

> -----Original Message-----
> From: Stanley Hopcroft [mailto:Stanley.Hopcroft at IPAustralia.Gov.AU]
> Sent: Friday, June 13, 2003 3:57 PM
> To: Mooney, Ryan
> Cc: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] FYI, nagios command file pipe may cause
> passive service corruption
> 
> 
> Dear Sir,
> 
> You may be mistaken in the matter of interleaving with _high 
> volumes_ of
> messages input to the Nagios command file.
> 
> Most of the texts (eg W R Stevens APUE p 446) state that provided each
> process writes no more than PIPE_BUF per write, there will be no
> interleaving, regardless of the input rate.
> 
> Writes to a named pipe will be atomic if each write is less than
> PIPE_BUF (perl -MPOSIX=_POSIX_PIPE_BUF -e 'print 
> _POSIX_PIPE_BUF, "\n"'
> on this FreeBSD system it is 512 bytes).
> 
> Yours sincerely.
> 
> -- 
> --------------------------------------------------------------
> ----------
> Stanley Hopcroft
> --------------------------------------------------------------
> ----------
> 
> '...No man is an island, entire of itself; every man is a piece of the
> continent, a part of the main. If a clod be washed away by the sea,
> Europe is the less, as well as if a promontory were, as well as if a
> manor of thy friend's or of thine own were. Any man's death diminishes
> me, because I am involved in mankind; and therefore never send to know
> for whom the bell tolls; it tolls for thee...'
> 
> from Meditation 17, J Donne.
> 


-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
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