Page 1 of 1
Returning a URL in the Nagios Alert
Posted: Tue Dec 04, 2012 10:23 am
by mbowden
Could you tell me where I need to add a URL to populate the Info: section of the Nagios Alert that is sent out?
When the alert is sent I want it to contain a like to relevent information to resolve the issue?
I have a script that checks to see if a Java Program is functioning properly, the script corectly alerts on failure. However when the alert is sent I want it to contain a link/url to relevent internal wiki information to resolve the issue. Is this done through the XI interface or is it an argument in the script (like the "Critical: Service is Down")
Re: Returning a URL in the Nagios Alert
Posted: Tue Dec 04, 2012 10:44 am
by scottwilkerson
Here's what you can do for these.
Add this URL to
Configure -> CCM -> Services -> Modify -> Misc Settings Tab -> Action URL
Then, add the following to your service notification handler command (xi_service_notification_handler by default in XI)
Configure -> CCM -> Commands -> xi_service_notification_handler -> Modify
Code: Select all
--serviceactionurl=$SERVICEACTIONURL$
Then you can add this to your email messages to add the link in service messages
%serviceactionurl%
you can do the same thing for hosts too by adding the following to the xi_host_notification_handler
Then you can add this to your email messages to add the link in host messages
%hostactionurl%
Re: Returning a URL in the Nagios Alert
Posted: Tue Dec 04, 2012 12:49 pm
by mbowden
Great! will this customize only my pesonal notifacation email or the default notifacation email? If it is personal, canyou tell me how to add it to the default email message?
Re: Returning a URL in the Nagios Alert
Posted: Tue Dec 04, 2012 1:09 pm
by scottwilkerson
This will do you personal one. If you have 2012 Enterprise you can set the default messages in Admin -> Notification Management
Re: Returning a URL in the Nagios Alert
Posted: Tue Dec 04, 2012 1:41 pm
by mbowden
Thank You,
I just found what appears to be a bug. When you are configuring the default email message as discribed in your last post, clicking cancel actually saves the config and does not revert to the original.
Re: Returning a URL in the Nagios Alert
Posted: Tue Dec 04, 2012 1:57 pm
by mbowden
Ok I have made the changes below in the nagios admin section (I have a trial of enterprise) However the message only changes if I add the changes you suggested to my personal notification email. The global one doesn't seem to have an affect. Any Thoughts?
***** Nagios XI Alert *****
%alertsummary%
Notification Type: %type%
Host: %host%
State: %hoststate%
Address: %hostaddress%
Info: %hostoutput%
Wiki URL: %hostactionurl%
Date/Time: %datetime%
Respond: %responseurl%
Nagios URL: %xiserverurl%
***** Nagios XI Alert *****
%alertsummary%
Notification Type: %type%
Service: %service%
Host: %hostalias%
Address: %hostaddress%
State: %servicestate%
Wiki URL: %serviceactionurl%
%serviceoutput%
Date/Time: %datetime%
Respond: %responseurl%
Nagios URL: %xiserverurl%
Re: Returning a URL in the Nagios Alert
Posted: Tue Dec 04, 2012 2:17 pm
by mbowden
Ok the message seems to be working appropriatly now, must have been a timing issue. The bug mentioned earlier still seems outstanding though.
Re: Returning a URL in the Nagios Alert
Posted: Tue Dec 04, 2012 4:49 pm
by scottwilkerson
mbowden wrote:Ok the message seems to be working appropriatly now, must have been a timing issue. The bug mentioned earlier still seems outstanding though.
Confirmed. The developer is working on that and it will be fixed in a future release.