Notifications improvement

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
User avatar
srrhd
Posts: 131
Joined: Thu May 19, 2011 6:15 am

Notifications improvement

Post by srrhd »

What about implementing HTML notifications like "Nagios Flexible Notifications" from http://nagios.frank4dd.com/howto/nagios ... ations.htm ?
Configuration:
Nagios XI 2014R2.5
manually upgraded on 64bits CentOS 6
with nothing extra, no gnome, no proxy, no SSL
Add-ons: Hypermap, Minemap, Ping Action, Traceroute Action, Network Replay, Graph Explorer, Latest Alert
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Notifications improvement

Post by mguthrie »

HTML in the notification message is actually allowed already. You can just add html tags to a user's notification message to format it however you'd like.
***** Nagios XI Alert *****

<h1>TESTING CHANGES TO MY NOTIFICATION MESSAGE</h1>

Notification Type: %type%
Host: %host%
State: %hoststate%
Address: %hostaddress%
Info: %hostoutput%
Date/Time: %datetime%

Nagios URL: %xiserverurl%
TEST Macro: %_test%
At one point we added the ability to put php scripts right into the notification messages as well, but I don't know if we ever published the documentation for it or if it ever reached production, I'll do some snooping on that part.
ecarrasq
Posts: 244
Joined: Tue Feb 22, 2011 5:58 pm

Re: Notifications improvement

Post by ecarrasq »

Is there a way to change the notification messages per service by different hours?

Example:

service1(disk space usage)
notifications from 5am to 10pm send 'notification_message_X',
notifications from 10pm to 5am 'send notification_message_Z'
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Notifications improvement

Post by mguthrie »

Currently for this I think you'd have to have two contacts for a service, each with their own notification_period defined.

Contact A's notification period = 9am-5pm
Contact B's notification period = 5pm-9am
ecarrasq
Posts: 244
Joined: Tue Feb 22, 2011 5:58 pm

Re: Notifications improvement

Post by ecarrasq »

It is working well so far. Thank you for the tip.

1. I created the additional"Contacts" based on the individual Admin notification needs (requests). Were one admin would have about 3 or 4 contacts assigned to their email address.
2. Created a Contact Group, so I won't have to add each individual Admin to every service.
3. Created the customised notifications (added certain phrases on the subject line of the notification message, so their mobile devices can alert them based on a particular phrase/word).

All I have to do now is simply add the desired contact group to the individual service.

I tested everything and all is well.

Thank you,
Eddie
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Notifications improvement

Post by mguthrie »

Good deal, glad it's working for you!
Locked