Page 1 of 1

html emails

Posted: Tue May 03, 2016 2:06 pm
by doneil326
is there a way to get html email notifications like the ones shown in this link http://nagios.fm4dd.com/howto/nagios-fl ... ations.htm? it doesnt appear that xi makes the /pnp4nagios accessible via apache, so should we be putting a Directory statement for /usr/local/nagios/etc/pnp/ in the nagios.conf to get this to work? Is there a different plugin that works by default with XI?

Re: html emails

Posted: Tue May 03, 2016 2:55 pm
by lmiltchev
Are your monitoring contacts "xi users" or "contacts only"? Other words, are they using the "default" notification handlers (xi_host_notification_handler & xi_service_notification_handler) or the "core" notification handlers (notify-host-by-email & notify-service-by-email)?

The "xi users" can modify their notification messages but "contacts only" cannot. With "xi users" you could use simle html tags in the host/service alert messages.

For example, you could have:

In the "Host Alert Message" field:

Code: Select all

Notes URL: <a href="%notesurl%">%notesurl%</a>
Action URL: <a href="%actionurl%">%actionurl%</a>
In the "xi_host_notification_handler" command:

Code: Select all

--notesurl="$HOSTNOTESURL$" --actionurl="$HOSTACTIONURL$"
The notesurl and action url links in the actual email notification will be "clickable".
example01.PNG

Re: html emails

Posted: Tue May 03, 2016 11:35 pm
by doneil326
they go to team distribution lists, so they are contacts only.

Re: html emails

Posted: Wed May 04, 2016 1:32 pm
by rkennedy
This won't be possible with contacts, they will need to be setup as users in order to use the HTML / add additional fields.

I'd recommend changing them, adjusting your commands as stated above, and you'll then be able to use HTML.

Re: html emails

Posted: Wed May 04, 2016 1:41 pm
by ssax
It looks like you might be able to construct a URL:

Code: Select all

http://YOURXISERVER/nagiosxi/includes/components/perfdata/graphApi.php?host=localhost&service=PING&source=1&view=1&start=&end=&username=nagiosadmin&ticket=XXXXXXX
You can get the ticket number by masquerading as the user you want and clicking their username in the top right corner (it's the API key).