add_graph.php using cg type.

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Moderators, Developers

Post Reply
Author
Message
Epx998
Posts: 19
Joined: Wed Oct 12, 2011 2:48 pm

add_graph.php using cg type.

#1 Post by Epx998 » Fri Aug 10, 2012 3:15 pm

Hi All,

I am trying to add a graph using the CLI and I am having a bit of trouble with the custom input field syntax. I have my host id, data template id and the data fields, but can't work the syntax out. The data being graphed is a script/command data input method. Here is what I have so far;

Code: Select all

php add_graphs.php --graph-template-id=64 --list-input-fields
Known Input Fields:(name, default, description)
92:PegName              Name of the Peg Count
92:IP           IP address
92:PORT         Port Address
93:PegName              Name of the Peg Count
93:IP           IP address
93:PORT         Port Address
I also want to use the --graph-title= option as well.

Code: Select all

php add_graphs.php --graph-type=cg --graph-template-id=64 --host-id=11

Can something show me an example using the info above?

Gavin
Last edited by Epx998 on Fri Aug 10, 2012 6:46 pm, edited 1 time in total.

Epx998
Posts: 19
Joined: Wed Oct 12, 2011 2:48 pm

Re: add_graph.php using gs type.

#2 Post by Epx998 » Fri Aug 10, 2012 4:13 pm

I worked out the correct cli syntax, but ran into a new problem;

When I run the cli command, the graph gets created, but the data sources are shown has blank for this graph, when the poller runs, I get the error you see below;

ERROR: Cannot parse DS in 'DEF:a=/var/www/cacti/rra/gdrsp-dconsu-c1-2_ds_1391.rrd::AVERAGE'

My data template has Use Per-Data Source Value checked, I tried to set a name manually, but I get a error and a red box over the field, it won't save.

Any ideas?

Epx998
Posts: 19
Joined: Wed Oct 12, 2011 2:48 pm

Re: add_graph.php using gs type.

#3 Post by Epx998 » Fri Aug 10, 2012 4:14 pm

My datasource name was too long, shortened and it saved.

Epx998
Posts: 19
Joined: Wed Oct 12, 2011 2:48 pm

Re: add_graph.php using gs type.

#4 Post by Epx998 » Fri Aug 10, 2012 4:29 pm

The internal datasources are still being created with a blank entry, is there any way I can set these in the add_graph.php cli?

Epx998
Posts: 19
Joined: Wed Oct 12, 2011 2:48 pm

Re: add_graph.php using gs type.

#5 Post by Epx998 » Fri Aug 10, 2012 6:06 pm

It isn't the internal datasource name I need to specify, its the friendly name for the datasouce, without it, the datasource menu shows a blank entry with no hyperlink active. you can still edit it IF, you note the datasource ID, open up a good ds and replace the ID in the url, to the one that has no hyper link.

Post Reply