pnp4nagios graph name

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
timchin
Posts: 27
Joined: Wed Feb 06, 2013 6:45 pm

pnp4nagios graph name

Post by timchin »

Hi, there. I create my own templates for pnp4nagios occasionally and I'm having trouble changing the 'Datastore:' name that appears above the graph. It always shows 'ds1', no matter what I do on custom templates.

In the past, I thought I could change it by using $ds_name[1] = "New name"; However, that's not doing the trick.

Does anyone have any ideas on what I might be doing wrong? Thanks!
Tim
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: pnp4nagios graph name

Post by slansing »

I have not personally tried this, but you may need to change the host/service's XML to define the new name as shown here:

http://docs.pnp4nagios.org/pnp-0.6/doc_complete
timchin
Posts: 27
Joined: Wed Feb 06, 2013 6:45 pm

Re: pnp4nagios graph name

Post by timchin »

Interesting. I viewed the xml in the perfdata directory and DS1 is named 'in' and DS2 is named 'out', which is correct. The template merges these two datasources to a single graph with 2 lines, but it's named 'ds1'. I can't find a reference to that anywhere, so this is strange to me. I though $ds_name[1] was the way to go, but it has no effect.

Tim
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: pnp4nagios graph name

Post by Box293 »

I think you need to define it in opt[1]

Code: Select all

$opt[1] = "--vertical-label Load -l0  --title \"Blah Blah CPU Load for $hostname / $servicedesc\" ";
Selection_028.png
You do not have the required permissions to view the files attached to this post.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
timchin
Posts: 27
Joined: Wed Feb 06, 2013 6:45 pm

Re: pnp4nagios graph name

Post by timchin »

That part works fine. Attached is a picture to better depict what I'm referring to. Thx!
Capture.PNG
You do not have the required permissions to view the files attached to this post.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: pnp4nagios graph name

Post by tmcdonald »

Take a look in /usr/local/nagiosxi/html/includes/lang/en-perfgraphs.inc.php

I think you can define what ds1, ds2 etc map to here. In @Box293's example, "CPU Load" was mapped from "ds1" for the "check_local_load" command. Similarly, "Packet Loss" would map from "pl" for the default template, and "Response Time" can come from either "time" or "ds1" in the "check_http" command.

Make sense?
Former Nagios employee
timchin
Posts: 27
Joined: Wed Feb 06, 2013 6:45 pm

Re: pnp4nagios graph name

Post by timchin »

You're the man! That did the trick :D

Do you know if there's a way to remove the 'Datasource' completely from above the graph? I imagine it's not possible, so this is great!

Tim
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: pnp4nagios graph name

Post by tmcdonald »

/usr/local/nagiosxi/html/includes/components/xicore/dashlets-perfdata.inc.php

Search for "Datasource" and change both definitions.
Former Nagios employee
timchin
Posts: 27
Joined: Wed Feb 06, 2013 6:45 pm

Re: pnp4nagios graph name

Post by timchin »

Great - Thx! I ended up not doing that, but it's nice to know that it's an option.

Tim
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: pnp4nagios graph name

Post by Box293 »

Nice, I like learning new tricks :)
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked