Assuming you are using the standard
xi_[host/service]_notification_handler command for the given contact, here is what happens:
1.) A check is run against a host/service and this check is the Nth time it has returned non-OK, where N is max_check_attempts
2.) The command specified for that contact is looked up, in this case the command is
xi_[host/service]_notification_handler - By default, here are the command configurations:
xi_host_notification_handler
Code: Select all
/usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php --notification-type=host --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdisplayname="$HOSTDISPLAYNAME$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOSTSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$ --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput="$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --datetime="$LONGDATETIME$"
xi_service_notification_handler
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$"
3.) The necessary command is run. In the case of the standard
xi_[host/service]_notification_handler commands, the PHP script will be handed a list of Nagios macros that will be replaced by the nagios binary with their appropriate values.
$HOSTADDRESS$ will be replaced with the address of the host,
$LONGDATETIME$ will have the date, etc.
4.) The
/usr/local/nagiosxi/scripts/handle_nagioscore_notification.php script will add the notification to the event queue which is processed by (I believe) the
/usr/local/nagiosxi/cron/eventman.php cron job script.
5.) At this point I would need to get developer clarification as to what happens, as some of it is somewhat proprietary. We use PHPMailer to handle our User-based notifications, I know that much.
It is entirely possible that, since Users do not use sendmail, your notification may not end up in the maillog, so looking there for evidence of notifications might not be accurate. Typically I look under Home -> Notifications for a first indications of whether or not notification commands (
xi_[host/service]_notification_handler) are even being triggered in the first place.
Notification macros:
https://assets.nagios.com/downloads/nag ... iables.pdf
Users and contacts:
https://assets.nagios.com/downloads/nag ... ntacts.pdf
Configuring contacts to use User notifications:
https://assets.nagios.com/downloads/nag ... Mailer.pdf