[solved] Which table in the DB stores local_graph_id ??

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
peconi
Posts: 8
Joined: Wed Aug 18, 2010 3:51 pm

[solved] Which table in the DB stores local_graph_id ??

Post by peconi »

Hi guys,

I am trying to find which table in the DB stores the "local_graph_id" column.

Thanks!
mithandra
Posts: 46
Joined: Wed Jul 14, 2010 8:19 am

Post by mithandra »

currently at home atm so cannot check but if you have a look inside of the graphs.php file it refers to some includes at the top which are in the lib dir.

in one of those files there are some SQL queries you can run against the db in say mysql-query-browser and you will be able to work out which holds the graph_ids.

If no one responds before work tomorrow ill try and take a look for you

thanks mithandra
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

graph_local
R.
peconi
Posts: 8
Joined: Wed Aug 18, 2010 3:51 pm

Post by peconi »

Tnx!
peconi
Posts: 8
Joined: Wed Aug 18, 2010 3:51 pm

Post by peconi »

Ok, here's what I'm trying to do ...

I need to get a local_graph_id from Cacti's DB for an interface which I only know by name (ex. Vethernet2)...

I tried the following:

Code: Select all

select * from data_input_data WHERE data_input_field_id = 13 AND value = 'Vethernet2';
This gives me the data_template_id. Using this id I then query:

Code: Select all

select * FROM data_template_data WHERE id = 2282;
This in turn gives me the data_template_data_id which I can use to query the data_template_data table...however, this table does not seem to provide (or I can't seem to find it) the next step in getting the local_graph_id...

This table has columns named: id, local_data_template_data_id, local_data_id, data_template_id, data_input_id, etc.... but none of these help me find the local_graph_id for that interface.

Can someone please point me in the right direction for this :)

Thanks!
ksj
Posts: 16
Joined: Fri Jun 25, 2010 2:07 am

Post by ksj »

peconi
Posts: 8
Joined: Wed Aug 18, 2010 3:51 pm

Post by peconi »

Thanks, will read through.
peconi
Posts: 8
Joined: Wed Aug 18, 2010 3:51 pm

Post by peconi »

Wow, for 30 minutes now I've been looking at this and can't find an easy connection from data_template_data table to graph_local table....

Any hints are welcome ;) Thanks!
peconi
Posts: 8
Joined: Wed Aug 18, 2010 3:51 pm

Post by peconi »

Yea that's the same document ksj sent me a link to...

I've been starring at it for some time now I really do not know how to follow the Key lines to what I need...

Was hoping someone could just point out the "obvious" :)
peconi
Posts: 8
Joined: Wed Aug 18, 2010 3:51 pm

Post by peconi »

Anyone? It's really hard to link up the two :(
User avatar
phalek
Developer
Posts: 2838
Joined: Thu Jan 31, 2008 6:39 am
Location: Kressbronn, Germany
Contact:

Post by phalek »

the link between those goes through the rra tables ?
Greetings,
Phalek
---
Need more help ? Read the Cacti documentation or my new Cacti 1.x Book
Need on-site support ? Look here Cacti Workshop
Need professional Cacti support ? Look here CereusService
---
Plugins : CereusReporting
mithandra
Posts: 46
Joined: Wed Jul 14, 2010 8:19 am

Post by mithandra »

tep same here - worked out the query no problem but as soon as you start to put any restrictions on the query its starts to take a eon for the querys to run.

thanks mithandra
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Post by noname »

In other situations, linking graph title and local_graph_id is easy.
Access http://server/cacti/graph_view.php?action=list at your site and see how it performed in graph_view.php.

For example:

Code: Select all

SELECT graph_templates_graph.local_graph_id,graph_templates_graph.title_cache
FROM graph_templates_graph,graph_local
WHERE graph_templates_graph.local_graph_id > 0 AND graph_templates_graph.local_graph_id=graph_local.id AND graph_templates_graph.title_cache LIKE '%traffic%';
But all information exists in http://docs.cacti.net/manual:087:99_ref ... ase_design :-)
peconi
Posts: 8
Joined: Wed Aug 18, 2010 3:51 pm

Post by peconi »

THANK YOU MASTER!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest