Using $ARGn$ Macros in perfdata
Posted: Thu Nov 08, 2012 2:06 pm
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
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