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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
linuxnag
Posts: 53
Joined: Tue Nov 12, 2013 4:05 pm

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

Post 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.
linuxnag
Posts: 53
Joined: Tue Nov 12, 2013 4:05 pm

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

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
linuxnag
Posts: 53
Joined: Tue Nov 12, 2013 4:05 pm

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

Post 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?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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 "/".
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.
linuxnag
Posts: 53
Joined: Tue Nov 12, 2013 4:05 pm

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

Post 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.
Locked