html emails

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
doneil326
Posts: 82
Joined: Fri Aug 14, 2015 3:26 pm

html emails

Post 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?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: html emails

Post 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
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
doneil326
Posts: 82
Joined: Fri Aug 14, 2015 3:26 pm

Re: html emails

Post by doneil326 »

they go to team distribution lists, so they are contacts only.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: html emails

Post 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.
Former Nagios Employee
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: html emails

Post 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).
Locked