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")
Returning a URL in the Nagios Alert
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Returning a URL in the Nagios Alert
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
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%
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$ %serviceactionurl%
you can do the same thing for hosts too by adding the following to the xi_host_notification_handler
Code: Select all
--hostactionurl=$HOSTACTIONURL$ %hostactionurl%
Re: Returning a URL in the Nagios Alert
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?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Returning a URL in the Nagios Alert
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
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.
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
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%
***** 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
Ok the message seems to be working appropriatly now, must have been a timing issue. The bug mentioned earlier still seems outstanding though.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Returning a URL in the Nagios Alert
Confirmed. The developer is working on that and it will be fixed in a future release.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.