Weird error with Nagios 2.0b4 on RHEL 4

Andreas Ericsson ae at op5.se
Fri Oct 28 02:17:45 CEST 2005


Fred wrote:
> 
> --- Andreas Ericsson <ae at op5.se> wrote:
> 
> 
>>Fred wrote:
>>
>>
>>fgets() is supposed to return whatever it can read if there's no newline 
>>within the limits of the second arg.
> 
> 
> I can promise that if I do large writes to a FIFO:
> 
> @array = ... lots of fifo lines
> print FIFO @array;
> 
> that perl does large block writes and the fgets() *sometimes* returns
> a short line and the rest of the line gets picked up in the next fgets().


man 3 fgets

Not that it matters though, since nagios doesn't use fgets() from the 
pipe. Only perl is stupid enough to use textbased protocols when binary 
ones are easier (binary protocols are *always* faster).

> Doing sysopen(), $|=1; while (@array) { print FIFO $_ } cleans things
> up.  This causes smaller line writes to be written to the FIFO and seems
> to workaround the problem.
> 

I'm sure it does. Nagios still doesn't fget()'s though.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
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