Bug with macros expansion and perfdata command?

Maxime Henrion m.henrion at mediactive.fr
Mon Aug 21 15:51:37 CEST 2006


On Mon, 2006-08-21 at 15:33 +0200, Maxime Henrion wrote:
> 	Hello all,
> 
> 
> I've been recently trying to setup nagiostat with my nagios 2.5
> installation.  Unfortunately, it turns out that there seems to be a bug
> with nagios and macros expansion for the service perfdata command.
> 
> None of the macros referenced in the command get expanded.  I first
> thought it was only a problem with the nagiostat documentation being
> out-of-date, and had to replace a few macros: $LASTCHECK$ ->
> $SERVICELASTCHECK$, $OUTPUT$ -> $SERVICEOUTPUT$ and $PERFDATA$ ->
> $SERVICEPERFDATA$, but that wasn't sufficient and the nagiostat script
> was still getting empty stuff.
> 
> So, I changed the service perfdata command to the one provided in the
> example configuration file for testing purposes :
> 
> 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/spool/nagios/service-perfdata.out
> 
> and I only get empty lines in the /var/spool/nagios/service-perfdata.out
> file, which seems to confirm that nagios isn't properly expanding the
> macros like with every other command.
> 
> Am I doing something stupid?

Oops, I was.  When migrating from nagiosgraph to nagiostat, I mixed up
the service perfdata command and the service perfdata file command.  It
totally makes sense for the command used to handle the whole file to not
have these macros expanded, and nagiosgraph was using this command and
not the one ran after every service check.

Sorry for the noise,
Maxime


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the Developers mailing list