Hello,
We created a command in Nagios CCM called "send_snmptrap" which contains the following line:
/usr/bin/snmptrap -v 2c -c public 10.10.10.99 '' NAGIOS-NOTIFY-MIB::nSvcEvent nSvcHostname s "$HOSTNAME$" nSvcDesc s "$SERVICEDESC$" nSvcStateID i $SERVICESTATEID$ nSvcOutput s "$SERVICEOUTPUT$"
We are trying to configure an Event Handler to use the $SERVICESTATEID$ macro to pass the actual state of a Service Event via snmptrap.
Currently, the macro $SERVICESTATEID$ is not returning with a value (integer) for this service check command. If we replace the macro with a static value, e.g. 1, then the trap message arrives as expected. Otherwise, the event never makes it to the SNMP logs. We understand that not all macros may be "valid" in a particular type of command. However, the MACRO $SERVICESTATEID$ is supposed to be valid for Service Event Handlers.
Can someone please advise?
Thanks,
KLee
$SERVICESTATEID$ Macro
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: $SERVICESTATEID$ Macro
What version of XI are you on presently? Have you tried having this echoed to a temp file like so?
EDIT: Create a new command for the following and then run it and check /tmp/test:
Topic was locked, but solution is here - http://support.nagios.com/forum/viewtop ... 557#p94557
EDIT: Create a new command for the following and then run it and check /tmp/test:
Code: Select all
/bin/echo nSvcHostname s "$HOSTNAME$" nSvcDesc s "$SERVICEDESC$" nSvcStateID i $SERVICESTATEID$ nSvcOutput s "$SERVICEOUTPUT$" >> /tmp/testNagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.