Nagios appending when told to write?

Thomas Guyot-Sionnest Thomas at zango.com
Thu Mar 1 19:27:41 CET 2007


> -----Original Message-----
> From: nagios-devel-bounces at lists.sourceforge.net 
> [mailto:nagios-devel-bounces at lists.sourceforge.net] On Behalf 
> Of Ethan Galstad
> Sent: March 1, 2007 12:42
> To: Nagios Developers List
> Subject: Re: [Nagios-devel] Nagios appending when told to write?
> 
> Thomas Guyot-Sionnest wrote:
> > I just seen this from a strace:
> > 
> > open("/path/to/service-perfdata.fifo",
> > O_WRONLY|O_APPEND|O_CREAT|O_LARGEFILE, 0666 <unfinished ...>
> > 
> > My /path/to/service-perfdata.fifo is set to be oppened 
> normally instead of
> > O_APPEND by this directive:
> > 
> > service_perfdata_file_mode=w
> > 
> > Is that a bug?
> > 
> > Thomas
> 
> Looks like the system is adding the O_APPEND flag, since Nagios just 
> used fopen() with "a" or "w" values.  Is it working okay?  AFAIK, 
> appending to a pipe/fifo should work just fine.

It does, though I'd like to test different ways to open files, including the
possibility of opening pipes without blocking if there's no reader and/or
writing pipes in non-blocking mode and/or filling pipes even if there's no
reader.

I say "and/or" because I do not know yet all the effects of different flags,
so for example maybe O_NONBLOCK would allow to open and fill the pipe
without reader but I need to verify that. Maybe the way to make it work will
be to set/unset some flags after opening...

Right now with "w" Nagios blocks on open but doesn't on write when there's
no reader, though the pipe does not fills up.

I'd like to have at least one additional behavior which is similar to
syslogd: never block on open, fill the pipe and loose data if pipe is full.
All I know so far is that O_NONBLOCK is set but there's no polling on it.

Ideally Nagios should never block on pipes if there's no reader no matter
what the write mode is. It could maybe log when it gets a write error on the
file/pipe, though this must not be logged at each write. It could also log
warnings for dubious operations like nonblock write (without polling) on
normal files which is really asking for trouble!

Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3076 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20070301/b4418dc8/attachment.bin>
-------------- next part --------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list