Page 1 of 1

Adding acknowledgement links to notifications

Posted: Tue May 18, 2010 4:34 pm
by justin
We ran into a snag in our Nagios Core migration to Nagios XI. We used to send detail and acknowledgment links in our emails.

Our acknowledgment links used to look like this:

Host: http://nagios.mybusiness.com/nagios/cgi ... host=$HOST$
Service: http://nagios.mybusiness.com/nagios/cgi ... ERVICENAME$

Now it looks like they should:

Host: http://nagios.mybusiness.com/nagiosxi/i ... host=$HOST$
Service: http://nagios.mybusiness.com/nagiosxi/i ... ERVICENAME$

These links work. However, The problem is, the server used to authenticate the user automatically, now we just get an error saying your session has expired unless you've logged into the system recently. Is it possible to get an authentication request from the server before just denying the user? Otherwise, is there another link I should use instead?

Thanks,
Justin

Re: Adding acknowledgement links to notifications

Posted: Tue May 18, 2010 4:45 pm
by tonyyarusso
There is another link format you can use to authenticate. Take a look at my response on http://support.nagios.com/forum/viewtopic.php?f=6&t=407 , particularly the CODE offset. Then just put your usual paths in the redirect= portion to go to them after authenticating.

Re: Adding acknowledgement links to notifications

Posted: Mon May 24, 2010 12:10 pm
by justin
Thanks! I actually left out the static login options. That way our users could login independently to acknowledge their pages.


I thought that was working, but after we login, it was dropping anything behind the tailing ampersand.

Here's an example: "http://nagios.mycompany.com/nagiosxi/lo ... ice=Serial Interface Stats"

It would send you to the login page with the full URL including all ampersands.

Once you log in you would be sent to this cropped url: "http://nagios.mycompany.com/nagiosxi/in ... cmd_typ=34"

Notice that everything behind the ampersand trailing "cmd_typ=34" is missing. In order to retain the other information on the links, I had to replace the trailing ampersands with "%26". This made the links look like this:

"http://nagios.mycompany.com/nagiosxi/lo ... ice=Serial Interface Stat"

That ultimately redirects correctly and everything appears to be working happily!

Thanks again for your help!

Re: Adding acknowledgement links to notifications

Posted: Wed May 26, 2010 9:50 am
by tonyyarusso
Ah, good catch on escaping the &s. Glad it's working for you!