SQL Query For Relating Host, RRD File (rra), and Graph ID

Discussions on developing plugins for the Cacti Plugin Architecture

Moderators: Moderators, Developers

Post Reply
Author
Message
iggi
Cacti User
Posts: 61
Joined: Sat Feb 23, 2008 10:41 am
Location: Flint, Michigan
Contact:

SQL Query For Relating Host, RRD File (rra), and Graph ID

#1 Post by iggi » Mon Sep 13, 2010 5:04 pm

I wrote a script, which in an archaic way references the RRD # and host id (I have a structured directory) and sends it to a script on my cacti server from my web server, then returns the data as XML, then it also pulls the graph from an internal path on the webserver where graphs are exported. All works fine, but I see I need 3 pieces of information for it to work: graph id, rrd #, and host number. In essence I was looking for a way to get two of them and giving only one, but I am unable to find the pieces to put them together in one query. Is anyone with insight into the DB structure help me relate these? I also realize you need something to specify the graph type, what would be the easiest way to do this, assuming I would hard code this option.

P.S.- The witness told me to look, but after an hour and a half I can't seem to find anything similar.


iggi
Cacti User
Posts: 61
Joined: Sat Feb 23, 2008 10:41 am
Location: Flint, Michigan
Contact:

#3 Post by iggi » Fri Sep 17, 2010 8:35 am

Thank you gandalf, this really does help, but I am noticing one thing that is causing an issue for the query I am trying to write. In graph_tree_items rra_id appears as it relates to the id column in rra, but in my graph_tree_items tables, the entire rra_id column are 1's

Post Reply