Page 2 of 2

Re: On perfdata, / (forward slash) gets converted to _

Posted: Mon Jan 06, 2014 10:53 am
by linuxnag
Tried the "enclose in single quotes" but no change.
The interesting thing is this:

"Service Status Detail" -> "Advanced"
shows:

Code: Select all

Performance Data:	'/'=30%;75;90;0 '/boot'=8%;75;90;0 '/opt'=7%;75;90;0
'/tmp'=5%;75;90;0 '/cust'=1%;75;90;0 '/var'=10%;75;90;0
So, the "/" slashes make it to Nagios.

As to your question: "Is this a standard nrpe rrd template?"
All I have done is create a new Service "NRPE_Check_localfs"
and in the "Check Settings" tab I checked "Process perf data" to "on".

In addition, I created a service group that has all the NRPE* services in there.
I did not do anything with rrd templates.

Re: On perfdata, / (forward slash) gets converted to _

Posted: Mon Jan 06, 2014 11:24 am
by linuxnag
Actually, your comment gave me an idea:

The graphs themselves say that they are "Default Template"
I think the Default template translates the "/" slashes.

Shall I create a new graph type to match my plugin name?
How do I associate the graph type to my plugin name
(use the same name perhaps) ?

Sorry if my questions have been asked before.

Re: On perfdata, / (forward slash) gets converted to _

Posted: Mon Jan 06, 2014 11:41 am
by scottwilkerson
If you make a new template and make it the name of you check_command with a php extension then it will use that template.

for example, if you have a command check_ping

you would create a graph template named
check_ping.php

Re: On perfdata, / (forward slash) gets converted to _

Posted: Mon Jan 06, 2014 11:58 am
by linuxnag
Ok, Sounds good.

However, I'm looking at the default template and I don't see where the "/" gets translated
to "_".

Any ideas?

Re: On perfdata, / (forward slash) gets converted to _

Posted: Mon Jan 06, 2014 1:00 pm
by abrist
The pnp_convert_object_name() function in /usr/local/nagiosxi/html/includes/components/pnp/pnp.inc.php is the culprit. It is most likely done for sanitization/GET url reasons. You may have to create a custom template that would convert "_" back to "/".

Re: On perfdata, / (forward slash) gets converted to _

Posted: Mon Jan 06, 2014 2:06 pm
by linuxnag
I guess I will at some point in the future. For now, I just take out the "/" slashes. Roor becomes "root" instead of "/". Good enough for now.

I guess we can close this.