The MySQL Graph Collection - Version 2.0!

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

Moderators: Developers, Moderators

Post Reply
alinux
Cacti User
Posts: 56
Joined: Mon Jul 16, 2007 10:02 am

Post by alinux »

Well same here I did apply it and I tested the mysql connection from the cacti host to the remote host all is fine..however the graphs dont show any data...only 0

any help please ?

Thanks
alinux
Cacti User
Posts: 56
Joined: Mon Jul 16, 2007 10:02 am

Post by alinux »

Adding to the above I tried

php -q mysqli_stats.php cache xxxxxxxx user sdfsdaf

I did not get any reply
xero
Posts: 6
Joined: Thu Jun 11, 2009 4:19 am

Re: MYSQL MULTI running more than 1 mysql on same ip

Post by xero »

jbreault wrote:Is there somebody that can add to the script mysql port support ? we have about 16 mysql db running on different port and since cacti add by ping if host is alive before to try to graph, we cant use anymore HOST:PORT as host...
I was thinking about this too. As I don't have time to add the port support in the templates (which should be done pretty quick with some knownledge of cacti), I implemented a hotfix.

This is only working, if your hostnames are different (i.e. not 127.0.0.1 for a stunnel connection on different ports).

Open the mysql(i)_stats.php and search for the following line:
$password = $_SERVER["argv"][4];

After that line, add the following line for every host which is using a different port (replace "mysqlhostname.com" with the hostname or IP address you are using in cacti):

Code: Select all

if($host == "mysqlhostname.com") {
     $host .= ":3307";
}
This way you can setup a different port for every unique hostname you are using.

This is only a hotfix, if you don't have time to implement directly in cacti. Be sure to keep a note in the notes field of your host, so you don't run in to problems, when the port is changing back to 3306.

If you have the knowledge of implementing it in cacti, do it there and repost the file. That would be great.

OttoB: Wouldn't it be good to release the zip files on a seperate web page with a link to this thread? This way users don't have to go through the whole thread to find the latest version. Also the latest fixes could be on a single page.
xero
Posts: 6
Joined: Thu Jun 11, 2009 4:19 am

Question about graph units

Post by xero »

As I don't wanted to mix up this question with my last post, I'm going to ask it seperately.

I'm not sure about the unit "m" in the graph. This is probably a thing about rrdtool but in the end I'm not sure how to interpret the mysql_stats values.

What exactly means "m" (i.e. "30.00 m" in the attached image)? Is that milli and how is this calculated? Is this the average per minute, so if I there's only one action within 3 minutes for example?
Attachments
MySQL Handler Statistics
MySQL Handler Statistics
mysql-handler.png (54.6 KiB) Viewed 34329 times
mintoy
Posts: 7
Joined: Tue Apr 07, 2009 5:04 am
Location: India
Contact:

Acess denied in Mysql

Post by mintoy »

when i execute this command C:\mysql\bin>php -q c:\auntie\cacti\scripts\mysql_stats.php command localhost cactiuser cactipw

i get the message access is denied. pls help me to solve the issue.
xero
Posts: 6
Joined: Thu Jun 11, 2009 4:19 am

Re: Acess denied in Mysql

Post by xero »

mintoy wrote:when i execute this command C:\mysql\bin>php -q c:\auntie\cacti\scripts\mysql_stats.php command localhost cactiuser cactipw

i get the message access is denied. pls help me to solve the issue.
Did you use the "GRANT PROCESS..." command to add cactiuser to your database?

Check the first pages of this thread or the README included in the package to see how a user is added.
mintoy
Posts: 7
Joined: Tue Apr 07, 2009 5:04 am
Location: India
Contact:

Post by mintoy »

yes I have done that grant process to the database.
mintoy
Posts: 7
Joined: Tue Apr 07, 2009 5:04 am
Location: India
Contact:

Post by mintoy »

I have done the grant process to particular user and still I get the message Acess denied. Pls help me to solve the issue.
hahnn
Posts: 34
Joined: Tue Feb 03, 2009 5:46 am
Location: Luxembourg
Contact:

Thread and Handler graphs have NaN values only

Post by hahnn »

Hi,

OS: RHEL 5
kernel: 2.6.18-128
RAM: 32 Gb
Processors: 8 cores
Database: MySQL cluster 7.0.6 on 2 nodes
PHP: 5.2.1
Cacti: 0.8.7e
PA: 2.4
plugins: a lot of cacti plugins installed
Spine: 0.8.7e
apache: 2.2.3-22

My Problem:

I've installed mysqli_stats to be able to graph usefull data from my MySQL cluster nodes.

All graphs are working fine except the Threads one, and the Handler one.

Enabling debuging, RRDTool status is OK everywhere.

Testing mysqli_stats.php under shell to have handler and threads data give correct results. See here below for mysqli_stats.php handler localhost XXXXX XXXXX:
delete:141103091 read_first:7893 read_key:422346295 read_next:265394247 read_prev:0 read_rnd:92875384 read_rnd_next:110791284115 update:471787032 write:652298529

THe problem is that RRDtool files for those two graphs (handler and threads) contains only NaN values.

I don't know why.

Please note that the maximum value for each data of the handler template is set to 1000000000000.

Any help would be greatly appreciated.

best regards
Nicolas
stevewalsh
Posts: 3
Joined: Sun Apr 15, 2007 6:43 am

fix for blank graphs

Post by stevewalsh »

Hahnn

I had the same problem and used the results from razzle dazzle earlier in this thread, take a look at http://forums.cacti.net/post-96562.html ... ght=#96562, you'll need to edit the mysql_stats.php file

Thanks!
sergefonville
Posts: 1
Joined: Mon Jan 18, 2010 10:48 am

Post by sergefonville »

I just installed mysql_stats.
I like it a lot, especially I can read any value with it.

I created a graph that shows 'Key_read_requests'
I created it as a COUNTER (which made the most sense to me)
The weird thing is, it shows:
min: 70.67 max: 393.39 current: 119.84

How does it come to these values?
Are they divided or something?
I checked for myself and this value changes by about 8000 per 5 minutes.

Thanks a lot
rixxie
Posts: 3
Joined: Mon Feb 08, 2010 1:34 am

Post by rixxie »

If you're using MySQL5, edit mysql_stats.php and replace the following lines

Code: Select all

$result_stat = @mysql_query("SHOW STATUS");
to

Code: Select all

$result_stat = @mysql_query("SHOW GLOBAL STATUS");
and

Code: Select all

$result_var = @mysql_query("SHOW VARIABLES");
to

Code: Select all

$result_var = @mysql_query("SHOW GLOBAL VARIABLES");
This would give your graph a system wide statistics.
klim
Posts: 11
Joined: Tue Aug 17, 2010 10:50 pm

Post by klim »

Hello, i have a problem:

mysql> GRANT PROCESS ON * TO cactiuser@'some ip' IDENTIFIED by 'cactipasswd';
ERROR 1046 (3D000): No database selected

The mysql server (witch i want to monitoring) located on different of cacti server.

Also i want to monitoring whole server instead specific db
klim
Posts: 11
Joined: Tue Aug 17, 2010 10:50 pm

Post by klim »

klim wrote:Hello, i have a problem:

mysql> GRANT PROCESS ON * TO cactiuser@'some ip' IDENTIFIED by 'cactipasswd';
ERROR 1046 (3D000): No database selected

The mysql server (witch i want to monitoring) located on different of cacti server.

Also i want to monitoring whole server instead specific db
i found solution:

mysql> GRANT PROCESS ON *.* TO cactiuser@'some ip' IDENTIFIED by 'cactipasswd';
Query OK, 0 rows affected (0.00 sec)
klim
Posts: 11
Joined: Tue Aug 17, 2010 10:50 pm

Post by klim »

Why drawing not all of graphics from tamplate?
I have only QueryCache Statistic
The Single Statistics and Traffic are drawing, but without values, only empty picture.
Other graphics not created.

I gave all permission (grant all), but it is also doesn't work.
Please help.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests