Returning a URL in the Nagios Alert

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mbowden
Posts: 93
Joined: Thu May 03, 2012 3:52 pm

Returning a URL in the Nagios Alert

Post 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")
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

Post 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

Code: Select all

--hostactionurl=$HOSTACTIONURL$ 
Then you can add this to your email messages to add the link in host messages

%hostactionurl%
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mbowden
Posts: 93
Joined: Thu May 03, 2012 3:52 pm

Re: Returning a URL in the Nagios Alert

Post 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?
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

Post by scottwilkerson »

This will do you personal one. If you have 2012 Enterprise you can set the default messages in Admin -> Notification Management
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
mbowden
Posts: 93
Joined: Thu May 03, 2012 3:52 pm

Re: Returning a URL in the Nagios Alert

Post 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.
mbowden
Posts: 93
Joined: Thu May 03, 2012 3:52 pm

Re: Returning a URL in the Nagios Alert

Post 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%
mbowden
Posts: 93
Joined: Thu May 03, 2012 3:52 pm

Re: Returning a URL in the Nagios Alert

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

Post 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.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked