Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
there you will find useful descriptions of the values that are beeing graphed...
For example:
Handler_read_key
The number of requests to read a row based on a key. If this is high, it is a good indication that your queries and tables are properly indexed.
you're script uses short open tags (<?) where the current php default is no short open tags allowed (<?php). So i had to eigter put "on" in the php.ini or change the scripts to <?php.
ottob, well done these are some great scripts, and was exactly what my team and I were after to monitor our SQL servers. You have done really well. The instructions were clear and the trouble shooting through the forum were easy follow
when trying:
php -q /var/www/htdocs/cacti/scripts/mysql_stat.php localhost cacti *** Connections, i got:
PHP Notice: Undefined variable: argv in /var/www/htdocs/cacti-0.8.5a/scripts/mysql_stat.php on line 4
PHP Notice: Undefined variable: argv in /var/www/htdocs/cacti-0.8.5a/scripts/mysql_stat.php on line 5
PHP Notice: Undefined variable: argv in /var/www/htdocs/cacti-0.8.5a/scripts/mysql_stat.php on line 6
PHP Notice: Undefined variable: argv in /var/www/htdocs/cacti-0.8.5a/scripts/mysql_stat.php on line 8
PHP Notice: Undefined index: in /var/www/htdocs/cacti-0.8.5a/scripts/mysql_stat.php on line 16
of-course, cacti does not generate any graph, but in Graph management debug i see (for example):
RRDTool Says:
Probably not, but could I use this script with cactid? It is soooo much faster than the cmd.php method of polling (:o), that it would make me sad to go back.
ohrael - Enable support for argv/argc in your php.ini
ottob - <? and ?> short tags aren't supported on every server, so to get more compatibility use <?php and ?>
Thanks guys! it is working i enabled "register_argc_argv = ON"
as for the code, Sandello, i am no programmer, so if you could be more specific as to where to put the code, it would be excellent. this is what the scripts contain right now:
mysql_connect($host, $username, $password) or die ("0");
$res_stat = mysql_query("SHOW STATUS") or die("0");
while ($fld_stat = mysql_fetch_row($res_stat)) {
$status[$fld_stat[0]] = $fld_stat[1];