Use Cacti 2 Graph output of MySQL SELECT statement

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

Moderators: Developers, Moderators

Post Reply
Van
Posts: 1
Joined: Sat Apr 07, 2007 8:27 pm

Use Cacti 2 Graph output of MySQL SELECT statement

Post by Van »

Greetings:

I've seen tons of module-esque kinds of things for tracking the operations of MySQL, really cool. Not what I need.

My only need for cacti is temperature monitoring of my samba server. I live in Phoenix and it's getting hot!!!

I've been tracking temperature data for this machine for several months when the power supply went down. I have the following table I need to query within cacti to expose this data and have it make the pretty graph:

+---------+------------------+------+-----+-------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------+------------------+------+-----+-------------------+----------------+
| tid | int(10) unsigned | NO | PRI | NULL | auto_increment |
| temp | smallint(9) | NO | | 0 | |
| moddate | timestamp | YES | | CURRENT_TIMESTAMP | |
+---------+------------------+------+-----+-------------------+----------------+


I simply need to do a "select moddate, temp from hw_mon" and have the results spew forth so cacti can have rrd make the pretty graph.

Couldn't be more easy than that, but in the cacti interface I've failed miserably to just say: "hi there pretty graph making thingy; take all the moddate values and associated temp values from the spiffy little linux script I wrote that gives such values and make the pretty graph."

Anyone with the 3-step way to make this happen. Certainly cacti will do things in several thousand steps; not what I need.

If there's a spot in there somewhere that I can put the name of a bash shell script into and have cacti use that result for the graph; that'd be so great, I wouldn't be able to contain myself.

Life was so much simpler when we just had a tty-console. Seems those days have been eaten by the "we need massive clickable features" monster.

Thanks for the hand.

Van
User avatar
streaker69
Cacti Pro User
Posts: 712
Joined: Mon Mar 27, 2006 10:35 am
Location: Psychic Amish Network Administrator

Post by streaker69 »

This is something that I just started working on myself. I might have something for you to look at by the middle of this week.
User avatar
lard
Cacti User
Posts: 165
Joined: Wed Jul 20, 2005 10:48 am
Location: UK - Cambridge

Post by lard »

Also looking for something along these lines to graph the up/down status of hosts! - currently trawling other scripts to see if this has been done already :)
---- lard007skype ----
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

lard wrote:Also looking for something along these lines to graph the up/down status of hosts! - currently trawling other scripts to see if this has been done already :)
On which data shall this be based? On some cacti table? Or on snmpget success/failure?
Reinhard
User avatar
lard
Cacti User
Posts: 165
Joined: Wed Jul 20, 2005 10:48 am
Location: UK - Cambridge

Post by lard »

On a value of a table in the cacti database (host status) - I have looked into doing a php script with a select statement but just don't know how to pass the node into it and to get it to echo out somewhere :(
---- lard007skype ----
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests