Introduction
mysql-rrdtool.pl's config format is a perl hash. with a few simple defined keys.
Example
$config = {
hosts => {
host_id => {
host => 'localhost',
port => 3306,
user => 'root',
pass => 'mysqlpass',
# doesn't matter what, just has to exist and be accessible by user
database => 'mysql',
master => 'master_host_id',
},
},
interval => 60,
directory => '.',
};Details
Top Level
- hosts - a hash reference. key/host_id will become the rrd filename, see Hosts below
- interval - number of seconds between each polling, default 60
- directory - the directory in which the rrd files will be stored, default is '.'
- user - a user to use for auth on all databases, overridden by host user, default is 'stats'
- pass - a pass to use for auth on all databases, overridden by host pass
- fields - a list of fields to poll for all databases, see Fields overridden by host fields
Hosts
- host - hostname for this host, default is localhost
- port - port on this host, default is 3306
- user - username to use for this host, default is 'stats'
- pass - password to use for this host
- database - database to use on this host, default is 'mysql'
- master - host_id of the master of this database, for replication monitoring, default none
- fields - a list of fields to poll on this host, see Fields
Fields
Default
- Aborted_connects
- Bytes_received
- Bytes_sent
- Com_commit
- Com_delete
- Com_insert
- Com_rollback
- Com_select
- Com_update
- Connections
- Created_tmp_disk_tables
- Created_tmp_tables
- Prepared_stmt_count
- Questions
- Slow_queries
- Threads_connected
All
- General - See http://dev.mysql.com/doc/refman/5.0/en/server-status-variables.html for details
- Aborted_clients
- Aborted_connects
- Binlog_cache_disk_use
- Binlog_cache_use
- Bytes_received
- Bytes_sent
- Com_admin_commands
- Com_alter_db
- Com_alter_table
- Com_analyze
- Com_backup_table
- Com_begin
- Com_call_procedure
- Com_change_db
- Com_change_master
- Com_check
- Com_checksum
- Com_commit
- Com_create_db
- Com_create_function
- Com_create_index
- Com_create_table
- Com_create_user
- Com_dealloc_sql
- Com_delete
- Com_delete_multi
- Com_do
- Com_drop_db
- Com_drop_function
- Com_drop_index
- Com_drop_table
- Com_drop_user
- Com_execute_sql
- Com_flush
- Com_grant
- Com_ha_close
- Com_ha_open
- Com_ha_read
- Com_help
- Com_insert
- Com_insert_select
- Com_kill
- Com_load
- Com_load_master_data
- Com_load_master_table
- Com_lock_tables
- Com_optimize
- Com_preload_keys
- Com_prepare_sql
- Com_purge
- Com_purge_before_date
- Com_rename_table
- Com_repair
- Com_replace
- Com_replace_select
- Com_reset
- Com_restore_table
- Com_revoke
- Com_revoke_all
- Com_rollback
- Com_savepoint
- Com_select
- Com_set_option
- Com_show_binlog_events
- Com_show_binlogs
- Com_show_charsets
- Com_show_collations
- Com_show_column_types
- Com_show_create_db
- Com_show_create_table
- Com_show_databases
- Com_show_errors
- Com_show_fields
- Com_show_grants
- Com_show_innodb_status
- Com_show_keys
- Com_show_logs
- Com_show_master_status
- Com_show_ndb_status
- Com_show_new_master
- Com_show_open_tables
- Com_show_privileges
- Com_show_processlist
- Com_show_slave_hosts
- Com_show_slave_status
- Com_show_status
- Com_show_storage_engines
- Com_show_tables
- Com_show_triggers
- Com_show_variables
- Com_show_warnings
- Com_slave_start
- Com_slave_stop
- Com_stmt_close
- Com_stmt_execute
- Com_stmt_fetch
- Com_stmt_prepare
- Com_stmt_reset
- Com_stmt_send_long_data
- Com_truncate
- Com_unlock_tables
- Com_update
- Com_update_multi
- Com_xa_commit
- Com_xa_end
- Com_xa_prepare
- Com_xa_recover
- Com_xa_rollback
- Com_xa_start
- Compression
- Connections
- Created_tmp_disk_tables
- Created_tmp_files
- Created_tmp_tables
- Delayed_errors
- Delayed_insert_threads
- Delayed_writes
- Flush_commands
- Handler_commit
- Handler_delete
- Handler_discover
- Handler_prepare
- Handler_read_first
- Handler_read_key
- Handler_read_next
- Handler_read_prev
- Handler_read_rnd
- Handler_read_rnd_next
- Handler_rollback
- Handler_savepoint
- Handler_savepoint_rollback
- Handler_update
- Handler_write
- Innodb_buffer_pool_pages_data
- Innodb_buffer_pool_pages_dirty
- Innodb_buffer_pool_pages_flushed
- Innodb_buffer_pool_pages_free
- Innodb_buffer_pool_pages_latched
- Innodb_buffer_pool_pages_misc
- Innodb_buffer_pool_pages_total
- Innodb_buffer_pool_read_ahead_rnd
- Innodb_buffer_pool_read_ahead_seq
- Innodb_buffer_pool_read_requests
- Innodb_buffer_pool_reads
- Innodb_buffer_pool_wait_free
- Innodb_buffer_pool_write_requests
- Innodb_data_fsyncs
- Innodb_data_pending_fsyncs
- Innodb_data_pending_reads
- Innodb_data_pending_writes
- Innodb_data_read
- Innodb_data_reads
- Innodb_data_writes
- Innodb_data_written
- Innodb_dblwr_pages_written
- Innodb_dblwr_writes
- Innodb_log_waits
- Innodb_log_write_requests
- Innodb_log_writes
- Innodb_os_log_fsyncs
- Innodb_os_log_pending_fsyncs
- Innodb_os_log_pending_writes
- Innodb_os_log_written
- Innodb_page_size
- Innodb_pages_created
- Innodb_pages_read
- Innodb_pages_written
- Innodb_row_lock_current_waits
- Innodb_row_lock_time
- Innodb_row_lock_time_avg
- Innodb_row_lock_time_max
- Innodb_row_lock_waits
- Innodb_rows_deleted
- Innodb_rows_inserted
- Innodb_rows_read
- Innodb_rows_updated
- Key_blocks_not_flushed
- Key_blocks_unused
- Key_blocks_used
- Key_read_requests
- Key_reads
- Key_write_requests
- Key_writes
- Last_query_cost
- Max_used_connections
- Ndb_cluster_node_id
- Ndb_config_from_host
- Ndb_config_from_port
- Ndb_number_of_data_nodes
- Not_flushed_delayed_rows
- Open_files
- Open_streams
- Open_tables
- Opened_tables
- Prepared_stmt_count
- Qcache_free_blocks
- Qcache_free_memory
- Qcache_hits
- Qcache_inserts
- Qcache_lowmem_prunes
- Qcache_not_cached
- Qcache_queries_in_cache
- Qcache_total_blocks
- Questions
- Rpl_status
- Select_full_join
- Select_full_range_join
- Select_range
- Select_range_check
- Select_scan
- Slave_open_temp_tables
- Slave_retried_transactions
- Slave_running
- Slow_launch_threads
- Slow_queries
- Sort_merge_passes
- Sort_range
- Sort_rows
- Sort_scan
- Ssl_accept_renegotiates
- Ssl_accepts
- Ssl_callback_cache_hits
- Ssl_cipher
- Ssl_cipher_list
- Ssl_client_connects
- Ssl_connect_renegotiates
- Ssl_ctx_verify_depth
- Ssl_ctx_verify_mode
- Ssl_default_timeout
- Ssl_finished_accepts
- Ssl_finished_connects
- Ssl_session_cache_hits
- Ssl_session_cache_misses
- Ssl_session_cache_mode
- Ssl_session_cache_overflows
- Ssl_session_cache_size
- Ssl_session_cache_timeouts
- Ssl_sessions_reused
- Ssl_used_session_cache_entries
- Ssl_verify_depth
- Ssl_verify_mode
- Ssl_version
- Table_locks_immediate
- Table_locks_waited
- Tc_log_max_pages_used
- Tc_log_page_size
- Tc_log_page_waits
- Threads_cached
- Threads_connected
- Threads_created
- Threads_running
- Uptime
- Uptime_since_flush_status
- Replication
- Master_position - the bin-log position of the master, not that useful
- Slave_read_position - the bin-log position read up to by the slave, not that useful
- Slave_exec_position - the bin-log position executied up to by the slave, not that useful
- Slave_seconds_behind - (be careful) the number of seconds the slave is behind the master, there's a lot of caveats on this one, look at mysql docs, generally its not useful
- Slave_read_behind - bin-log positions the slave's read process is behind the master, is reading keeping up, useful.
- Slave_exec_behind_read - bin-log positions the slave's exec process is behind the read process, is executing keeping up, useful.
- Slave_exec_behind_master - bin-log positions the slave's exec process is behind the master, how far behind is the slave from the master, useful.
- Slave_io_running - 1 means io process is running, 0 means failure/stopped
- Slave_sql_running - 1 means sql process is running, 0 means failure/stopped