Database schema... WTF?
Moderators: Developers, Moderators
Database schema... WTF?
I'm trying to get my head around Cacti's DB, as my attempts to use the api_* functions have proved futile. (I need to automatically generate hosts, data sources and graphs from templates, and independently. All non SNMP, too)
Correct me if I'm wrong, but do the data_template_data and graph_templates_graph tables store both the templated data/graphs and the actual in-use data/graphs?
If yes, does that also explain how every column of note is duplicated withe a t_ prefix?
It's getting kind of late here and my brain cells are fighting eachother for oxygen...
To even get this far I had to do SQL dumps after each operation and use DIFF to work out what changes had actually been made.
Correct me if I'm wrong, but do the data_template_data and graph_templates_graph tables store both the templated data/graphs and the actual in-use data/graphs?
If yes, does that also explain how every column of note is duplicated withe a t_ prefix?
It's getting kind of late here and my brain cells are fighting eachother for oxygen...
To even get this far I had to do SQL dumps after each operation and use DIFF to work out what changes had actually been made.
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
You are correct, template and regular data is stored in the same tables. We have realised that this is an issue and next major version of cacti does this completely differently.
Also, API functions in 0.9.0 of cacti will be fully documented for developers to use.
Also, API functions in 0.9.0 of cacti will be fully documented for developers to use.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
- rony
- Developer/Forum Admin
- Posts: 6022
- Joined: Mon Nov 17, 2003 6:35 pm
- Location: Michigan, USA
- Contact:
Also, database schema is here: http://www.cacti.net/downloads/docs/sql/
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
It's rough and ugly, but check out my post here: http://forums.cacti.net/viewtopic.php?t=14673Sherm wrote:z0s0,
Did you ever figure out how to automatically generate data sources, hosts, and graphs from templates? I would love to know how you did it, if so.
Thanks.
I used some perl and PHP to automate adding devices to cacti. It sounds like cacti 0.9 will support this in a much cleaner way.
I've actually done this already for an unreleased version of my discovery plugin. Basically you create a "Discovery" template, and input the host template to use, the sysDescr string to match it with, and where into the tree to insert the host. When it scans your subnet, it finds a host, checks the sysDescr string, and if it finds a match, it applies the host template, which runs it queries, then it selects all graphs that are now possible from that host (thanks to the template) and creates them. It then inserts it into the tree for you at the specified spot.Sherm wrote:z0s0,
Did you ever figure out how to automatically generate data sources, hosts, and graphs from templates? I would love to know how you did it, if so.
Thanks.
I have alot more options I want to add before release, like for discovery templates, have the ability to match to "service checks" (ex: check if specific ports are open, certain OIDs exist, etc...). Pair this with the ability to apply multiple templates to 1 host, and you have a great "custom" host.
As an example of its usefulness in a Windows Enviroment. Say I create a template for Windows hosts. It has the basic disk and network graphs assigned and is matched via the sysDescr. Then I create a host template for "Domain Controllers" which just has a graph for the Kerberos Service. I then create a Discovery Template that checks for the Kerberos Service OID (sysDescr is blank in this template, or it can be the same as the windows template). The same thing is done for DNS Servers, HTTP server, SQL severs, etc... So now if a host is found that is both a Windows and Domain Controller, it gets all the normal graphs, and the extra service graphs that it has.
The main thing left to work out is the priority order of which one is applied last, and which tree location to place it in.
Once its done and released to the world, I also plan on taking the same concept and writing a "bulk add" plugin, which allows you to do the same thing, but with a CVS file or hosts entered by hand. At that point, if you still want something else, feel free to rip the specific functions out of the code and use it however you wish.
-
- Posts: 9
- Joined: Thu Nov 06, 2008 10:18 am
Please tell us which table the data is stored in mysql DB
Can you please tell us which table in mysql has the data of cpu, memory,network etc..,
For example if I am monitoing host1's cpu usage.
Which table does Cacti store in the mysql DB. Does it save as text format or hash format of the data.
I am new to cacti if it has been already answered please point to the link which has the information.
Thanks a lot for fast respone...
For example if I am monitoing host1's cpu usage.
Which table does Cacti store in the mysql DB. Does it save as text format or hash format of the data.
I am new to cacti if it has been already answered please point to the link which has the information.
Thanks a lot for fast respone...
-
- Posts: 9
- Joined: Thu Nov 06, 2008 10:18 am
I need to create custom graphs using the data from cacti
Iam new to cacti. So please bear with me.
I need to create custom graphs using the data from cacti. Like overlaying the graphs from different times.
I am trying to put together a graphing solution for comparing grpahs of cpu, memory, network bandwith and other monitors usages during multiple load tests.
For example I need to compare cpu usage from test from last week to another cpu usage this week.
For doing that I was thinking of creating some custom grpahs using the cacti collected data.
Can you please advise if there is a way of accomplishing it. If there can anybody point me to the documents or links which will help in getting it done.
I would greatly appreciate if anyone answer quickly...
Thnaks a lot again.
I need to create custom graphs using the data from cacti. Like overlaying the graphs from different times.
I am trying to put together a graphing solution for comparing grpahs of cpu, memory, network bandwith and other monitors usages during multiple load tests.
For example I need to compare cpu usage from test from last week to another cpu usage this week.
For doing that I was thinking of creating some custom grpahs using the cacti collected data.
Can you please advise if there is a way of accomplishing it. If there can anybody point me to the documents or links which will help in getting it done.
I would greatly appreciate if anyone answer quickly...
Thnaks a lot again.
Who is online
Users browsing this forum: No registered users and 1 guest