Notification command

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
larp
Posts: 13
Joined: Mon Mar 23, 2015 12:03 pm

Notification command

Post by larp »

Hi

Is there a smart way to run a command when a service or a host sends a notification.

The reason is that our security depart want to scan and archive all SMS sended, so I need place the the SMS at a file share in a XML format (which I can build within the command) then the scanner will pick it up validate it, archive it and then send it.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Notification command

Post by jdalrymple »

Hi again larp,

The notifications are a command just like any other. The default service notification command you might see looks something like this:

Code: Select all

/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=service --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --service="$SERVICEDESC$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --servicestate=$SERVICESTATE$ --servicestateid=$SERVICESTATEID$ --lastservicestate=$LASTSERVICESTATE$ --lastservicestateid=$LASTSERVICESTATEID$ --servicestatetype=$SERVICESTATETYPE$ --currentattempt=$SERVICEATTEMPT$ --maxattempts=$MAXSERVICEATTEMPTS$ --serviceeventid=$SERVICEEVENTID$ --serviceproblemid=$SERVICEPROBLEMID$ --serviceoutput="$SERVICEOUTPUT$" --longserviceoutput="$LONGSERVICEOUTPUT$" --datetime="$LONGDATETIME$"
You can tailor that to fit your needs or create entirely new ones.

Find it in:

Configure --> Core Configuration Manager --> Commands --> Commands
Locked