Better write_fifo.c ?

Hugo van der Kooij hvdkooij at vanderkooij.org
Fri Apr 7 23:53:08 CEST 2006


On Fri, 7 Apr 2006, Hugo van der Kooij wrote:

> In my pursuit in getting performance graphs working it seems the culprit
> is in fact the tool for writing to the fifo.

And sometimes one is using too many complicated tools when an easier
answer it to use tools at hand.

I have redefined nagios to use printf and it seems to work. If anyone want
to try it:

# 'process-service-perfdata' command definition
define command {
        command_name    process-service-perfdata
#       command_line    /usr/lib/nagios/eventhandlers/fifo_write.pl     /var/lib/nagios/ngraph.pipe     '$HOSTNAME$     $SERVICEDESC$   $SERVICEOUTPUT$ $SERVICEPERFDATA$'      3
#       command_line    /usr/lib/nagios/nagiosgrapher/fifo_write.pl /var/spool/nagios/ngraph.pipe '$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n' 3
#       command_line    /usr/lib/nagios/nagiosgrapher/fifo_write        /var/spool/nagios/ngraph.pipe '$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$'   3
        command_line    /usr/bin/printf "%b" "$HOSTNAME$\t$SERVICEDESC$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /var/spool/nagios/ngraph.pipe
#       command_line    /usr/lib/nagios/nagiosgrapher/write_fifo -p /var/spool/nagios/ngraph.pipe -s '$HOSTNAME$        $SERVICEDESC$   $SERVICEOUTPUT$ $SERVICEPERFDATA$'
#       command_line    /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /var/log/nagios/service-perfdata.log
        }

As one can see I have tried quite a few options.

I will let it run tonight while I sleep. I will give you an update in the
morning. (Fingers crossed ;-)

Hugo.

-- 
	I hate duplicates. Just reply to the relevant mailinglist.
	hvdkooij at vanderkooij.org		http://hvdkooij.xs4all.nl/
		Don't meddle in the affairs of magicians,
		for they are subtle and quick to anger.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
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