HTML notifications & replacing xi_host_notification_handler

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
CWSI
Posts: 30
Joined: Tue Oct 28, 2014 7:41 am

HTML notifications & replacing xi_host_notification_handler

Post by CWSI »

Hey,

Just looking for some input here if anybody has some thoughts.

I'd like to customise the email notifications from XI, I see I can put some HTML in via the Admin console but I'd like to be able to use PHP to take the customisation a bit further. So my thought is to create two new Commands (xxx_send_email and xxx_send_sms) and update my ContactGroups to use both of these when it wants to send out alerts. Looks like this should work basing it off something like this http://exchange.nagios.org/directory/Ad ... v2/details but I'm wondering if I will "break" anything in XI by no longer using xi_host_notification_handler/xi_service_notification_handler? I cannot tell if these two command simply send an email/SMS or if they do anything else with the system.


Any input gratefully received!
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: HTML notifications & replacing xi_host_notification_hand

Post by ssax »

It will not break anything by using a custom notification handler.

The difference you will see is when you look under notifications under the dispatcher column it will say "Custom".
CWSI
Posts: 30
Joined: Tue Oct 28, 2014 7:41 am

Re: HTML notifications & replacing xi_host_notification_hand

Post by CWSI »

Great thanks!

While we're on the subject, one of the things I'm trying to overcome at the moment is that I'd like to send alerts via SMS only when they are critical, while Warning/Unknown would be email-only. I don't see a way to do this in XI so I'm planning on just building the logic into a single NotificationHandler, but before I go and do that am I missing something in the GUI?


Thanks again!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: HTML notifications & replacing xi_host_notification_hand

Post by tmcdonald »

Traditionally we have always just had two contacts - "someuser" and "someuser-sms" and assigned them both to a host/service, then set the notification preferences separately.
Former Nagios employee
CWSI
Posts: 30
Joined: Tue Oct 28, 2014 7:41 am

Re: HTML notifications & replacing xi_host_notification_hand

Post by CWSI »

Yep that would make sense alright!

Think I'll plug away and see if I can build the logic into a script as I'd sooner only have a single contact if possible, we may end up with quite a few so the less management the better. Have to go to an external script to use the REST API for the likes of ClickATell anyway...

Thanks again!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: HTML notifications & replacing xi_host_notification_hand

Post by tmcdonald »

I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee
Locked