How to Graph Mysql Query?
Moderators: Developers, Moderators
How to Graph Mysql Query?
Hi,
anyone know of a scrip that will let me graph mysql query statement like?
select count(*) from whos_online WHERE customer_id != 0" -s -s oscom
45
That will give me an integer. Anyone know how to graph this?
thanks
anyone know of a scrip that will let me graph mysql query statement like?
select count(*) from whos_online WHERE customer_id != 0" -s -s oscom
45
That will give me an integer. Anyone know how to graph this?
thanks
Read through the documentation site on how to create the templates.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
my log?
here is what is in my cacti log.
01/20/2008 12:25:02 AM - CMDPHP: Poller[0] Host[6] DS[40] WARNING: Result from CMD not valid. Partial Result: File does not exist
What does that mean anyone know. I click on the DS and it show this.
Selected Data Template: MySQL - 5 Count Queries
Host - 192.168.1.111
Database Port: 3306
MySQL Username: cacti
MySQL Password: cacti
Query Filename - oscom.sql
Anything wrong with that config file? please let me know thanks. or anything else I should look at?
thank you for your help!!
01/20/2008 12:25:02 AM - CMDPHP: Poller[0] Host[6] DS[40] WARNING: Result from CMD not valid. Partial Result: File does not exist
What does that mean anyone know. I click on the DS and it show this.
Selected Data Template: MySQL - 5 Count Queries
Host - 192.168.1.111
Database Port: 3306
MySQL Username: cacti
MySQL Password: cacti
Query Filename - oscom.sql
Anything wrong with that config file? please let me know thanks. or anything else I should look at?
thank you for your help!!
Click on that DS[40] link from the cacti log viewer. As the error states, the File does not exist.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Re: Yeah ,
Correct.aboyz wrote:maybe it need the whole path
Try something like:
mysql <path_cacti>/scripts/oscom.sql <field1> <field2> etc.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
this is what showing in my poller cache.
Script: /usr/bin/php -q /home/cacti/scripts/mysql_query.php 192.168.1.211 3306 'cacti' 'cacti' 'oscom.sql'
I ran that on my shell prompt and it work fine.
Wonder why its giving me that error. ? any clue anyone? I tried to contact the developer of the sqlqueiries but no reply
any help will be appreciated
I ran that on my shell prompt and it work fine.
Wonder why its giving me that error. ? any clue anyone? I tried to contact the developer of the sqlqueiries but no reply
any help will be appreciated
ok, this is wired..
Ok, when I run this command under /home/cacti/
/usr/bin/php -q /home/cacti/scripts/mysql_query.php 192.168.1.211 3306 'cacti' 'cacti' 'oscom.sql'
File does not exist ..
ok when i run this under
/home/cacti/scripts/
/usr/bin/php -q /home/cacti/scripts/mysql_query.php 192.168.1.211 3306 'cacti' 'cacti' 'oscom.sql'
out1:334
That worked, So Why doesn't it work when I run it under /home/cacti? that is so wired. Anyone got any clue as to why it work under /home/cacti/script and not /home/cacti .? that is why i'm getting the error under cacti.log file does not exist.? but they file is there.
thanks
Song
/usr/bin/php -q /home/cacti/scripts/mysql_query.php 192.168.1.211 3306 'cacti' 'cacti' 'oscom.sql'
File does not exist ..
ok when i run this under
/home/cacti/scripts/
/usr/bin/php -q /home/cacti/scripts/mysql_query.php 192.168.1.211 3306 'cacti' 'cacti' 'oscom.sql'
out1:334
That worked, So Why doesn't it work when I run it under /home/cacti? that is so wired. Anyone got any clue as to why it work under /home/cacti/script and not /home/cacti .? that is why i'm getting the error under cacti.log file does not exist.? but they file is there.
thanks
Song
got it
I fixed this by editing the mysql_query.php file. I added in the full path to the querie/ directory and that worked with no error, but The graph is still not showing up? anyone know why?
I enable all debug log and cacti.log still no more error. I cannot trouble this anymore. Anyone know why the graph are not showing up?
thanks
I enable all debug log and cacti.log still no more error. I cannot trouble this anymore. Anyone know why the graph are not showing up?
thanks
ok i did a debuging on the graph
Here is what I get
RRDTool Command:
/usr/local/rrdtool-1.2.26/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="oscomdb - MySQL Queries" \
--base=1000 \
--height=120 \
--width=800 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/home/cacti/rra/oscomdb_out5_9.rrd":out1:LAST \
DEF:b="/home/cacti/rra/oscomdb_out5_9.rrd":out1:AVERAGE \
DEF:c="/home/cacti/rra/oscomdb_out5_9.rrd":out1:MAX \
DEF:d="/home/cacti/rra/oscomdb_out5_9.rrd":out2:LAST \
DEF:e="/home/cacti/rra/oscomdb_out5_9.rrd":out2:AVERAGE \
DEF:f="/home/cacti/rra/oscomdb_out5_9.rrd":out2:MAX \
DEF:g="/home/cacti/rra/oscomdb_out5_9.rrd":out3:LAST \
DEF:h="/home/cacti/rra/oscomdb_out5_9.rrd":out3:AVERAGE \
DEF:i="/home/cacti/rra/oscomdb_out5_9.rrd":out3:MAX \
DEF:j="/home/cacti/rra/oscomdb_out5_9.rrd":out4:LAST \
DEF:ba="/home/cacti/rra/oscomdb_out5_9.rrd":out4:AVERAGE \
DEF:bb="/home/cacti/rra/oscomdb_out5_9.rrd":out4:MAX \
DEF:bc="/home/cacti/rra/oscomdb_out5_9.rrd":out5:LAST \
DEF:bd="/home/cacti/rra/oscomdb_out5_9.rrd":out5:AVERAGE \
DEF:be="/home/cacti/rra/oscomdb_out5_9.rrd":out5:MAX \
CDEF:cdefa=a,300,* \
CDEF:cdefc=c,300,* \
CDEF:cdefd=d,300,* \
CDEF:cdeff=f,300,* \
CDEF:cdefg=g,300,* \
CDEF:cdefi=i,300,* \
CDEF:cdefj=j,300,* \
CDEF:cdefbb=bb,300,* \
CDEF:cdefbc=bc,300,* \
CDEF:cdefbe=be,300,* \
LINE1:cdefa#FF3932FF:"whos_online" \
GPRINT:cdefa:LAST:"Current\:%8.0lf" \
GPRINT:cdefc:MAX:"Max\:%8.0lf\n" \
LINE1:cdefd#8D00BAFF:"Query 2" \
GPRINT:cdefd:LAST:" Current\:%8.0lf" \
GPRINT:cdeff:MAX:"Max\:%8.0lf\n" \
LINE1:cdefg#CCBB00FF:"Query 3" \
GPRINT:cdefg:LAST:" Current\:%8.0lf" \
GPRINT:cdefi:MAX:"Max\:%8.0lf\n" \
LINE1:cdefj#009485FF:"Query 4" \
GPRINT:cdefj:LAST:" Current\:%8.0lf" \
GPRINT:cdefbb:MAX:"Max\:%8.0lf\n" \
LINE1:cdefbc#000000FF:"Query 5" \
GPRINT:cdefbc:LAST:" Current\:%8.0lf" \
GPRINT:cdefbe:MAX:"Max\:%8.0lf\n"
RRDTool Says:
ERROR: the RRD does not contain an RRA matching the chosen CF
What does it mean by RRA matching the chosen CF? anyone
RRDTool Command:
/usr/local/rrdtool-1.2.26/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="oscomdb - MySQL Queries" \
--base=1000 \
--height=120 \
--width=800 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/home/cacti/rra/oscomdb_out5_9.rrd":out1:LAST \
DEF:b="/home/cacti/rra/oscomdb_out5_9.rrd":out1:AVERAGE \
DEF:c="/home/cacti/rra/oscomdb_out5_9.rrd":out1:MAX \
DEF:d="/home/cacti/rra/oscomdb_out5_9.rrd":out2:LAST \
DEF:e="/home/cacti/rra/oscomdb_out5_9.rrd":out2:AVERAGE \
DEF:f="/home/cacti/rra/oscomdb_out5_9.rrd":out2:MAX \
DEF:g="/home/cacti/rra/oscomdb_out5_9.rrd":out3:LAST \
DEF:h="/home/cacti/rra/oscomdb_out5_9.rrd":out3:AVERAGE \
DEF:i="/home/cacti/rra/oscomdb_out5_9.rrd":out3:MAX \
DEF:j="/home/cacti/rra/oscomdb_out5_9.rrd":out4:LAST \
DEF:ba="/home/cacti/rra/oscomdb_out5_9.rrd":out4:AVERAGE \
DEF:bb="/home/cacti/rra/oscomdb_out5_9.rrd":out4:MAX \
DEF:bc="/home/cacti/rra/oscomdb_out5_9.rrd":out5:LAST \
DEF:bd="/home/cacti/rra/oscomdb_out5_9.rrd":out5:AVERAGE \
DEF:be="/home/cacti/rra/oscomdb_out5_9.rrd":out5:MAX \
CDEF:cdefa=a,300,* \
CDEF:cdefc=c,300,* \
CDEF:cdefd=d,300,* \
CDEF:cdeff=f,300,* \
CDEF:cdefg=g,300,* \
CDEF:cdefi=i,300,* \
CDEF:cdefj=j,300,* \
CDEF:cdefbb=bb,300,* \
CDEF:cdefbc=bc,300,* \
CDEF:cdefbe=be,300,* \
LINE1:cdefa#FF3932FF:"whos_online" \
GPRINT:cdefa:LAST:"Current\:%8.0lf" \
GPRINT:cdefc:MAX:"Max\:%8.0lf\n" \
LINE1:cdefd#8D00BAFF:"Query 2" \
GPRINT:cdefd:LAST:" Current\:%8.0lf" \
GPRINT:cdeff:MAX:"Max\:%8.0lf\n" \
LINE1:cdefg#CCBB00FF:"Query 3" \
GPRINT:cdefg:LAST:" Current\:%8.0lf" \
GPRINT:cdefi:MAX:"Max\:%8.0lf\n" \
LINE1:cdefj#009485FF:"Query 4" \
GPRINT:cdefj:LAST:" Current\:%8.0lf" \
GPRINT:cdefbb:MAX:"Max\:%8.0lf\n" \
LINE1:cdefbc#000000FF:"Query 5" \
GPRINT:cdefbc:LAST:" Current\:%8.0lf" \
GPRINT:cdefbe:MAX:"Max\:%8.0lf\n"
RRDTool Says:
ERROR: the RRD does not contain an RRA matching the chosen CF
What does it mean by RRA matching the chosen CF? anyone
You're on cacti 0.8.7a? Install the patches (on the main site).
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Re: yes
Yes.aboyz wrote: Should I go ahead and do the main patches??
No, they're released after 0.8.7a came out.aboyz wrote:Isn't the main patches suppose to be on the latest 0.8.7a release?
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Who is online
Users browsing this forum: No registered users and 0 guests