[SOLVED] Graph from MySQL database

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
aquarius
Posts: 3
Joined: Wed Feb 27, 2008 12:15 am

[SOLVED] Graph from MySQL database

Post by aquarius »

Hello,

I'm new to Cacti and I'm a little bit lost...

I'm using the Logtemp program to get data from 1-wire temperature sensors. I want to add a DS2423 1-wire counter that counts pulses from a kWh meter. Logtemp can show the pulses from DS2423 but it cannot greate a graph from them but as far as I know, it can store the data to MySQL database.

Can I use Cacti to get the data from MySQL database and create a graph from it? I would like to get daily/weekly/monthly kwh consumption graphs.

If this is possible, I would like to get some help, how it's done.

Thanks in advance
elayaraja.s
Cacti User
Posts: 137
Joined: Mon Feb 11, 2008 3:46 am

Graph from MySQL database

Post by elayaraja.s »

I too looking for the same. Need to know about Cacti table and by inserting data manually just for template , need to generate graph. Could any one reply that

where can i find the cacti tables detail?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

You should both be looking at Script Queries. Cacti doesn't store the collected data in the mysql database, only the configuration information for what to collect. The actual data goes into rrd files.

Script Queries allow you to get data from non-SNMP sources and feed it into Cacti's poller. See this part of the HOWTO manual for more information. You will probably need to adjust the info slightly for Windows, however.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
aquarius
Posts: 3
Joined: Wed Feb 27, 2008 12:15 am

Post by aquarius »

Howie wrote:You should both be looking at Script Queries. Cacti doesn't store the collected data in the mysql database, only the configuration information for what to collect. The actual data goes into rrd files.

Script Queries allow you to get data from non-SNMP sources and feed it into Cacti's poller. See this part of the HOWTO manual for more information. You will probably need to adjust the info slightly for Windows, however.
Do you mean that Cacti cannot make a data query from MySQL table?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

No, I mean you would need to write a script to do the query, and Cacti will run your script to get the value.

The script could be very simple.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
aquarius
Posts: 3
Joined: Wed Feb 27, 2008 12:15 am

Post by aquarius »

Ok, thank you. I'll try to find something...
elayaraja.s
Cacti User
Posts: 137
Joined: Mon Feb 11, 2008 3:46 am

Graph from MySQL database

Post by elayaraja.s »

Your right.
As u said , i followed the steps from the given link,
http://docs.cacti.net/node/200

But unable to generate the graph.
Attachments
ScreenShots.doc
(232.5 KiB) Downloaded 501 times
elayaraja.s
Cacti User
Posts: 137
Joined: Mon Feb 11, 2008 3:46 am

blank data...in graph...

Post by elayaraja.s »

Now the graph is genearated but its only blank graph, its not expected output as gien in the link http://docs.cacti.net/node/299 (please refere my attachment with Actual output and expected output.)
Attachments
ScreenShots.doc
(266 KiB) Downloaded 344 times
elayaraja.s
Cacti User
Posts: 137
Joined: Mon Feb 11, 2008 3:46 am

Graph from MySQL database

Post by elayaraja.s »

Howie wrote:No, I mean you would need to write a script to do the query, and Cacti will run your script to get the value.

The script could be very simple.
Following the steps from the link http://docs.cacti.net/node/200,
Replacing the ping.pl to myScript.sql file. Could you tell the content of myScript.sql file such as select field1,field2 from table ? or where i can get the information from the cacti documetnation.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests