The MySQL Graph Collection - Version 2.0!

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

Moderators: Moderators, Developers

Post Reply
Author
Message
byrons
Posts: 17
Joined: Thu Jan 27, 2005 6:30 am
Contact:

#31 Post by byrons » Wed Feb 02, 2005 4:52 am

Ok sorry, silly me for not reading all the comments but maybe some useful advice, include it in the README.txt?

There seems to still be a few people having problems with this and It would make more sense.. If not in the README.txt maybe in the first message of this topic?

Cheers and thanks for your efforts on this.

Regards
Byron

Atle
Posts: 7
Joined: Thu Feb 03, 2005 2:07 pm

Question about the Data Input Methods design

#32 Post by Atle » Thu Feb 03, 2005 2:18 pm

Looking at the way the data input methods are defined, there are currently 6 available all of which call the script slightly differently (namely the first parameter which specifies the type of statistics to grab).

Is cacti limited by design from just having one data input method that simply returns all variables displayed by (in this case) 'SHOW STATUS', instead of having N instances for N types of graphing templates? As it is now, cacti has to query the mysql server 6 times for the exact same data, the only difference is what it outputs.

In other words, if the input method returns 'var1:value1 var2:value2 .. varN:valueN' and you only care about 'var2' does that confuse cacti? The manual does not really say anything about this.

I'm pretty new to cacti and so far I'm pretty impressed!

Atle
Posts: 7
Joined: Thu Feb 03, 2005 2:07 pm

Limit in the data sources need to be appropriately set

#33 Post by Atle » Fri Feb 04, 2005 4:21 pm

It looks like all the limits for each of the data sources are set to 10000000000, while the stats being displayed are based on a 32bit counter. Whenever you reset counters or reset the mysql daemon, the graphs will most likely have a very large jump. I just had that happen and it's quite a pain to go into the rrd files to correct this.. :)

If you change the max to a 32 bit counter, 4294967296, it should handle counter resets.

mait
Posts: 16
Joined: Wed Feb 23, 2005 2:14 am

#34 Post by mait » Fri Feb 25, 2005 4:55 am

hi,

i'm getting the following error:

[[email protected] cactiuser]$ /usr/bin/php /var/www/html/cacti/poller.php
PHP Notice: Undefined index: query_cache_size in /var/www/html/cacti/scripts/mysql_stats.php on line 38
PHP Notice: Undefined index: Qcache_free_memory in /var/www/html/cacti/scripts/mysql_stats.php on line 38
PHP Notice: Undefined index: Qcache_free_memory in /var/www/html/cacti/scripts/mysql_stats.php on line 39


any ideas?

Mait

ottob
Cacti User
Posts: 51
Joined: Tue Apr 27, 2004 11:43 am
Location: Duesseldorf, Germany
Contact:

#35 Post by ottob » Fri Feb 25, 2005 5:17 am

Hi !

are you using MySQL 4? The QueryCache-graph will only work with Mysql4 (MySQL 3.x dont have a query-cache mechanism...

Otto

mait
Posts: 16
Joined: Wed Feb 23, 2005 2:14 am

#36 Post by mait » Fri Feb 25, 2005 5:24 pm

hi,

nope, sql is version 3.23.58 ...

Mait

User avatar
hbokh
Posts: 40
Joined: Thu Feb 24, 2005 4:29 pm
Location: Groningen, NL

#37 Post by hbokh » Sat Feb 26, 2005 8:13 pm

It's still 127.0.0.1 vs. localhost...
Since

Code: Select all

/usr/local/bin/php -q /usr/local/share/cacti/scripts/mysql_stats.php command 127.0.0.1 cactiuser password
is not working, but

Code: Select all

/usr/local/bin/php -q /usr/local/share/cacti/scripts/mysql_stats.php command localhost cactiuser password
is working, I've changed the script a little like this:

Code: Select all

        #$host     = $_SERVER["argv"][2];
        $host     = localhost;
        $username = $_SERVER["argv"][3];
        $password = $_SERVER["argv"][4];
It generates a notice when run from the CLI, but it also give date to the RRDs :)
This is my sick nature...

ottob
Cacti User
Posts: 51
Joined: Tue Apr 27, 2004 11:43 am
Location: Duesseldorf, Germany
Contact:

#38 Post by ottob » Mon Feb 28, 2005 3:52 am

I've just modified the data templates to check "Use Per-Data Source Value" for "Database Host", allowing me to graph my local MySQL server on 127.0.0.1

Regards,

Frédéric
You can also do it like this, maybe its easier (you dont have to edit the php-file...)

Otto

komaii
Posts: 9
Joined: Wed Jan 19, 2005 4:58 am

#39 Post by komaii » Fri Mar 18, 2005 5:30 am

i got this from log if i start the mysql_stats.php:

03/18/2005 02:25:50 AM - CMDPHP: Poller[0] Host[1] WARNING: Result from CMD not valid. Partial Result: Error: MySQL connect
03/18/2005 02:25:50 AM - CMDPHP: Poller[0] Host[1] WARNING: Result from CMD not valid. Partial Result: Error: MySQL connect

and i also got this error message if i start poller.php via commandline:
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
ERROR: Not enough arguments
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
ERROR: Not enough arguments
OK u:0.00 s:0.00 r:1.01
ERROR: Not enough arguments
OK u:0.00 s:0.00 r:1.01
OK u:0.00 s:0.00 r:1.01
ERROR: Not enough arguments

any idea what this could be?
i can connect to the database via commandline, i got no errors.


regards,
komaii

komaii
Posts: 9
Joined: Wed Jan 19, 2005 4:58 am

#40 Post by komaii » Fri Mar 18, 2005 6:01 am

hmm it looks like the xml import is wrong or the script:

her the log output if i newly import the mysql xml`s:

sh: lt: command not found
sh: path_php_binarygt: command not found
sh: -q: command not found
sh: path_cactigt: command not found
sh: /scripts/mysql_stats.php: No such file or directory
sh: hostnamegt: command not found
sh: lt: command not found
sh: usernamegt: command not found
sh: lt: command not found
sh: passwordgt: command not found

does anyone know whats this is?

chrigu
Posts: 6
Joined: Mon Mar 07, 2005 9:34 am

#41 Post by chrigu » Thu Mar 24, 2005 7:04 am

There is a graph called "mysql questions". stupid question: what is a mysql question?

thanks,
chrigu

eyechart
Posts: 49
Joined: Thu Apr 25, 2002 11:48 pm

#42 Post by eyechart » Thu Mar 31, 2005 9:08 am

chrigu wrote:There is a graph called "mysql questions". stupid question: what is a mysql question?

thanks,
chrigu
from http://dev.mysql.com/doc/mysql/en/serve ... ables.html
Questions

The number of queries that have been sent to the server.


-ec

badger
Posts: 8
Joined: Tue Apr 05, 2005 7:47 pm

#43 Post by badger » Wed Apr 06, 2005 12:07 pm

I'm having some trouble under 0.8.6c. Some scripts work and some don't. For example, the connections data gets charted, but the command statistics script does not even create a .rrd file, so never generates a chart. When I run the script by hand, it appears to deliver appropriate data.

When I activate the data source for command statistics, poller.php thows this error:

PHP Warning: Compilation failed: range out of order in character class at offset 29 in /var/www/html/cacti-0.8.6c/lib/poller.php on line 215

The output from running the command by hand:

/usr/bin/php -q /var/www/html/cacti/scripts/mysql_stats.php command <ip> <user> <passwd>

change_db:1517531 delete:67708 insert:481203 select:8691064 update:1800654

ottob
Cacti User
Posts: 51
Joined: Tue Apr 27, 2004 11:43 am
Location: Duesseldorf, Germany
Contact:

#44 Post by ottob » Thu Apr 07, 2005 3:36 am

Hi,

sorry, ive no idea about this error, maybe an issue of the php installation? What is the php version?

sylvainouellet
Posts: 3
Joined: Mon Mar 21, 2005 7:56 am

No rrd graph updated.

#45 Post by sylvainouellet » Thu Apr 07, 2005 4:50 am

badger wrote: PHP Warning: Compilation failed: range out of order in character class at offset 29 in /var/www/html/cacti-0.8.6c/lib/poller.php on line 215

The output from running the command by hand:

/usr/bin/php -q /var/www/html/cacti/scripts/mysql_stats.php command <ip> <user> <passwd>

change_db:1517531 delete:67708 insert:481203 select:8691064 update:1800654
I got the same problem, but when I look into my cacti.log file I see the following:

04/07/2005 11:35:02 AM - CACTID: Poller[0] Host[1] SCRIPT: /usr/bin/php -q /usr/local/cacti-0.8.6c/scripts/mysql_stats.php command localhost root mypasswd, output: change_db:13806 delete:2278693 insert:2296971 select:576136 update:94064

04/07/2005 11:35:02 AM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (1218,'','2005-04-07 11:35:02','change_db:13806 delete:2278693 insert:2296971 select:576136 update:94064')

There is no value for 'rrd_name'.

The ' MySQL - Single Statistics Input Method' works fine.
Ex for the Question statistic template :
04/07/2005 11:35:02 AM - CACTID: Poller[0] Host[1] SCRIPT: /usr/bin/php -q /usr/local/cacti-0.8.6c/scripts/mysql_stats.php status localhost root mypasswd Questions, output: 5369990

04/07/2005 11:35:02 AM - CACTID: Poller[0] DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (1222,'questions','2005-04-07 11:35:02','5369990')

Any ideas???
Thank you

Post Reply