Need Help with Formatting URL for Host/Service Acknowledgment

Robert V. Bolton robert at robertvbolton.com
Fri Nov 16 23:34:24 CET 2012


Hello,

I'm trying to include a URL in my alert emails that will allow the user to
acknowledge the alert by clicking on the URL. I'm having trouble with the
formatting so that the host and service will be passed to cmd.cgi
correctly. When I define notes_url as follows the '&' and spaces in the
service description don't translate to a proper url format. Does anyone
know how can translate this information valid URL to be included into my
alert emails?

notes_url
http://example.com/nagios/cgi-bin/cmd.cgi?cmd_typ=34&host=$HOSTNAME$&service=$SERVICEDESC$

Here is an example of an expected output:

http://example.com/nagios/cgi-bin/cmd.cgi?cmd_typ=34&host=host.example.com&service=SSH%20Check

Here is an example of the actual output:

http://example.com/nagios/cgi-bin/cmd.cgi?cmd_typ=34host=host.example.comservice=SSH%2BCheck<http://monitor.chpc.utah.edu/nagios/cgi-bin/cmd.cgi?cmd_typ=34host=hypno-hustler.chpc.utah.eduservice=SSH%2BCheck%2BIPv4>

As you can see the '&' is missing and the space in 'SSH Check' is coded as
%2B not %20.


--
*Robert V. Bolton*
Email: robert at robertvbolton.com
Web: http://robertvbolton.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20121116/46d0dc42/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list