The MySQL Graph Collection - Version 2.0!

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

Moderators: Developers, Moderators

Post Reply
Aurelgadjo
Posts: 13
Joined: Sun Dec 30, 2007 8:48 am

Post by Aurelgadjo »

Aurelgadjo wrote:Hi,

I've many graphes who does not work.

The message is same :
RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-60 \
--title="Home - Saber - MySQL - Questions" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--y-grid=questions \
--vertical-label="questions" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/cacti.home.aurelgadjo.fr/rra/home_-_saber_questions_52.rrd":questions:AVERAGE \
DEF:b="/var/www/cacti.home.aurelgadjo.fr/rra/home_-_saber_questions_52.rrd":questions:MAX \
AREA:a#FF7D00FF:"Questions" \
GPRINT:a:MIN:"Min\:%8.2lf %s" \
GPRINT:b:MAX:"Max\:%8.2lf %s" \
GPRINT:a:LAST:"Current\:%8.2lf %s"

RRDTool Says:

ERROR: invalid y-grid format
Any idea ?
I've found the answer.

Just delete, in the graph template the value of "Unit Grid Value (--unit/--y-grid)"
Look at the pic


Edit :
razzle dazzle wrote:I just spent a couple of hours looking why the "mysql command statistics" and "mysql traffic" graphs stayed empty and finally got it working. :D

The MySQL version I use is > 5.0.2, and the "SHOW STATUS" command seems to have changed from that version on:
mysql.com wrote:Before MySQL 5.0.2, SHOW STATUS returned global status values. Because the default as of 5.0.2 is to return session values, this is incompatible with previous versions. To issue a SHOW STATUS statement that will retrieve global status values for all versions of MySQL, write it like this:
SHOW /*!50002 GLOBAL */ STATUS;
So if you have MySQL 5.0.2 or later, you can fix your graphs by doing the following:

- Open the file <cacti-install-dir>/site/scripts/mysql_stats.php

- Search for the text "$result_stat = @mysql_query("SHOW STATUS");" (around line 19)

- On that line, replace the text SHOW STATUS by SHOW /*!50002 GLOBAL */ STATUS


Please see this url for more information.


Hope this helps ! :D
w00t ! thanks
(quote for "up" this answer)
Attachments
Image2.png
Image2.png (27.68 KiB) Viewed 41869 times
Brashquido
Cacti User
Posts: 99
Joined: Sat Feb 28, 2004 10:16 pm
Location: Melbourne, Australia
Contact:

Spine Vs cmd.php?

Post by Brashquido »

Hi All,

After a few adjustments and a bit of permissioning work this script seems to run ok for me. However I do have a problem when trying to use spine as my poller.

Spine seems to run the mysql_stats.php file fine for several polling intervals, then for no apparent reason (at least to me) it starts giving me "Spine Encountered a Segmentation Fault (Spine thread)" errors in the Cacti log. Looking at the cacti cmd window when it runs on the server I can see everything seems to run fine however it is almost like the cacti poller isn't aware that the spine process is compelte as it just sits there spitting out a "waiting on 1/1 pollers" message until timeout. As soon as I use cmd.php poller everything runs just fine.
Dominic Ryan
www.iis-aid.com
User avatar
east_cost
Posts: 35
Joined: Tue Jan 22, 2008 5:33 am

Post by east_cost »

hello

i am using your template to graph my DB server i.e MySQL but there is some problem ...

some graphs are doing well but some show only 0.00 stats c the attached pic ..

wht may be the cause of the problem ? any solution?
User avatar
east_cost
Posts: 35
Joined: Tue Jan 22, 2008 5:33 am

Post by east_cost »

ok done thanks to all .. the problem was MySQL ver .. ie SHOW STATUS ...

thnkz again to every one
Aurelgadjo
Posts: 13
Joined: Sun Dec 30, 2007 8:48 am

Post by Aurelgadjo »

Hi,

When i restart the mysql server, the graphes make a very hight peak... And the pics are broken. See examples (i didn't know the good words to explain, i'm french :s)

what can i do ? it's normal ?
Attachments
graph_image.php.png
graph_image.php.png (20.13 KiB) Viewed 41241 times
tracky2007
Posts: 34
Joined: Thu Dec 27, 2007 3:07 am

Post by tracky2007 »

why mysql return "0" value???
mysql version6.0 alpha,does it matter????

cacti@SUSE10:~> php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php command 118.1.115.107 cactiuser "cactipasswd"
change_db:0 delete:0 insert:0 select:0 update:0cacti@SUSE10:~>


cacti@SUSE10:~> php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php command 118.1.115.107 cactiuser "cactipasswd"
change_db:0 delete:0 insert:0 select:0 update:0cacti@SUSE10:~> php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php comm"
change_db:0 delete:0 insert:0 select:0 update:0cacti@SUSE10:~>
cacti@SUSE10:~> php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php cache 118.1.115.107 cactiuser "cactipasswd"
used:0 available:0cacti@SUSE10:~>
cacti@SUSE10:~> php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php handler 118.1.115.107 cactiuser "cactipasswd"
delete:0 read_first:0 read_key:0 read_next:0 read_prev:0 read_rnd:0 read_rnd_next:0 update:0 write:0cacti@SUSE10:~>

but the traffic got some value:
cacti@SUSE10:~> php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php traffic 118.1.115.107 cactiuser "cactipasswd"
in:83 out:76cacti@SUSE10:~>
sterpstra
Posts: 45
Joined: Tue May 27, 2008 11:48 pm
Location: So Cal
Contact:

Post by sterpstra »

Hi all:

I'm getting a PDO already loaded in Unknow on line 0 and pdo_mysql already loaded in Unknown on line 0 when I try to run the script from the command line. Any ideas on that?

-st

BTW ~ If you see this post in it's own topic, I'm sorry in advance.. Hit the button too quick... :cry:
Aurelgadjo
Posts: 13
Joined: Sun Dec 30, 2007 8:48 am

Post by Aurelgadjo »

Aurelgadjo wrote:Hi,

When i restart the mysql server, the graphes make a very hight peak... And the pics are broken. See examples (i didn't know the good words to explain, i'm french :s)

what can i do ? it's normal ?
I've solved the problem.
Look at the attached file. The values are bigger than writed in the textbox will ignored. that's include the fuckin useless peaks.
Attachments
lul.jpg
lul.jpg (232.24 KiB) Viewed 40512 times
felix9x
Posts: 2
Joined: Thu Oct 23, 2008 11:35 am

Fix with Mysql Command/Handler Graphs

Post by felix9x »

Basically after you get your data collection working here is what you do. There are a few unrelated problems mentioned previously in the thread and I have encountered all of them also. At this point just the graph is not being displayed but the data is being retried correctly as can be verified in the Cacti log.

Go to Graph Templates -> MySQL - Command statistics -> Unit Grid Value (--unit/--y-grid)

Change the value from "access units" to "access-units" or "access_units"

Same for MySQL - Handler statistics

-----
Essentially the problem here is that the command line for the rrdtool graph method is not passed correctly with a space since the quotes are not used around the value when calling the command. (This is probably a bug with cacti)

-------
This info is current as of version Version 0.8.7b of cacti.
Hope this helps and saves a few hours for people as it did not for me.
BasTijs
Posts: 2
Joined: Wed Oct 29, 2008 4:11 am

Post by BasTijs »

Ive just installed the script and the only graph thats if working is the querycache. The cacti users has all privileges and ive flushed it.

Any ideas?
chekolyn
Posts: 1
Joined: Fri Nov 07, 2008 3:53 pm

mysqli_stats.php returns zero 0

Post by chekolyn »

Hello Everyone,

I was troubleshooting the mysqli_stats.php script, when the script seem to return almost everything with zeros.

And it looks that it the guys from Mysql changed how the show status; command works, now it just returns values for the current session if your msyql server is 5.02 or higher.

Here's the mysql link where i found the info :
http://dev.mysql.com/doc/refman/5.0/en/show-status.html

One of the thing that I just modified in the mysqli_stats.php scripts is
this:

Code: Select all

$result_stat = @mysqli_query($link,"SHOW STATUS");
for this:

Code: Select all

$result_stat = @mysqli_query($link,"SHOW /*!50002 GLOBAL */ STATUS;");
And now I'm getting the real data from msyql.

Well I hope this helps someone out there.
KenK
Posts: 3
Joined: Sat Nov 15, 2008 12:43 pm

Post by KenK »

Thanks everyone for those tips.

Chekolyn: I didnt see any difference in the numbers between your SQL command and just plaint "SHOW GLOBAL STATUS". For what it's worth, I am running MySQL v5.0.22.


Finally! all is working! Someone should get those graph templates fixed! Stupid y-grid values!! :wink:
KenK
Posts: 3
Joined: Sat Nov 15, 2008 12:43 pm

Re: Fix with Mysql Command/Handler Graphs

Post by KenK »

felix9x wrote: Change the value from "access units" to "access-units" or "access_units"
Are you sure about that? Your tip didnt help my graphs appear. I had to remove those values completely and then everything worked liked it was supposed to. Aurelgadjo has it right. According the the RRDTool manual the y-grid is a number that defines the interval between lines across the Y axis, so putting a string there makes no sense (although there is an option for a label on each line, but even that makes no sense with what is appearing in these templates!).

Just delete it...
kari.patila
Posts: 1
Joined: Mon Nov 24, 2008 5:39 am

Can't get command statistics to show up

Post by kari.patila »

After trying everything suggested in this thread so far, I've yet to come up with a solution.

I get this from mysql_stats.php command localhost user password:
change_db:1490 delete:8814 insert:3133 select:51494 update:8670

Nothing shows up on the graphs, though. Others (besides traffic) are working just fine and I get no errors from RRDTool or the logfile.

How should I try to troubleshoot this one? Any suggestions would be appreciated.

[EDIT: nevermind, it turned out to be a simple path issue after all]
limaunion
Posts: 20
Joined: Tue Jul 05, 2005 10:44 am

Post by limaunion »

tracky2007 wrote:why mysql return "0" value???
mysql version6.0 alpha,does it matter????

cacti@SUSE10:~> php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php command 118.1.115.107 cactiuser "cactipasswd"
change_db:0 delete:0 insert:0 select:0 update:0cacti@SUSE10:~>


cacti@SUSE10:~> php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php command 118.1.115.107 cactiuser "cactipasswd"
change_db:0 delete:0 insert:0 select:0 update:0cacti@SUSE10:~> php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php comm"
change_db:0 delete:0 insert:0 select:0 update:0cacti@SUSE10:~>
cacti@SUSE10:~> php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php cache 118.1.115.107 cactiuser "cactipasswd"
used:0 available:0cacti@SUSE10:~>
cacti@SUSE10:~> php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php handler 118.1.115.107 cactiuser "cactipasswd"
delete:0 read_first:0 read_key:0 read_next:0 read_prev:0 read_rnd:0 read_rnd_next:0 update:0 write:0cacti@SUSE10:~>

but the traffic got some value:
cacti@SUSE10:~> php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php traffic 118.1.115.107 cactiuser "cactipasswd"
in:83 out:76cacti@SUSE10:~>
I'm having the same problem, I keep getting a '0' with some commands: 'command statistics' + 'handler statistics' + 'single statistics' + 'traffic' with mysql version '5.0.67-0ubuntu6'
Any ideas what's going on here?
thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests