I am looking to include a readout of the duration in my email notifications. I've created an email template but do not see a variable for this. My commands (notify-host/service-by-email) appear to be formatted like the default template.
The notification commands do not pass HOSTDURATION to the template default and must be updated under Configure > Core Config Manager > Commands > _Commands. Here you'll find the default notify-host-by-email, notify-service-by-email, xi_host_notification_handler, xi_service_notification_handler. Any of these can be edited accordingly but it should be noted that the templates are applied to notification commands that use handle_nagioscore_notification.php.
An update to the xi_host_notification_handler command would look like:
Much appreciated, I've read that doc many times
So the variable needs to be made available in the handler as shown below. Can I then use Admin > Notification Management to invoke the variable on my email template? Or do I need to get into that PHP file?
Looking at notify-host-by-email, notify-service-by-email they are not a match for my email template...is there another command created when a custom email template is created?
cdienger wrote:The notification commands do not pass HOSTDURATION to the template default and must be updated under Configure > Core Config Manager > Commands > _Commands. Here you'll find the default notify-host-by-email, notify-service-by-email, xi_host_notification_handler, xi_service_notification_handler. Any of these can be edited accordingly but it should be noted that the templates are applied to notification commands that use handle_nagioscore_notification.php.
An update to the xi_host_notification_handler command would look like:
rkane wrote:...So the variable needs to be made available in the handler as shown below. Can I then use Admin > Notification Management to invoke the variable on my email template? ...
cdienger wrote:The notification commands do not pass HOSTDURATION to the template default and must be updated under Configure > Core Config Manager > Commands > _Commands. Here you'll find the default notify-host-by-email, notify-service-by-email, xi_host_notification_handler, xi_service_notification_handler. Any of these can be edited accordingly but it should be noted that the templates are applied to notification commands that use handle_nagioscore_notification.php.
An update to the xi_host_notification_handler command would look like: