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.
Notification command
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Notification command
Hi again larp,
The notifications are a command just like any other. The default service notification command you might see looks something like this:
You can tailor that to fit your needs or create entirely new ones.
Find it in:
Configure --> Core Configuration Manager --> Commands --> Commands
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$"Find it in:
Configure --> Core Configuration Manager --> Commands --> Commands