Page 1 of 1

Re: [Nagios-devel] Bug with macros expansion and perfdata command?

Posted: Mon Aug 21, 2006 5:54 am
by Guest
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






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