Re: [Nagios-devel] Nagios appending when told to write?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Nagios appending when told to write?

Post by Guest »

This is a multi-part message in MIME format.

------=_NextPart_000_000F_01C75C05.63553970
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] 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
> >
> > 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

------=_NextPart_000_000F_01C75C05.63553970
Content-Type: application/x-pkcs7-signature;
name="smime.p7s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GAYDVQQKExFUaGF3dGUgQ29uc3VsdGluZzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBT
ZXJ2aWNlcyBEaXZpc2lvbjEkMCIGA1UEAxMbVGhhd3RlIFBlcnNvbmFsIEZyZWVtYWlsIENBMSsw
KQYJKoZIhvcNAQkBFhxwZXJzb25hbC1mcmVlbWFpbEB0aGF3dGUuY29tMB4XDTk2MDEwMTAwMDAw
MFoXDTIwMTIzMTIzNTk1OVowgdExCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUx
EjAQBgNVBAcTCUNhcGUgVG93bjEaMBgGA1UEChMRVGhhd3RlIENvbnN1bHRpbmcxKDAmBgNVBAsT
H0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2aXNpb24xJDAiBgNVBAMTG1RoYXd0ZSBQZXJzb25h
bCBGcmVlbWFpbCBDQTErMCkGCSqGSIb3DQEJARYccGVyc29uYWwtZnJlZW1haWxAdGhhd3RlLmNv
bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA1GnX1LCUZFtx6UfYDFG26nKRsIRefS0Nj3sS
34UldSh0OkIsYyeflXtL734Zhx2G6qPduc6WZBrCFG5ErHzmj+hND3EfQDim

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked