NSCA using PROCESS_FILE

Hendrik Baecker andurin at process-zero.de
Wed Feb 28 12:22:05 CET 2007


Gerd Mueller schrieb:
> Hi Hendrik,
>
>   
>> 1. What happens when the external Daemon crashes and the pipe will be
>> erased? 
>>     
>
> How should the pipe be erased by accident? If you do not erease it it
> will survive. 
>   
Ok, you are right. If your Daemon which creates the pipe won't clean it
up, the pipe will resist until some higher presence came down and clean
it up (kernel, user, whatever).
>   
>> Does is hurts nagios? 
>>     
>
> I see different problem. If the daemon dies the pipe would never be
> cleaned, nagios will not be able to attach data to such a full pipe. So
> nagios will be slowed down until the ocsp/ochp commands timeout. We had
> this problem with the perfdata commands and our nagiosgrapher. That is
> the only reason why we switched to use udp rather than using a pipe. But
> summarized I do not see such a problem with using a pipe.
>   
There is a little difference of internal work lies on how you are
create/connect to the pipe... blocking or non-blocking is the question.
If blocking:
No write access if there is no listener
and also no listener when there is no writer.

if non-blocking:
listener without writer is possible but
writing without listener will fail
but: writing to full pipe will fail with same error as writing without
listener....

I hope this is not the biggest shit I've read... information from:

http://www.die.net/doc/linux/man/man7/pipe.7.html

> BTW after dealing with this issue I do not see very much difference
> between oc(h|s)p commands and perfdata commands. I wonder if nagios
> should have a stack of "do something or write into a file/pipe after the
> checks" commands. Instead of using different commands.
>
> Cheers,
>
> Gerd
>   
I think there is no difference between oc(s|h)p command and perfdata
command. Command is command and the command is the bottleneck.
But using the perfdata_files instead of the *commands is just an append
to an file (just write to a file descriptor) and not executing
(fork,system or exec) a complete command.

AFAIK it should not be so heavy to define the right "perfdata" syntax to
write the needed oc(s|h)p macros to an perfdata file / fifo, read this
file/fifo with an external daemon and do whatever you want with this
data. At this place it is the job of your daemon what to do with the data.

Best wishes
Hendrik

-------------------------------------------------------------------------
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




More information about the Developers mailing list