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
pnp4nagios graph name
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: pnp4nagios graph name
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
http://docs.pnp4nagios.org/pnp-0.6/doc_complete
Re: pnp4nagios graph name
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
Tim
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: pnp4nagios graph name
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\" ";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.
Re: pnp4nagios graph name
That part works fine. Attached is a picture to better depict what I'm referring to. Thx!
You do not have the required permissions to view the files attached to this post.
Re: pnp4nagios graph name
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?
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
Re: pnp4nagios graph name
You're the man! That did the trick
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
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
Re: pnp4nagios graph name
/usr/local/nagiosxi/html/includes/components/xicore/dashlets-perfdata.inc.php
Search for "Datasource" and change both definitions.
Search for "Datasource" and change both definitions.
Former Nagios employee
Re: pnp4nagios graph name
Great - Thx! I ended up not doing that, but it's nice to know that it's an option.
Tim
Tim
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: pnp4nagios graph name
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.