How to get rra_path from database
Moderators: Developers, Moderators
How to get rra_path from database
I'm writing a script that needs to work with the raw rrd files, but I need to find out the description associated with each rrd file. Basically, I need to get the graph_templates_graph.title_cache that is associated with each data_input_data_cache.rrd_path. Does anybody know how to do this? I don't seem to have the sql skills to get the query to work, so hopefully somebody has already solved this problem.
These questions are always fun... .
-Ian
Code: Select all
select
graph_templates_graph.title_cache,
data_template_data.data_source_path
from graph_templates_graph,graph_templates_item,data_template_rrd,data_template_data
where graph_templates_graph.local_graph_id=graph_templates_item.local_graph_id
and graph_templates_item.task_item_id=data_template_rrd.id
and data_template_rrd.local_data_id=data_template_data.local_data_id
and graph_templates_graph.local_graph_id > 0
group by data_template_data.local_data_id
-
- Posts: 2
- Joined: Mon Apr 18, 2005 7:59 am
Unfortunately these statistics are not stored the Cacti's database. To display this data, you need to fetch it directly from the .rrd file(s). This can be accomplished with RRDTool's 'fetch' command which basically dumps the data in a .rrd file to the console.
If you are feeling ambitious though, Cacti's rrdtool_function_fetch() function in lib/rrd.php would make this a lot easier. It takes care of executing the fetch command, parses the output, and returns a nice PHP array.
Let me know if you have any questions.
-Ian
If you are feeling ambitious though, Cacti's rrdtool_function_fetch() function in lib/rrd.php would make this a lot easier. It takes care of executing the fetch command, parses the output, and returns a nice PHP array.
Let me know if you have any questions.
-Ian
-
- Posts: 2
- Joined: Mon Apr 18, 2005 7:59 am
Who is online
Users browsing this forum: No registered users and 1 guest