Problem with Action_URL

Support requests, bug reports, questions etc.
Locked
icemanu
starter
starter
Posts: 2
Joined: Fri Jun 26, 2009 13:49

Problem with Action_URL

Post by icemanu » Mon Jun 29, 2009 13:22

Hello,
I have installed NConf 1.2.5 (latest version to this day)
In : Administration > Attributes > Show > Host > Action_URL > list of possible values & pre-defined value, i've added :
/nagios/pnp/index.php?host=$HOSTNAME$' onmouseover="get_g('$HOSTNAME$','_HOST_')" onmouseout="clear_g()"
then submit, then i come back again to see that only a part of the text appears in the textfield :
/nagios/pnp/index.php?host=$HOSTNAME$' onmouseover=
Moreover, when i want to select the attribute in a host, the text appears on 2 separate lines in the dropdownbox, cut in half.
line 1 : /nagios/pnp/index.php?host=$HOSTNAME$' onmouseover="get_g('$HOSTNAME$'
line 2 : ,'_HOST_')" onmouseout="clear_g()"
any idea ? thanks. icemanu

User avatar
fgander
NConf developer
NConf developer
Posts: 308
Joined: Mon Mar 16, 2009 14:23
Location: Bern, Switzerland
Contact:

Re: Problem with Action_URL

Post by fgander » Mon Jun 29, 2009 14:14

hello

thanks for your feedback, i see your problem. (we never had such a value)

you cannot put in values with , in this field (, is for split the values into fields)
there seems also to be a little display problem with " and '...

this will go into our bug list, and should be fixed in the next release.

sorry for that, regards fabian
F.G. - NConf developer
http://www.nconf.org
Image
Follow NConf on Twitter!

wintland

Re: Problem with Action_URL

Post by wintland » Sun Jul 12, 2009 22:32

I am also having this problem, is there any way to insert the string directly into the database? If not, is there some other workaround that doesnt require altering the .cfg files after they come out of Nconf.

Thanks for the help and thanks for Nconf, its been a great help so far.

-Brian

User avatar
agargiulo
NConf developer
NConf developer
Posts: 725
Joined: Fri Mar 06, 2009 17:50
Location: Zurich, Switzerland
Contact:

Re: Problem with Action_URL

Post by agargiulo » Mon Jul 27, 2009 18:21

Hi.

No, there is currently no workaround for this. Even if you add the values directly to the database, the GUI will not be able to process the possible values properly, because the separator is currently the comma (,).

We will have to change this in the next release.
Sorry.

lmelvin
starter
starter
Posts: 4
Joined: Thu May 07, 2009 00:14

Re: Problem with Action_URL

Post by lmelvin » Wed Aug 05, 2009 00:22

Just to clarify, the point of doing this is to get PNP popups working in the Nagios interface (see http://www.pnp4nagios.org/pnp/webfe).

It seems like there are two problems -- one, that commas are not allowed in the action_url attribute field currently, and also that the lone ' character and/or the " characters in the field are causing problems.

I tried to hack around the first issue by replacing the get_g("arg1","arg2") call with an nconf_get_g("arg1:::arg2") function. I basically copied the (5-line) get_g() function in /usr/local/nagios/share/ssi/status-header.ssi, and munged it to look like this:

Code: Select all

function nconf_get_g(blob) {
    var temp = new Array();
    temp = blob.split(':::');
    host = temp[0];
    srv = temp[1];
    url = "/nagios/pnp/ajax.php";
    newsAjax = new Ajax.Request( url,
        { method: 'get', parameters: { "host": host, "srv": srv, "do": "popup" }, onComplete: show_g }
    );
}
Then I modified the action_url attribute to be

Code: Select all

/nagios/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$' onmouseover="get_g('$HOSTNAME$:::$SERVICEDESC$')" onmouseout="clear_g()"
This should work -- but I can't get far enough to find out. When I try modifying the action_url attribute, it always drops everything including and after the single '.

Ultimately, I hope the nconf devs make the field a little more forgiving. But if anyone can hack the second issue and get it working sooner, please let me know.

Lee

User avatar
fgander
NConf developer
NConf developer
Posts: 308
Joined: Mon Mar 16, 2009 14:23
Location: Bern, Switzerland
Contact:

Re: Problem with Action_URL

Post by fgander » Tue Oct 06, 2009 14:40

Hi.

We have fixed this problem.
It will be available in the next release.

Regards Fabian
F.G. - NConf developer
http://www.nconf.org
Image
Follow NConf on Twitter!

icemanu
starter
starter
Posts: 2
Joined: Fri Jun 26, 2009 13:49

Re: Problem with Action_URL

Post by icemanu » Wed Oct 07, 2009 21:57

Every once in a while, I drop by on the site to see about a new version to fix this very issue. So, not so long to wait.
Thank you.

Locked