|
|
| Author |
Message |
z0s0
Joined: 13 Feb 2006 Posts: 5
|
Posted: Tue Feb 14, 2006 6:53 am Post subject: 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. |
|
| Back to top |
|
 |
rony Developer/Forum Admin
Joined: 17 Nov 2003 Posts: 5469 Location: Wisconsin, USA
|
Posted: Tue Feb 14, 2006 10:14 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
rony Developer/Forum Admin
Joined: 17 Nov 2003 Posts: 5469 Location: Wisconsin, USA
|
|
| Back to top |
|
 |
addlema Cacti User
Joined: 18 Aug 2004 Posts: 81 Location: Bloomington, IN
|
Posted: Wed Feb 22, 2006 9:48 am Post subject: |
|
|
| Wow.. Thats exactly what I need! Thanks for the schema! |
|
| Back to top |
|
 |
Sherm
Joined: 16 Aug 2006 Posts: 5
|
Posted: Thu Aug 17, 2006 3:34 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
wriley
Joined: 19 May 2006 Posts: 15 Location: Lake St Louis, MO USA
|
Posted: Wed Sep 06, 2006 8:43 am Post subject: |
|
|
| 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. |
It's rough and ugly, but check out my post here: http://forums.cacti.net/viewtopic.php?t=14673
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. |
|
| Back to top |
|
 |
cigamit Developer
Joined: 07 Apr 2005 Posts: 978 Location: B/CS Texas
|
Posted: Thu Sep 07, 2006 10:04 pm Post subject: |
|
|
| 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'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.
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. |
|
| Back to top |
|
 |
venkatpandiri
Joined: 06 Nov 2008 Posts: 9
|
Posted: Tue Nov 18, 2008 3:45 pm Post subject: 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... |
|
| Back to top |
|
 |
cigamit Developer
Joined: 07 Apr 2005 Posts: 978 Location: B/CS Texas
|
Posted: Tue Nov 18, 2008 3:57 pm Post subject: |
|
|
| Its is not stored in MySQL, the actual data is stored in the RRD files in the /rra/ directory of your cacti install. |
|
| Back to top |
|
 |
venkatpandiri
Joined: 06 Nov 2008 Posts: 9
|
Posted: Tue Nov 18, 2008 4:27 pm Post subject: 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. |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12604 Location: Muenster, Germany
|
Posted: Thu Nov 20, 2008 11:13 am Post subject: |
|
|
You will want to use the SHIFT option of rrdtool to overlay different timespans. Unfortunately, cacti does not support this currently. All you can do is use the timeshifter
Reinhard |
|
| Back to top |
|
 |
|