Page 1 of 1

HTML notifications & replacing xi_host_notification_handler

Posted: Mon Mar 16, 2015 6:27 am
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!

Re: HTML notifications & replacing xi_host_notification_hand

Posted: Mon Mar 16, 2015 2:08 pm
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".

Re: HTML notifications & replacing xi_host_notification_hand

Posted: Wed Mar 18, 2015 6:44 am
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!

Re: HTML notifications & replacing xi_host_notification_hand

Posted: Wed Mar 18, 2015 9:05 am
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.

Re: HTML notifications & replacing xi_host_notification_hand

Posted: Wed Mar 18, 2015 1:47 pm
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!

Re: HTML notifications & replacing xi_host_notification_hand

Posted: Wed Mar 18, 2015 1:53 pm
by tmcdonald
I'll be closing this thread now, but feel free to open another if you need anything in the future!