Notification variables

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Notification variables

Post by BanditBBS »

Ok, so I want to modify my on_call handling just a tad, I have these two commands in ccm:

Code: Select all

xi_service_notification_handler_on_call
  $USER1$/service_on_call.pl "$CONTACTNAME$" $NOTIFICATIONTYPE$ "$NOTIFICATIONISESCALATED$" "$NOTIFICATIONAUTHOR$" "$NOTIFICATIONCOMMENT$" "$HOSTNAME$" "$HOSTADDRESS$" "$HOSTALIAS$" "$HOSTDISPLAYNAME$" "$SERVICEDESC$" $HOSTSTATE$ $HOSTSTATEID$ $SERVICESTATE$ $SERVICESTATEID$ $LASTSERVICESTATE$ $LASTSERVICESTATEID$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ $MAXSERVICEATTEMPTS$ $SERVICEEVENTID$ $SERVICEPROBLEMID$ "$SERVICEOUTPUT$" "$LONGSERVICEOUTPUT$" "$LONGDATETIME$"

Code: Select all

  xi_host_notification_handler_on_call
  $USER1$/host_on_call.pl "$CONTACTNAME$" $NOTIFICATIONTYPE$ "$NOTIFICATIONISESCALATED$" "$NOTIFICATIONAUTHOR$" "$NOTIFICATIONCOMMENT$" "$HOSTNAME$" "$HOSTADDRESS$" "$HOSTALIAS$" "$HOSTDISPLAYNAME$" $HOSTSTATE$ $HOSTSTATEID$ $LASTHOSTSTATE$ $LASTHOSTSTATEID$ $HOSTSTATETYPE$ $HOSTATTEMPT$ $MAXHOSTATTEMPTS$ $HOSTEVENTID$ $HOSTPROBLEMID$ "$HOSTOUTPUT$" "$LONGHOSTOUTPUT$" "$LONGDATETIME$"
Both of those scripts do what they need to do and end with a command similar to this:

Code: Select all

system("/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=host --contact=\"$user\" --contactemail=\"@$ref\" --type=$ARGV[1] --escalated=\"$ARGV[2]\" --author=\"$ARGV[3]\" --comments=\"$ARGV[4]\" --host=\"$ARGV[5]\" --hostaddress=\"$ARGV[6]\" --hostalias=\"$ARGV[7]\" --hostdisplayname=\"$ARGV[8]\" --hoststate=$ARGV[9] --hoststateid=$ARGV[10] --lasthoststate=$ARGV[11] --lasthoststateid=$ARGV[12] --hoststatetype=$ARGV[13] --currentattempt=$ARGV[14] --maxattempts=$ARGV[15] --hosteventid=$ARGV[16] --hostproblemid=$ARGV[17] --hostoutput=\"$ARGV[18]\" --longhostoutput=\"$ARGV[19]\" --datetime=\"$ARGV[20]\"");
What I'm wanting to do, is change what my scripts do, based on the notification #. Is there a variable I can pass that tells it what notification it is currently on? I tried searching and just couldn't seem to find the proper information if it exists.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Notification variables

Post by BanditBBS »

tired of waiting on that slow poke Trevor to answer or Andy to come and tell me NO, so I googled some more. LOL :lol:

http://nagios.sourceforge.net/docs/3_0/ ... tionnumber is what I want, right?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Notification variables

Post by abrist »

BanditBBS wrote:Andy to come and tell me NO
BanditBBS wrote:is what I want, right?
Yes.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Notification variables

Post by BanditBBS »

HAHAHA, On an angry call right now and I almost bust out laughing.

Thanks Andy, lock her up!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Notification variables

Post by abrist »

BanditBBS wrote:Thanks Andy, lock her up!
NO.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked