Page 1 of 1

Using $ARGn$ Macros in perfdata

Posted: Thu Nov 08, 2012 2:06 pm
by whama01
Hi All

Having used Nagios quite successfully for a number of years, I have recently been looking to expand the performance data I expose to include the values of the Nagios Macros ($ARGn$) that I have defined (and which work perfectly well for passing parameters to my Command definitions from the Service definitions)

When I include for example $ARG1$ and $ARG2$ in the service_perfdata_file_template (see example below), nothing for these Nagios Macros is output (again, see example below). If I include other Macros (e.g $HOSTNAME$ or any of the $USERn$), they work as expected.

Example Command Definition:

define command{
command_name check_ema_vectorwise_vwinfo
command_line $USER1$/check_by_ssh -p $ARG1$ -l ingres -i $USER5$/$HOSTNAME$_ingres -H $HOSTADDRESS$ -C '$USER6$/check_ema_vectorwise_vwinfo -s $ARG2$ -t $ARG3$ -d $ARG4$'
}

Example Service Definition (cut down for simplicity):

define service{
host_name whama01_rhel01
check_command check_ema_vectorwise_vwinfo!22!/home/ingres/inst_ivw/V4!2!vw25_100mcolumns
}

Entry for service_perfdata_file_template in Nagios.cfg (cut down for simplicity):

service_perfdata_file_template=$LASTSERVICECHECK$||$HOSTNAME$||ARG1:||$ARG1$||ARG2:||$ARG2$||USER5:||$USER5$

(Note I have included labels e.g. ARG1: and am using delimiters of 2x pipe symbols)

Sample output sent to perfdata file:

1352387027||whama01_rhel01||ARG1:||||ARG2:||||USER5:||usr/local/nagios/keys
1352387024||whama01_rhel01||ARG1:||||ARG2:||||USER5:||usr/local/nagios/keys

Am I missing something, or are the $ARGn$ Macros not available in the Service Performance Data template?

Any thoughts gratefully received

Kindest Regards

Mark Whalley
Actian Corp (previously Ingres Corp)


Nagios Core 3.3.1

Re: Using $ARGn$ Macros in perfdata

Posted: Thu Nov 08, 2012 3:39 pm
by agriffin
I don't see any reason why it shouldn't work. This could just be a bug, and I would actually suggest filing a bug report here.

Re: Using $ARGn$ Macros in perfdata

Posted: Thu Nov 08, 2012 4:22 pm
by whama01
Hi "agriffin"

Many thanks for your prompt response.

I have, as suggested, raised this as a Mantis issue (397)

Kindest Regards
Mark