MySQL Host Template -- Updated on 2006-08-10

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

Moderators: Developers, Moderators

Post Reply
zonet
Posts: 2
Joined: Wed Oct 24, 2007 1:29 pm

Re: Everything works except graphs show no data

Post by zonet »

windowsrefund wrote:Everything installed as per the docs. Database permissions are fine and I've verified using mysql_stats.php from a shell.

Everything is good with the exception of the graphs not showing any data. Any ideas? Perhaps I'm just not waiting long enough? It's been about 20 minutes already.

Thanks
I have same problem,
I get this error when I run poller.php

Notice: Undefined index: in /usr/share/cacti/lib/rrd.php on line 224

Graph debug:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Localhost - teMySQL - Network Usage" \
--base=1000 \
--height=150 \
--width=600 \
--alt-autoscale-max \
--lower-limit=1 \
--vertical-label="" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/usr/share/cacti/rra/localhost_questions_583.rrd":Bytes_sent:AVERAGE \
DEF:b="/usr/share/cacti/rra/localhost_questions_583.rrd":Bytes_received:AVERAGE \
DEF:c="/usr/share/cacti/rra/localhost_questions_583.rrd":Max_used_connection:AVERAGE \
DEF:d="/usr/share/cacti/rra/localhost_questions_583.rrd":Questions:AVERAGE \
DEF:e="/usr/share/cacti/rra/localhost_questions_583.rrd":Connections:AVERAGE \
CDEF:cdefa=a,1024,/ \
CDEF:cdefc=b,1024,/ \
AREA:cdefa#D8ACE0:"KB Sent" \
LINE1:cdefa#623465:"" \
LINE2:cdefc#EA8F00:"KB Recvd" \
LINE2:c#7EE600:"Max Conn" \
LINE1:d#4444FF:"Queries" \
LINE2:e#157419:"Connections"
RRDTool Says:

ERROR: opening '/usr/share/cacti/rra/localhost_questions_583.rrd': No such file or directory

data source debug
Notice: Undefined index: in /usr/share/cacti/lib/rrd.php on line 224
/usr/bin/rrdtool create \
/usr/share/cacti/rra/localhost_sort_merge_passes_585.rrd \
--step 300 \
DS:Sort_merge_passes:DERIVE:600:0:1000000 \
DS:Sort_range:DERIVE:600:0:10000000 \
DS:Sort_rows:DERIVE:600:0:100000000 \
DS:Sort_scan:DERIVE:600:0:1000000 \
RRA::0.5:1:500 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MIN:0.5:1:600 \
RRA:MIN:0.5:6:700 \
RRA:MIN:0.5:24:775 \
RRA:MIN:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:600 \
RRA:LAST:0.5:6:700 \
RRA:LAST:0.5:24:775 \
RRA:LAST:0.5:288:797 \

something is missing... did anyone figured out what's the problem?
khufure
Cacti User
Posts: 203
Joined: Wed Oct 24, 2007 5:47 pm
Location: San Francisco, CA
Contact:

Post by khufure »

So I installed this plugin on a few other servers and got it to work right away. In both cases I can connect remotely from the cacti server, and get information from information_schema. Presumably this is the DB where the stats come from.

Working server
mysql> select * from USER_PRIVILEGES;
+-------------+---------------+----------------+--------------+
| GRANTEE | TABLE_CATALOG | PRIVILEGE_TYPE | IS_GRANTABLE |
+-------------+---------------+----------------+--------------+
| 'cacti'@'%' | NULL | PROCESS | NO |
| 'cacti'@'%' | NULL | SUPER | NO |
+-------------+---------------+----------------+--------------+
2 rows in set (0.00 sec)

mysql> quit
Bye

Broken server

mysql> use information_schema;
Database changed
mysql> select * from USER_PRIVILEGES;
+-------------+---------------+----------------+--------------+
| GRANTEE | TABLE_CATALOG | PRIVILEGE_TYPE | IS_GRANTABLE |
+-------------+---------------+----------------+--------------+
| 'cacti'@'%' | NULL | PROCESS | NO |
| 'cacti'@'%' | NULL | SUPER | NO |
+-------------+---------------+----------------+--------------+
2 rows in set (0.00 sec)
khufure
Cacti User
Posts: 203
Joined: Wed Oct 24, 2007 5:47 pm
Location: San Francisco, CA
Contact:

