Issue with the ampersand in URLs

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
fao
Posts: 99
Joined: Thu Feb 03, 2011 3:05 am

Issue with the ampersand in URLs

Post by fao »

Hello,

We're having issue with the ampersand sign when used in action_url inside a service definition. The ampersand is removed and the url is not correctly transmitted to the browser.
How can we sort it out?

Thanks
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Issue with the ampersand in URLs

Post by abrist »

There was a bug in 2012r1.5. If you have not made too many changes, you can roll your snapshot back to a config before the update and then update to the newest version (1.6). Otherwise, upgrade to 1.6 and fix the service checks with the issue.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
fao
Posts: 99
Joined: Thu Feb 03, 2011 3:05 am

Re: Issue with the ampersand in URLs

Post by fao »

Upgrading to 1.6 hasn't solved the issue.
in CCM, I've configured a service with this action url : /nagiosgraph/cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$' onMouseOver='showGraphPopup(this)' onMouseOut='hideGraphPopup()' rel='/nagiosgraph/cgi-bin/showgraph.cgi?host=$HOSTNAME$&service=$SERVICEDESC$, but the resulting configuration in the file is as follow :

###############################################################################
#
# Service configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date: 2013-02-19 08:39:29
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define service {
host_name HQLTEST1
service_description check_swap
use local-service
display_name check_swap
check_command check_local_swap!20!10!!!!!!
action_url /nagiosgraph/cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$' onMouseOver='showGraphPopup(this)' onMouseOut='hideGraphPopup()' rel='/nagiosgraph/cgi-bin/showgraph.cgi?host=$HOSTNAME$&service=$SERVICEDESC$
register 1
}

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################

You can see that the "&" character is being translated as "&" and I have to correct it manually in order to get it working.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Issue with the ampersand in URLs

Post by mguthrie »

We'll take a look at correcting this for the 1.7 release.
fao
Posts: 99
Joined: Thu Feb 03, 2011 3:05 am

Re: Issue with the ampersand in URLs

Post by fao »

An idea about the release date?
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Issue with the ampersand in URLs

Post by mguthrie »

Here's a patched version of the CCM component that should take care of the issue.
You do not have the required permissions to view the files attached to this post.
Locked