New to Cacti...
I wish to write a script to generate Cacti weather map configuration files. I have all the data that I need - the nodes, the links between them, etc. Currently the process is being done manually and takes a lot of time. We use the port-name to get the LINK attributes TARGET, INFOURL and OVERLIBGRAPH from Cacti.
But to write a script, I am having trouble with the LINK attributes i.e. TARGET, INFOURL and OVERLIBGRAPH. What will be my local_graph_id for INFOURL and OVERLIBGRAPH? And which .rrd file from .../cacti/rra should I choose?
Script to create weather map config files
Moderators: Developers, Moderators
-
- Posts: 1
- Joined: Wed Jul 08, 2015 7:25 pm
Script to create weather map config files
No one can help everyone, but everyone can help someone.
- Happiness0
- Cacti User
- Posts: 63
- Joined: Wed Oct 29, 2014 5:01 am
- Contact:
Re: Script to create weather map config files
I've done a similar task, for INFOURL, you could use the id in graph_tree_items and use an url like "graph_view.php?action=tree_content&tree_id=2&leaf_id=xxx&host_group_data=" where xxx is the id in graph_tree_items. For OVERLIBGRAPH you should indeed use local_graph_id and select a particular id by filtering with the template being used by the graph you want to be displayed.SirSwearsAlot wrote: What will be my local_graph_id for INFOURL and OVERLIBGRAPH? And which .rrd file from .../cacti/rra should I choose?
Code: Select all
. "\tINFOURL /cacti/graph_view.php?action=tree_content&tree_id=2&leaf_id=" . $row[2]. "&host_group_data=\n"
. "\tOVERLIBGRAPH /cacti/graph_image.php?rra_id=0&graph_height=200&graph_width=500&local_graph_id=". $row[3] . "\n"
Code: Select all
SELECT DISTINCT (b.id), (b.hostname), (a.id), (c.id)
FROM graph_tree_items AS a
LEFT OUTER JOIN host AS b
ON b.id = a.host_id
LEFT JOIN graph_local AS c
ON b.id = c.host_id
WHERE c.graph_template_id = 43 OR c.graph_template_id = 52
ORDER BY b.hostname';
Who is online
Users browsing this forum: No registered users and 6 guests