[Nagiosplug-help] Notification not passing Macros
Kevin G. J. Freels
kfreels at stmarys-ca.edu
Thu Jun 9 00:43:17 CEST 2011
Greetings!!
My apologies if this has been covered, but I have not seen it in the
FAQ, Wiki, or lists.
ERRATA:
Nagios Version 3.2.1 on CentOS release 5.6
check_ping v1.4.14 (nagios-plugins 1.4.14)
We are not getting some of the Macro variables passed in the
check_ping plug-in. Here is an example of the email message we receive
when a host goes down.:
Notification Type: PROBLEM
Service: $
Host: uiweb1
Address: xxx.xxx.xxx.xxx
State: $
Date/Time: Mon Jun 6 13:29:29 PDT 2011
Info:$
Additional Info (if any):
$
Ack by:
So things like $NOTIFICATIONTYPE$, $HOSTADDRESS$, and $LONGDATETIME$
are passed just fine, but $SERVICEDESC$ and $SERVICESTATE$ are not.
Other plugins work just fine (ex.: check_imap):
Notification Type: PROBLEM
Service: IMAP
Host: mail
Address: xxx.xxx.xxx.xxx
State: CRITICAL
Date/Time: Thu May 12 11:58:09 PDT 2011
Info:No data received from host
Additional Info (if any):
Ack by :
Here is the config for that (the command_line is one line, no carriage
returns):
# 'notify-by-email' command definition
define command {
command_name notify-by-email
command_line /usr/bin/printf "%b" "Notification Type:
$NOTIFICATIONTYPE$\nService: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress:
$HOSTADDRESS$\nState: $SERVICESTATE$ \nDate/Time:
$LONGDATETIME$\nInfo:$SERVICEOUTPUT$\nAdditional Info (if
any):\n$LONGSERVICEOUTPUT$\nAck by
$NOTIFICATIONAUTHOR$:\n$NOTIFICATIONCOMMENT$" | /bin/mailx -s "Nagios
$NOTIFICATIONTYPE$ - $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ "
$CONTACTEMAIL$
}
It also breaks for the notify_by_epager config, same lack of variable
passing.
I saw some things about %<VAR_NAME>% and I tried changing it with
%SERVICESTATE% but that didn't work.
Has anyone else experienced issues with check_ping passing the
variables?
Thanks for the help, as always!
..k
Kevin Freels
Senior System Administrator / Network Analyst
Saint Mary's College
kfreels at stmarys-ca.edu
More information about the Help
mailing list