Post by khufure »

Figured it out by reading mysl_stats.php. The innodb stuff references "show innodb status". Try to login as the user you setup with SUPER privileges and see if it works. In my case the problem ended up being related to INNODB logging. I had changed the innodb_log_size but not stopped mysql, moved the logfiles, started mysql to update.
RattleSn@ke
Posts: 17
Joined: Tue Aug 10, 2004 5:44 pm

Post by RattleSn@ke »

Hello,

I've got some other sort problem.
I did everything according to the README, Created new host with new graphs. But now when I select the host to display the graphs, my server goes to a load of 40-50(!) and that's it!

I tried both templates, same problem.
Connection to mysql-server is ok. Can run script from command line.
Poller gives no errors.
Even tried it with only one graph (teMySQL - InnoDB Buffers Pages/Mem), directly hangs the server.

Anyone an idea??
Thanks!
brajan
Posts: 1
Joined: Fri Nov 23, 2007 2:09 am

Post by brajan »

Hello.

I'm not sure what i did wrong. I followed the readme completely but still my graphs don't show anything when cron is set to 5 minutes.
----------------------------------!!!!!!!!-----------------------------------
WARNING: These graphs assume a 1-minute Poller cron frequency! If you use the
default 5-minute interval, run convertXmlTo5minutePollingInterval.sh, which
will make a step=300, heartbeat=600 version of the XML file for you to import.

If you don't do this, none of your graphs will ever show any data.
----------------------------------!!!!!!!!-----------------------------------
I followed all instructions in README in any possible way. Using sh script as well as changing it manually. No matter what it only works when cron is set for 1 minute interval .... however it's raping my server so it's not a solution for me.

Any tips and help appreciated.
Attachments
graph_image.php.png
graph_image.php.png (37.94 KiB) Viewed 12422 times
zheka
Posts: 44
Joined: Tue May 23, 2006 11:52 am

Post by zheka »

May I bring up the old topic again, friends?
I came accross this cacti plugin to graph MySQL and felt my hands itching trying to implement it. But alas, my graphs come blank.

I might be asking the question that was answered. I'm trying to graph MySQL 5.0 and my graphs show only CPU Usage and Load Average of MySQL server.

Should it be specific problem with php and MySQL 5 or I have something misconfigured?

I'm trying to connect to the MySQL server in question using root credentials so I belive the question of granting privileges is not an issue ?

And I did export necessary xml templates following readme.txt to match with my poller that makes queries every 5 minutes.

Sincerely
Eugene
myfreeke
Cacti User
Posts: 82
Joined: Tue Dec 04, 2007 10:24 pm

Post by myfreeke »

I monitor MYSQL no work


error log following:

[root@cacti bin]# ./spine --verbosity=5 154 154
SPINE: Using spine config file [../etc/spine.conf]
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'path_webroot''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'path_cactilog''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The path_php_server variable is /usr/local/apache/htdocs/cacti/script_server.php
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The path_cactilog variable is /usr/local/apache/htdocs/cacti/log/cacti.log
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'log_destination''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The log_destination variable is 2 (BOTH)
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'path_php_binary''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The path_php variable is /usr/bin/php
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'availability_method''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The availability_method variable is 2
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'ping_recovery_count''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The ping_recovery_count variable is 3
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'ping_failure_count''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The ping_failure_count variable is 2
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'ping_method''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The ping_method variable is 1
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'ping_retries''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The ping_retries variable is 1
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'ping_timeout''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The ping_timeout variable is 500
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'log_perror''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The log_perror variable is 1
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'log_pwarn''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The log_pwarn variable is 1
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'log_pstats''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The log_pstats variable is 1
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'max_threads''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The threads variable is 1
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'poller_interval''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The polling interval is 300 seconds
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'concurrent_processes''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The number of concurrent processes is 2
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'script_timeout''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The script timeout is 25
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'php_servers''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The number of php script servers to run is 1
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT action FROM poller_item WHERE action=2 AND host_id BETWEEN 154 AND 154 LIMIT 1'
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: StartHost='154', EndHost='154', TotalPHPScripts='0'
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The PHP Script Server is Not Required
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT value FROM settings WHERE name = 'max_get_size''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The Maximum SNMP OID Get Size is 10
12/28/2007 04:21:15 PM - SPINE: Poller[0] Version 0.8.7b starting
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: MySQL is Thread Safe!
12/28/2007 04:21:15 PM - SPINE: Poller[0] SPINE: Initializing Net-SNMP API
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SNMP Header Version is 5.1.2
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SNMP Library Version is 5.1.2
12/28/2007 04:21:15 PM - SPINE: Poller[0] SPINE: Initializing PHP Script Server(s)
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT id FROM host WHERE disabled='' AND id BETWEEN 154 AND 154 ORDER BY id'
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: Initial Value of Active Threads is 0
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: Valid Thread to be Created
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The Value of Active Threads is 1
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: In Poller, About to Start Polling of Host
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT snmp_port, count(snmp_port) FROM poller_item WHERE host_id=0 AND rrd_next_step < 0 GROUP BY snmp_port'
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT action, hostname, snmp_community, snmp_version, snmp_username, snmp_password, rrd_name, rrd_path, arg1, arg2, arg3, local_data_id, rrd_num, snmp_port, snmp_timeout, snmp_auth_protocol, snmp_priv_passphrase, snmp_priv_protocol, snmp_context FROM poller_item WHERE host_id=0 and rrd_next_step <=0 ORDER by snmp_port'
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'UPDATE poller_item SET rrd_next_step=rrd_next_step-300 WHERE host_id=0'
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'UPDATE poller_item SET rrd_next_step=rrd_step-300 WHERE rrd_next_step < 0 and host_id=0'
12/28/2007 04:21:15 PM - SPINE: Poller[0] Host[0] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The Value of Active Threads is 0
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: Valid Thread to be Created
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: The Value of Active Threads is 1
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: In Poller, About to Start Polling of Host
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT id, hostname, snmp_community, snmp_version, snmp_username, snmp_password, snmp_auth_protocol, snmp_priv_passphrase, snmp_priv_protocol, snmp_context, snmp_port, snmp_timeout, max_oids, availability_method, ping_method, ping_port, ping_timeout, ping_retries, status, status_event_count, status_fail_date, status_rec_date, status_last_error, min_time, max_time, cur_time, avg_time, total_polls, failed_polls, availability FROM host WHERE id=154'
12/28/2007 04:21:15 PM - SPINE: Poller[0] Host[154] SNMP Result: Host responded to SNMP
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'UPDATE host SET status='3', status_event_count='0', status_fail_date='0000-00-00 00:00:00', status_rec_date='0000-00-00 00:00:00', status_last_error='', min_time='0.288010', max_time='9.148840', cur_time='0.437970', avg_time='0.692615', total_polls='23', failed_polls='0', availability='100.0000' WHERE id='154''
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT data_query_id, action, op, assert_value, arg1 FROM poller_reindex WHERE host_id=154'
12/28/2007 04:21:15 PM - SPINE: Poller[0] Host[154] Host has no information for recache.
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT snmp_port, count(snmp_port) FROM poller_item WHERE host_id=154 AND rrd_next_step < 0 GROUP BY snmp_port'
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'SELECT action, hostname, snmp_community, snmp_version, snmp_username, snmp_password, rrd_name, rrd_path, arg1, arg2, arg3, local_data_id, rrd_num, snmp_port, snmp_timeout, snmp_auth_protocol, snmp_priv_passphrase, snmp_priv_protocol, snmp_context FROM poller_item WHERE host_id=154 and rrd_next_step <=0 ORDER by snmp_port'
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'UPDATE poller_item SET rrd_next_step=rrd_next_step-300 WHERE host_id=154'
12/28/2007 04:21:15 PM - SPINE: Poller[0] DEBUG: SQL:'UPDATE poller_item SET rrd_next_step=rrd_step-300 WHERE rrd_next_step < 0 and host_id=154'
12/28/2007 04:21:15 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:15 PM - SPINE: Poller[0] Host[154] DS[2840] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:15 PM - SPINE: Poller[0] Host[154] DS[2840] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php teindexusage 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:15 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2841] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2841] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php innodb 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2842] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2842] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php innodb 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2843] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2843] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php innodb 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2844] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2844] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php innodb 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2845] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2845] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php innodb 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2849] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2849] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php telockingandslow 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2850] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2850] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php tenetwork 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2851] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2851] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php command 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2852] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2852] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php handler 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2853] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2853] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php tequerycache 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2854] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DS[2854] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php tereplication 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:16 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2855] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2855] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php teselecthandler 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2856] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2856] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php teselectquery 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2857] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2857] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php tesorts 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2858] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2858] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php tetempobjects 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2859] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2859] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php tethreadsabends 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2860] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2860] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php tevolatilehandler 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DEBUG: The POPEN returned the following File Descriptor 7
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2861] WARNING: Result from SCRIPT not valid. Partial Result: ...
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2861] SCRIPT: /usr/bin/php -q /usr/local/apache/htdocs/cacti/scripts/mysql_stats.php tevolatilequery 10.167.26.3 cacti cacti, output: U
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2837] SNMP: v2: 10.167.26.3, dsname: cpu_nice, oid: .1.3.6.1.4.1.2021.11.51.0, value: 506
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2838] SNMP: v2: 10.167.26.3, dsname: cpu_system, oid: .1.3.6.1.4.1.2021.11.52.0, value: 1991967
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2839] SNMP: v2: 10.167.26.3, dsname: cpu_user, oid: .1.3.6.1.4.1.2021.11.50.0, value: 21067590
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2846] SNMP: v2: 10.167.26.3, dsname: loadavg_1, oid: .1.3.6.1.4.1.2021.10.1.3.1, value: 0.13
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2847] SNMP: v2: 10.167.26.3, dsname: loadavg_15, oid: .1.3.6.1.4.1.2021.10.1.3.3, value: 0.07
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DS[2848] SNMP: v2: 10.167.26.3, dsname: loadavg_5, oid: .1.3.6.1.4.1.2021.10.1.3.2, value: 0.06
12/28/2007 04:21:17 PM - SPINE: Poller[0] DEBUG: SQL:'INSERT INTO poller_output (local_data_id, rrd_name, time, output) VALUES (2837,'cpu_nice','2007-12-28 16:21:15','506'),(2838,'cpu_system','2007-12-28 16:21:15','1991967'),(2839,'cpu_user','2007-12-28 16:21:15','21067590'),(2840,'','2007-12-28 16:21:15','U'),(2841,'','2007-12-28 16:21:15','U'),(2842,'','2007-12-28 16:21:15','U'),(2843,'','2007-12-28 16:21:15','U'),(2844,'','2007-12-28 16:21:15','U'),(2845,'','2007-12-28 16:21:15','U'),(2846,'loadavg_1','2007-12-28 16:21:15','0.13'),(2847,'loadavg_15','2007-12-28 16:21:15','0.07'),(2848,'loadavg_5','2007-12-28 16:21:15','0.06'),(2849,'','2007-12-28 16:21:15','U'),(2850,'','2007-12-28 16:21:15','U'),(2851,'','2007-12-28 16:21:15','U'),(2852,'','2007-12-28 16:21:15','U'),(2853,'','2007-12-28 16:21:15','U'),(2854,'','2007-12-28 16:21:15','U'),(2855,'','2007-12-28 16:21:15','U'),(2856,'','2007-12-28 16:21:15','U'),(2857,'','2007-12-28 16:21:15','U'),(2858,'','2007-12-28 16:21:15','U'),(2859,'','2007-12-28 16:21:15','U'),(2860,'','2007-12-28 16:21:15','U'),(2861,'''
12/28/2007 04:21:17 PM - SPINE: Poller[0] Host[154] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function
12/28/2007 04:21:17 PM - SPINE: Poller[0] DEBUG: The Value of Active Threads is 0
12/28/2007 04:21:17 PM - SPINE: Poller[0] DEBUG: SQL:'replace into settings (name,value) values ('date',NOW())'
12/28/2007 04:21:17 PM - SPINE: Poller[0] DEBUG: SQL:'insert into poller_time (poller_id, start_time, end_time) values (0, NOW(), NOW())'
12/28/2007 04:21:17 PM - SPINE: Poller[0] DEBUG: Thread Cleanup Complete
12/28/2007 04:21:17 PM - SPINE: Poller[0] DEBUG: PHP Script Server Pipes Closed
12/28/2007 04:21:17 PM - SPINE: Poller[0] DEBUG: Allocated Variable Memory Freed
12/28/2007 04:21:17 PM - SPINE: Poller[0] SPINE: Net-SNMP API Shutdown Completed
12/28/2007 04:21:17 PM - SPINE: Poller[0] DEBUG: MYSQL Free & Close Completed
12/28/2007 04:21:17 PM - SPINE: Poller[0] Time: 2.3324 s, Threads: 1, Hosts: 2
myfreeke
Cacti User
Posts: 82
Joined: Tue Dec 04, 2007 10:24 pm

Post by myfreeke »

It's ok now
I add follow in file mysql_stats.php
$host = 'localhost';
$username = "cacti";
$password = "cacti";
rbecker
Posts: 26
Joined: Mon Feb 12, 2007 6:17 pm
Location: Bay Area, CA

Post by rbecker »

Hmm. I went and downloaded the latest version of this from the web page (20060810), went to follow the instructions in the readme, and the GRANT PROCESS statement doesn't work for me:

mysql> GRANT PROCESS ON * TO cactiuser@'localhost' IDENTIFIED by 'cactipassword';
ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES


The "GRANT SUPER" worked just fine.

(username & passwd changed to protect the innocent)

The mysql installed is version 4.1.20, default with RHEL 4 update 5.

Is there a particular version of mysql this requires?

--Ross
aboyz
Cacti User
Posts: 56
Joined: Fri Jan 18, 2008 7:09 pm

Can you manaully do mysql query?

Post by aboyz »

Hi,

Anyone know how to add in your very own query? I want to monitor this. How would I go doing this. Can someone give me an example>?

select count(*) from whos_online WHERE customer_id = 0" -s -s oscom

total number of guests currently on the site

Any help will be appreiicated.!!
thanks
kamina
Posts: 28
Joined: Tue Aug 22, 2006 3:19 am

Post by kamina »

Maby I'm dumb, but how do I set the mysql servers port? I have several mysql hosts, each one listens to a different port... This uses the default port?
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

kamina wrote:Maby I'm dumb, but how do I set the mysql servers port? I have several mysql hosts, each one listens to a different port... This uses the default port?
Hi

IMO you'll have to :
  • modify the scripts/mysql_stats.php script to add something like this

    Code: Select all

    $port = $_SERVER["argv"][5];
    and

    Code: Select all

    if (@mysql_connect($host:$port, $username, $password)) {
    (you should also modify the test on argc value)
  • modify the TeMySQL data input methods

    Code: Select all

    <path_php_binary> -q <path_cacti>/scripts/mysql_stats.php innodb <hostname> <username> <password> <port>
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
kamina
Posts: 28
Joined: Tue Aug 22, 2006 3:19 am

Post by kamina »

Thanks!

Would I also need to add a new input field for port? I guess it should query it at some point when adding a new host?
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

You're right, you must also add an input field.

I guess you'll be able to enter it when adding MySQL graphs to a host.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
doughairfield
Posts: 20
Joined: Wed Feb 20, 2008 1:57 pm

Memcache graphs empty

Post by doughairfield »

My graphs for the memcached poller are empty.
When I run the script directly from the command line I get this:
Fatal error: Class 'Memcache' not found in /usr/local/apache2/htdocs/cacti/scripts/dumpMemcachedStats.php on line 8

Something I don't have compiled in PHP?
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests