External graph instanciation

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
MisterG
Posts: 9
Joined: Mon May 10, 2010 4:44 am

External graph instanciation

Post by MisterG »

Hi,

I am coding some perl scripts to update RRD files and Cacti objects. The scripts create the device, data template, grah template and data sources.

The last update fails : I cannot link an instantiated graph to its data sources.

Can you tell me where to look in the source code to find the right SQL queries?

Mat
Attachments
graph.png
graph.png (14.09 KiB) Viewed 1794 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

For starters, turn on graph debugging to find out why the graph won't render.
MisterG
Posts: 9
Joined: Mon May 10, 2010 4:44 am

Post by MisterG »

The graph_templates_item is not completely updated.

Can you confirm my algorithm ?

Code: Select all

foreach datasource
    get its graph_local_id
    foreach "SELECT * FROM graph_templates_item WHERE graph_template_id=<gt_id> AND local_graph_id=0"
        create the graph_template_item
    done
done
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

You do know cacti comes with scripts for the creation of all that stuff, right? \cacti\cli\ directory.
User avatar
Hyperlord
Cacti User
Posts: 211
Joined: Tue Feb 10, 2009 3:24 am
Location: Frankfurt (a.M.), Germany

Post by Hyperlord »

I don't get the problem anyway ...
Om Tat Sat
MisterG
Posts: 9
Joined: Mon May 10, 2010 4:44 am

Post by MisterG »

I used add_graphs.php but I need to define RRD files' path. I use one RRD file per datasource.

For example :
  • load 1 : /var/www/html/cacti/rra/myhost/load/load1.rrd
    load 5 : /var/www/html/cacti/rra/myhost/load/load5.rrd
    load 15 : /var/www/html/cacti/rra/myhost/load/load15.rrd
I would need to update manually either.

Is it possible to specify each datasource path ?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

MisterG wrote:Is it possible to specify each datasource path ?
Nope.
MisterG
Posts: 9
Joined: Mon May 10, 2010 4:44 am

Post by MisterG »

I can use add_graphs.php to create the data sources and the graph. Then I update "the data_source_path" in "data_template_data".
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests