Monitoring MySQL

From OpenNMS
Jump to: navigation, search

Here you will find the Fileentrys for monitoring MySQL 4.0.27


capsd-configuration.xml

<?xml version="1.0"?>
<!-- 24 hours -->
<capsd-configuration
        rescan-frequency="86400000"
        initial-sleep-time="30000"
        management-policy="managed"
        max-suspect-thread-pool-size="6"
    max-rescan-thread-pool-size="3"
    abort-protocol-scans-if-no-route="false"
    delete-propagation-enabled="true"
    xmlrpc="false">
   <protocol-plugin protocol="MySQL-4" class-name="org.opennms.netmgt.capsd.plugins.HttpPlugin"  scan="on" user-defined="false">
       <property key="port" value="80" />
       <property key="timeout" value="3000" />
       <property key="retry" value="2" />
       <property key="url" value="/mysql-status/" />
   </protocol-plugin>
</capsd-configuration>


http-datacollection-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<http-datacollection-config
        xmlns:http-dc="http://xmlns.opennms.org/xsd/config/http-datacollection"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://xmlns.opennms.org/xsd/config/http-datacollection http://www.opennms.org/xsd/config/http-datacollection-config.xsd"
        rrdRepository="/usr/share/opennms/share/rrd/snmp/" >
        <http-collection name="MySQL-4">
                <rrd step="300">
                        <rra>RRA:AVERAGE:0.5:1:8928</rra>
                        <rra>RRA:AVERAGE:0.5:12:8784</rra>
                        <rra>RRA:MIN:0.5:12:8784</rra>
                        <rra>RRA:MAX:0.5:12:8784</rra>
                </rrd>
                <uris>
                        <uri name="mysql">
                                <url    path="/mysql-status/index.php"
                                        user-agent="Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/412 (KHTML, like Gecko) Safari/412"
                                        matches="(?s).*Aborted_clients:\s([0-9]+).*Aborted_connects:\s([0-9]+).*Bytes_received:\s([0-9]+).*Bytes_sent:\s([0-9]+).*Com_admin_commands:\s([0-9]+).*Com_alter_table:\s([0-9]+).*Com_analyze:\s([0-9]+).*Com_backup_table:\s([0-9]+).*Com_begin:\s([0-9]+).*Com_change_db:\s([0-9]+).*Com_change_master:\s([0-9]+).*Com_check:\s([0-9]+).*Com_commit:\s([0-9]+).*Com_create_db:\s([0-9]+).*Com_create_function:\s([0-9]+).*Com_create_index:\s([0-9]+).*Com_create_table:\s([0-9]+).*Com_delete:\s([0-9]+).*Com_delete_multi:\s([0-9]+).*Com_drop_db:\s([0-9]+).*Com_drop_function:\s([0-9]+).*Com_drop_index:\s([0-9]+).*Com_drop_table:\s([0-9]+).*Com_flush:\s([0-9]+).*Com_grant:\s([0-9]+).*Com_ha_close:\s([0-9]+).*Com_ha_open:\s([0-9]+).*Com_ha_read:\s([0-9]+).*Com_insert:\s([0-9]+).*Com_insert_select:\s([0-9]+).*Com_kill:\s([0-9]+).*Com_load:\s([0-9]+).*Com_load_master_data:\s([0-9]+).*Com_load_master_table:\s([0-9]+).*Com_lock_tables:\s([0-9]+).*Com_optimize:\s([0-9]+).*Com_purge:\s([0-9]+).*Com_rename_table:\s([0-9]+).*Com_repair:\s([0-9]+).*Com_replace:\s([0-9]+).*Com_replace_select:\s([0-9]+).*Com_reset:\s([0-9]+).*Com_restore_table:\s([0-9]+).*Com_revoke:\s([0-9]+).*Com_rollback:\s([0-9]+).*Com_savepoint:\s([0-9]+).*Com_select:\s([0-9]+).*Com_set_option:\s([0-9]+).*Com_show_binlog_events:\s([0-9]+).*Com_show_binlogs:\s([0-9]+).*Com_show_create:\s([0-9]+).*Com_show_databases:\s([0-9]+).*Com_show_fields:\s([0-9]+).*Com_show_grants:\s([0-9]+).*Com_show_innodb_status:\s([0-9]+).*Com_show_keys:\s([0-9]+).*Com_show_logs:\s([0-9]+).*Com_show_master_status:\s([0-9]+).*Com_show_new_master:\s([0-9]+).*Com_show_open_tables:\s([0-9]+).*Com_show_processlist:\s([0-9]+).*Com_show_slave_hosts:\s([0-9]+).*Com_show_slave_status:\s([0-9]+).*Com_show_status:\s([0-9]+).*Com_show_tables:\s([0-9]+).*Com_show_variables:\s([0-9]+).*Com_slave_start:\s([0-9]+).*Com_slave_stop:\s([0-9]+).*Com_truncate:\s([0-9]+).*Com_unlock_tables:\s([0-9]+).*Com_update:\s([0-9]+).*Com_update_multi:\s([0-9]+).*Connections:\s([0-9]+).*Created_tmp_disk_tables:\s([0-9]+).*Created_tmp_files:\s([0-9]+).*Created_tmp_tables:\s([0-9]+).*Delayed_errors:\s([0-9]+).*Delayed_insert_threads:\s([0-9]+).*Delayed_writes:\s([0-9]+).*Flush_commands:\s([0-9]+).*Handler_commit:\s([0-9]+).*Handler_delete:\s([0-9]+).*Handler_read_first:\s([0-9]+).*Handler_read_key:\s([0-9]+).*Handler_read_next:\s([0-9]+).*Handler_read_prev:\s([0-9]+).*Handler_read_rnd:\s([0-9]+).*Handler_read_rnd_next:\s([0-9]+).*Handler_rollback:\s([0-9]+).*Handler_update:\s([0-9]+).*Handler_write:\s([0-9]+).*Key_blocks_used:\s([0-9]+).*Key_read_requests:\s([0-9]+).*Key_reads:\s([0-9]+).*Key_write_requests:\s([0-9]+).*Key_writes:\s([0-9]+).*Max_used_connections:\s([0-9]+).*Not_flushed_delayed_rows:\s([0-9]+).*Not_flushed_key_blocks:\s([0-9]+).*Open_files:\s([0-9]+).*Open_streams:\s([0-9]+).*Open_tables:\s([0-9]+).*Opened_tables:\s([0-9]+).*Qcache_free_blocks:\s([0-9]+).*Qcache_free_memory:\s([0-9]+).*Qcache_hits:\s([0-9]+).*Qcache_inserts:\s([0-9]+).*Qcache_lowmem_prunes:\s([0-9]+).*Qcache_not_cached:\s([0-9]+).*Qcache_queries_in_cache:\s([0-9]+).*Qcache_total_blocks:\s([0-9]+).*Select_full_join:\s([0-9]+).*Select_full_range_join:\s([0-9]+).*Select_range:\s([0-9]+).*Select_range_check:\s([0-9]+).*Select_scan:\s([0-9]+).*Slave_open_temp_tables:\s([0-9]+).*Slow_launch_threads:\s([0-9]+).*Slow_queries:\s([0-9]+).*Sort_merge_passes:\s([0-9]+).*Sort_range:\s([0-9]+).*Sort_rows:\s([0-9]+).*Sort_scan:\s([0-9]+).*Table_locks_immediate:\s([0-9]+).*Table_locks_waited:\s([0-9]+).*Threads_cached:\s([0-9]+).*Threads_connected:\s([0-9]+).*Threads_created:\s([0-9]+).*Threads_running:\s([0-9]+).*Uptime:\s([0-9]+).*"
                                        response-range="100-399" >
                                </url>
                                <attributes>
                                        <attrib alias="AbortedClients"          match-group="1"  type="gauge32"/>
                                        <attrib alias="AbortedConnects"         match-group="2"  type="gauge32"/>
                                        <attrib alias="BytesReceived"           match-group="3"  type="gauge32"/>
                                        <attrib alias="BytesSent"               match-group="4"  type="gauge32"/>
                                        <attrib alias="ComAdminCommands"        match-group="5"  type="gauge32"/>
                                        <attrib alias="ComAlterTable"           match-group="6"  type="gauge32"/>
                                        <attrib alias="ComAnalyze"              match-group="7"  type="gauge32"/>
                                        <attrib alias="ComBackupTable"          match-group="8"  type="gauge32"/>
                                        <attrib alias="ComBegin"                match-group="9"  type="gauge32"/>
                                        <attrib alias="ComChangeDB"             match-group="10"  type="gauge32"/>
                                        <attrib alias="ComChangeMaster"         match-group="11"  type="gauge32"/>
                                        <attrib alias="ComCheck"                match-group="12"  type="gauge32"/>
                                        <attrib alias="ComCommit"               match-group="13"  type="gauge32"/>
                                        <attrib alias="ComCreateDB"             match-group="14"  type="gauge32"/>
                                        <attrib alias="ComCreateFunction"       match-group="15"  type="gauge32"/>
                                        <attrib alias="ComCreateIndex"          match-group="16"  type="gauge32"/>
                                        <attrib alias="ComCreateTable"          match-group="17"  type="gauge32"/>
                                        <attrib alias="ComDelete"               match-group="18"  type="gauge32"/>
                                        <attrib alias="ComDeleteMulti"          match-group="19"  type="gauge32"/>
                                        <attrib alias="ComDropDB"               match-group="20"  type="gauge32"/>
                                        <attrib alias="ComDropFunction"         match-group="21"  type="gauge32"/>
                                        <attrib alias="ComDropIndex"            match-group="22"  type="gauge32"/>
                                        <attrib alias="ComDropTable"            match-group="23"  type="gauge32"/>
                                        <attrib alias="ComFlush"                match-group="24"  type="gauge32"/>
                                        <attrib alias="ComGrant"                match-group="25"  type="gauge32"/>
                                        <attrib alias="ComHAclose"              match-group="26"  type="gauge32"/>
                                        <attrib alias="ComHAopen"               match-group="27"  type="gauge32"/>
                                        <attrib alias="ComHAread"               match-group="28"  type="gauge32"/>
                                        <attrib alias="ComInsert"               match-group="29"  type="gauge32"/>
                                        <attrib alias="ComInsertSelect"         match-group="30"  type="gauge32"/>
                                        <attrib alias="ComKill"                 match-group="31"  type="gauge32"/>
                                        <attrib alias="ComLoad"                 match-group="32"  type="gauge32"/>
                                        <attrib alias="ComLoadMasterData"       match-group="33"  type="gauge32"/>
                                        <attrib alias="ComLoadMasterTable"      match-group="34"  type="gauge32"/>
                                        <attrib alias="ComLockTables"           match-group="35"  type="gauge32"/>
                                        <attrib alias="ComOptimize"             match-group="36"  type="gauge32"/>
                                        <attrib alias="ComPurge"                match-group="37"  type="gauge32"/>
                                        <attrib alias="ComRenameTable"          match-group="38"  type="gauge32"/>
                                        <attrib alias="ComRepair"               match-group="39"  type="gauge32"/>
                                        <attrib alias="ComReplace"              match-group="40"  type="gauge32"/>
                                        <attrib alias="ComReplaceSelect"        match-group="41"  type="gauge32"/>
                                        <attrib alias="ComReset"                match-group="42"  type="gauge32"/>
                                        <attrib alias="ComRestoreTable"         match-group="43"  type="gauge32"/>
                                        <attrib alias="ComRevoke"               match-group="44"  type="gauge32"/>
                                        <attrib alias="ComRollback"             match-group="45"  type="gauge32"/>
                                        <attrib alias="ComSavepoint"            match-group="46"  type="gauge32"/>
                                        <attrib alias="ComSelect"               match-group="47"  type="gauge32"/>
                                        <attrib alias="ComSetOption"            match-group="48"  type="gauge32"/>
                                        <attrib alias="ComShowBinlogEvents"     match-group="49"  type="gauge32"/>
                                        <attrib alias="ComShowBinlogs"          match-group="50"  type="gauge32"/>
                                        <attrib alias="ComShowCreate"           match-group="51"  type="gauge32"/>
                                        <attrib alias="ComShowDatabases"        match-group="52"  type="gauge32"/>
                                        <attrib alias="ComShowFields"           match-group="53"  type="gauge32"/>
                                        <attrib alias="ComShowGrants"           match-group="54"  type="gauge32"/>
                                        <attrib alias="ComShowInnodbStatus"     match-group="55"  type="gauge32"/>
                                        <attrib alias="ComShowKeys"             match-group="56"  type="gauge32"/>
                                        <attrib alias="ComShowLogs"             match-group="57"  type="gauge32"/>
                                        <attrib alias="ComShowMasterStatus"     match-group="58"  type="gauge32"/>
                                        <attrib alias="ComShowNewMaster"        match-group="59"  type="gauge32"/>
                                        <attrib alias="ComShowOpenTables"       match-group="60"  type="gauge32"/>
                                        <attrib alias="ComShowProcesslist"      match-group="61"  type="gauge32"/>
                                        <attrib alias="ComShowSlaveHosts"       match-group="62"  type="gauge32"/>
                                        <attrib alias="ComShowSlaveStatus"      match-group="63"  type="gauge32"/>
                                        <attrib alias="ComShowStatus"           match-group="64"  type="gauge32"/>
                                        <attrib alias="ComShowTables"           match-group="65"  type="gauge32"/>
                                        <attrib alias="ComShowVariables"        match-group="66"  type="gauge32"/>
                                        <attrib alias="ComSlaveStart"           match-group="67"  type="gauge32"/>
                                        <attrib alias="ComSlaveStop"            match-group="68"  type="gauge32"/>
                                        <attrib alias="ComTruncate"             match-group="69"  type="gauge32"/>
                                        <attrib alias="ComUnlockTables"         match-group="70"  type="gauge32"/>
                                        <attrib alias="ComUpdate"               match-group="71"  type="gauge32"/>
                                        <attrib alias="ComUpdateMulti"          match-group="72"  type="gauge32"/>
                                        <attrib alias="Connections"             match-group="73"  type="gauge32"/>
                                        <attrib alias="CreatedTmpDskTables"     match-group="74"  type="gauge32"/>
                                        <attrib alias="CreatedTmpFiles"         match-group="75"  type="gauge32"/>
                                        <attrib alias="CreatedTmpTables"        match-group="76"  type="gauge32"/>
                                        <attrib alias="DelayedErrors"           match-group="77"  type="gauge32"/>
                                        <attrib alias="DelayedInsThreads"       match-group="78"  type="gauge32"/>
                                        <attrib alias="DelayedWrites"           match-group="79"  type="gauge32"/>
                                        <attrib alias="FlushCommands"           match-group="80"  type="gauge32"/>
                                        <attrib alias="HandlerCommit"           match-group="81"  type="gauge32"/>
                                        <attrib alias="HandlerDelete"           match-group="82"  type="gauge32"/>
                                        <attrib alias="HandlerReadFirst"        match-group="83"  type="gauge32"/>
                                        <attrib alias="HandlerReadKey"          match-group="84"  type="gauge32"/>
                                        <attrib alias="HandlerReadNext"         match-group="85"  type="gauge32"/>
                                        <attrib alias="HandlerReadPrev"         match-group="86"  type="gauge32"/>
                                        <attrib alias="HandlerReadRnd"          match-group="87"  type="gauge32"/>
                                        <attrib alias="HandlerReadRndNext"      match-group="88"  type="gauge32"/>
                                        <attrib alias="HandlerRollback"         match-group="89"  type="gauge32"/>
                                        <attrib alias="HandlerUpdate"           match-group="90"  type="gauge32"/>
                                        <attrib alias="HandlerWrite"            match-group="91"  type="gauge32"/>
                                        <attrib alias="KeyBlocksUsed"           match-group="92"  type="gauge32"/>
                                        <attrib alias="KeyReadRequests"         match-group="93"  type="gauge32"/>
                                        <attrib alias="KeyReads"                match-group="94"  type="gauge32"/>
                                        <attrib alias="KeyWriteRequests"        match-group="95"  type="gauge32"/>
                                        <attrib alias="KeyWrites"               match-group="96"  type="gauge32"/>
                                        <attrib alias="MaxUsedConnections"      match-group="97"  type="gauge32"/>
                                        <attrib alias="NotFlushedDelayRows"     match-group="98"  type="gauge32"/>
                                        <attrib alias="NotFlushedKeyBlocks"     match-group="99"  type="gauge32"/>
                                        <attrib alias="OpenFiles"               match-group="100"  type="gauge32"/>
                                        <attrib alias="OpenStreams"             match-group="101"  type="gauge32"/>
                                        <attrib alias="OpenTables"              match-group="102"  type="gauge32"/>
                                        <attrib alias="OpenedTables"            match-group="103"  type="gauge32"/>
                                        <attrib alias="QcacheFreeBlocks"        match-group="104"  type="gauge32"/>
                                        <attrib alias="QcacheFreeMemory"        match-group="105"  type="gauge32"/>
                                        <attrib alias="QcacheHits"              match-group="106"  type="gauge32"/>
                                        <attrib alias="QcacheInserts"           match-group="107"  type="gauge32"/>
                                        <attrib alias="QcacheLowmemPrunes"      match-group="108"  type="gauge32"/>
                                        <attrib alias="QcacheNotCached"         match-group="109"  type="gauge32"/>
                                        <attrib alias="QcacheQuerieInCache"     match-group="110"  type="gauge32"/>
                                        <attrib alias="QcacheTotalBlocks"       match-group="111"  type="gauge32"/>
                                        <attrib alias="SelectFullJoin"          match-group="112"  type="gauge32"/>
                                        <attrib alias="SelectFullRangeJoin"     match-group="113"  type="gauge32"/>
                                        <attrib alias="SelectRange"             match-group="114"  type="gauge32"/>
                                        <attrib alias="SelectRangeCheck"        match-group="115"  type="gauge32"/>
                                        <attrib alias="SelectScan"              match-group="116"  type="gauge32"/>
                                        <attrib alias="SlaveOpenTempTables"     match-group="117"  type="gauge32"/>
                                        <attrib alias="SlowLaunchThreads"       match-group="118"  type="gauge32"/>
                                        <attrib alias="SlowQueries"             match-group="119"  type="gauge32"/>
                                        <attrib alias="SortMergePasses"         match-group="120"  type="gauge32"/>
                                        <attrib alias="SortRange"               match-group="121"  type="gauge32"/>
                                        <attrib alias="SortRows"                match-group="122"  type="gauge32"/>
                                        <attrib alias="SortScan"                match-group="123"  type="gauge32"/>
                                        <attrib alias="TableLocksImmediate"     match-group="124"  type="gauge32"/>
                                        <attrib alias="TableLocksWaited"        match-group="125"  type="gauge32"/>
                                        <attrib alias="ThreadsCached"           match-group="126"  type="gauge32"/>
                                        <attrib alias="ThreadsConnected"        match-group="127"  type="gauge32"/>
                                        <attrib alias="ThreadsCreated"          match-group="128"  type="gauge32"/>
                                        <attrib alias="ThreadsRunning"          match-group="129"  type="gauge32"/>
                                        <attrib alias="Uptime"                  match-group="130"  type="gauge32"/>
                                </attributes>
                        </uri>
                </uris>
        </http-collection>
</http-datacollection-config>

collectd-configuration.xml

<?xml version="1.0"?>
<?castor class-name="org.opennms.netmgt.collectd.CollectdConfiguration"?>
<collectd-configuration
        threads="50">
        <package name="example1">
                <filter>IPADDR != '0.0.0.0'</filter>
                <include-range begin="1.1.1.1" end="254.254.254.254"/>
                <service name="SNMP" interval="300000" user-defined="false" status="on">
                        <parameter key="collection" value="default"/>
                </service>
                <service name="MySQL-4" interval="300000" user-defined="false" status="on" >
                        <parameter key="http-collection" value="mysql-4" />
                        <parameter key="retry" value="1" />
                        <parameter key="timeout" value="2000" />
                </service>
        </package>
        <collector service="MySQL-4" class-name="org.opennms.netmgt.collectd.HttpCollector" />
        <collector service="SNMP"               class-name="org.opennms.netmgt.collectd.SnmpCollector" />
</collectd-configuration>


snmp-graph.properties



#########################################################################
## G E N E R A L   R E P O R T I N G   S E T T I N G S
#########################################################################

command.prefix=/usr/bin/rrdtool graph - --imgformat PNG  --font DEFAULT:7 --font TITLE:10 --start {startTime} --end {endTime}

#the command used to get the RRD info
info.command=/usr/bin/rrdtool info

#The default graph for KSC node and domain reports
default.report=mib2.HCbits

#the output type of the image, should correspond to the type we
#specified in the command.prefix variable
output.mime=image/png


#########################################################################
## P R E F A B   R E P O R T S
#########################################################################

# In order to get a report (defined below) to be automatically generated
# its name must be included in the "reports" variable.

# NOTE: Because of the large format of the netsnmp.memStats report it
#       has been placed before netsnmp.cpuStats so that it looks better.
#
# NOTE: Because of the large format of the netsnmp.cpuStats report, it
#       has been placed last so that it looks better. Everything else
#       should be in alphabetical order.

reports=mysql.AbortedClients,mysql.AbortedConnects,mysql.BinlogCacheDiskUse,mysql.BinlogCacheUse,mysql.BytesReceived, \
mysql.BytesSent,mysql.ComAdminCommands,mysql.ComAlterDb,mysql.ComAlterTable,mysql.ComAnalyze, \
mysql.ComBackupTable,mysql.ComBegin,mysql.ComChangeDb,mysql.ComChangeMaster,mysql.ComCheck, \
mysql.ComChecksum,mysql.ComCommit,mysql.ComCreateDb,mysql.ComCreateFunction,mysql.ComCreateIndex, \
mysql.ComCreateTable,mysql.ComCreateUser,mysql.ComDeallocSql,mysql.ComDelete,mysql.ComDeleteMulti, \
mysql.ComDo,mysql.ComDropDb,mysql.ComDropFunction,mysql.ComDropIndex,mysql.ComDropTable, \
mysql.ComDropUser,mysql.ComExecuteSql,mysql.ComFlush,mysql.ComGrant,mysql.ComHaClose, \
mysql.ComHaOpen,mysql.ComHaRead,mysql.ComHelp,mysql.ComInsert,mysql.ComInsertSelect, \
mysql.ComKill,mysql.ComLoad,mysql.ComLoadMasterData,mysql.ComLoadMasterTable,mysql.ComLockTables, \
mysql.ComOptimize,mysql.ComPreloadKeys,mysql.ComPrepareSql,mysql.ComPurge,mysql.ComPurgeBeforeDate, \
mysql.ComRenameTable,mysql.ComRepair,mysql.ComReplace,mysql.ComReplaceSelect,mysql.ComReset, \
mysql.ComRestoreTable,mysql.ComRevoke,mysql.ComRevokeAll,mysql.ComRollback,mysql.ComSavepoint, \
mysql.ComSelect,mysql.ComSetOption,mysql.ComShowBinlogEvents,mysql.ComShowBinlogs,mysql.ComShowCharsets, \
mysql.ComShowCollations,mysql.ComShowColumnTypes,mysql.ComShowCreateDb,mysql.ComShowCreateTable,mysql.ComShowDatabases, \
mysql.ComShowErrors,mysql.ComShowFields,mysql.ComShowGrants,mysql.ComShowInnodbStatus,mysql.ComShowKeys, \
mysql.ComShowLogs,mysql.ComShowMasterStatus,mysql.ComShowNdbStatus,mysql.ComShowNewMaster,mysql.ComShowOpenTables, \
mysql.ComShowPrivileges,mysql.ComShowProcesslist,mysql.ComShowSlaveHosts,mysql.ComShowSlaveStatus,mysql.ComShowStatus, \
mysql.ComShowStorageEngines,mysql.ComShowTables,mysql.ComShowTriggers,mysql.ComShowVariables,mysql.ComShowWarnings, \
mysql.ComSlaveStart,mysql.ComSlaveStop,mysql.ComStmtClose,mysql.ComStmtExecute,mysql.ComStmtFetch, \
mysql.ComStmtPrepare,mysql.ComStmtReset,mysql.ComStmtSendLongData,mysql.ComTruncate,mysql.ComUnlockTables, \
mysql.ComUpdate,mysql.ComUpdateMulti,mysql.ComXaCommit,mysql.ComXaEnd,mysql.ComXaPrepare, \
mysql.ComXaRecover,mysql.ComXaRollback,mysql.ComXaStart,mysql.Compression,mysql.Connections, \
mysql.CreatedTmpDiskTables,mysql.CreatedTmpFiles,mysql.CreatedTmpTables,mysql.DelayedErrors,mysql.DelayedInsertThreads, \
mysql.DelayedWrites,mysql.FlushCommands,mysql.HandlerCommit,mysql.HandlerDelete,mysql.HandlerDiscover, \
mysql.HandlerPrepare,mysql.HandlerReadFirst,mysql.HandlerReadKey,mysql.HandlerReadNext,mysql.HandlerReadPrev, \
mysql.HandlerReadRnd,mysql.HandlerReadRndNext,mysql.HandlerRollback,mysql.HandlerSavepoint,mysql.HandlerSavepointRollback, \
mysql.HandlerUpdate,mysql.HandlerWrite,mysql.InnodbBufferPoolPagesData,mysql.InnodbBufferPoolPagesDirty,mysql.InnodbBufferPoolPagesFlushed, \
mysql.InnodbBufferPoolPagesFree,mysql.InnodbBufferPoolPagesLatched,mysql.InnodbBufferPoolPagesMisc,mysql.InnodbBufferPoolPagesTotal,mysql.InnodbBufferPoolReadAheadRnd, \
mysql.InnodbBufferPoolReadAheadSeq,mysql.InnodbBufferPoolReadRequests,mysql.InnodbBufferPoolReads,mysql.InnodbBufferPoolWaitFree,mysql.InnodbBufferPoolWriteRequests, \
mysql.InnodbDataFsyncs,mysql.InnodbDataPendingFsyncs,mysql.InnodbDataPendingReads,mysql.InnodbDataPendingWrites,mysql.InnodbDataRead, \
mysql.InnodbDataReads,mysql.InnodbDataWrites,mysql.InnodbDataWritten,mysql.InnodbDblwrPagesWritten,mysql.InnodbDblwrWrites, \
mysql.InnodbLogWaits,mysql.InnodbLogWriteRequests,mysql.InnodbLogWrites,mysql.InnodbOsLogFsyncs,mysql.InnodbOsLogPendingFsyncs, \
mysql.InnodbOsLogPendingWrites,mysql.InnodbOsLogWritten,mysql.InnodbPageSize,mysql.InnodbPagesCreated,mysql.InnodbPagesRead, \
mysql.InnodbPagesWritten,mysql.InnodbRowLockCurrentWaits,mysql.InnodbRowLockTime,mysql.InnodbRowLockTimeAvg,mysql.InnodbRowLockTimeMax, \
mysql.InnodbRowLockWaits,mysql.InnodbRowsDeleted,mysql.InnodbRowsInserted,mysql.InnodbRowsRead,mysql.InnodbRowsUpdated, \
mysql.KeyBlocksNotFlushed,mysql.KeyBlocksUnused,mysql.KeyBlocksUsed,mysql.KeyReadRequests,mysql.KeyReads, \
mysql.KeyWriteRequests,mysql.KeyWrites,mysql.LastQueryCost,mysql.MaxUsedConnections,mysql.NdbClusterNodeId, \
mysql.NdbConfigFromHost,mysql.NdbConfigFromPort,mysql.NdbNumberOfDataNodes,mysql.NotFlushedDelayedRows,mysql.OpenFiles, \
mysql.OpenStreams,mysql.OpenTables,mysql.OpenedTables,mysql.PreparedStmtCount,mysql.QcacheFreeBlocks, \
mysql.QcacheFreeMemory,mysql.QcacheHits,mysql.QcacheInserts,mysql.QcacheLowmemPrunes,mysql.QcacheNotCached, \
mysql.QcacheQueriesInCache,mysql.QcacheTotalBlocks,mysql.Questions,mysql.RplStatus,mysql.SelectFullJoin, \
mysql.SelectFullRangeJoin,mysql.SelectRange,mysql.SelectRangeCheck,mysql.SelectScan,mysql.SlaveOpenTempTables, \
mysql.SlaveRetriedTransactions,mysql.SlaveRunning,mysql.SlowLaunchThreads,mysql.SlowQueries,mysql.SortMergePasses, \
mysql.SortRange,mysql.SortRows,mysql.SortScan,mysql.SslAcceptRenegotiates,mysql.SslAccepts, \
mysql.SslCallbackCacheHits,mysql.SslCipher,mysql.SslCipherList,mysql.SslClientConnects,mysql.SslConnectRenegotiates, \
mysql.SslCtxVerifyDepth,mysql.SslCtxVerifyMode,mysql.SslDefaultTimeout,mysql.SslFinishedAccepts,mysql.SslFinishedConnects, \
mysql.SslSessionCacheHits,mysql.SslSessionCacheMisses,mysql.SslSessionCacheMode,mysql.SslSessionCacheOverflows,mysql.SslSessionCacheSize, \
mysql.SslSessionCacheTimeouts,mysql.SslSessionsReused,mysql.SslUsedSessionCacheEntries,mysql.SslVerifyDepth,mysql.SslVerifyMode, \
mysql.SslVersion,mysql.TableLocksImmediate,mysql.TableLocksWaited,mysql.TcLogMaxPagesUsed,mysql.TcLogPageSize, \
mysql.TcLogPageWaits,mysql.ThreadsCached,mysql.ThreadsConnected,mysql.ThreadsCreated,mysql.ThreadsRunning, \
mysql.BytesReceivedSend,mysql.Uptime


report.mysql.AbortedClients.name=Mysql Status Aborted clients
report.mysql.AbortedClients.columns=AbortedClients
report.mysql.AbortedClients.type=nodeSnmp
report.mysql.AbortedClients.command=--title="Mysql Status Aborted clients" \
    --vertical-label total \
    DEF:AbortedClients={rrd1}:AbortedClients:AVERAGE \
    LINE2:AbortedClients#ff0000:"Mysql Status Aborted clients" \
    GPRINT:AbortedClients:AVERAGE:"Avg  \: %8.2lf %s" \
    GPRINT:AbortedClients:MIN:"Min  \: %8.2lf %s" \
    GPRINT:AbortedClients:MAX:"Max  \: %8.2lf %s\n"

report.mysql.AbortedConnects.name=Mysql Status Aborted connects
report.mysql.AbortedConnects.columns=AbortedConnects
report.mysql.AbortedConnects.type=nodeSnmp
report.mysql.AbortedConnects.command=--title="Mysql Status Aborted connects" \
    --vertical-label total \
    DEF:AbortedConnects={rrd1}:AbortedConnects:AVERAGE \
    LINE2:AbortedConnects#ff0000:"Mysql Status Aborted connects" \
    GPRINT:AbortedConnects:AVERAGE:"Avg  \: %8.2lf %s" \
    GPRINT:AbortedConnects:MIN:"Min  \: %8.2lf %s" \
    GPRINT:AbortedConnects:MAX:"Max  \: %8.2lf %s\n"

report.mysql.BinlogCacheDiskUse.name=Mysql Status Binlog cache disk use
report.mysql.BinlogCacheDiskUse.columns=BinlogCacheDiskUse
report.mysql.BinlogCacheDiskUse.type=nodeSnmp
report.mysql.BinlogCacheDiskUse.command=--title="Mysql Status Binlog cache disk use" \
    --vertical-label total \
    DEF:BinlogCacheDiskUse={rrd1}:BinlogCacheDiskUse:AVERAGE \
    LINE2:BinlogCacheDiskUse#ff0000:"Mysql Status Binlog cache disk use" \
    GPRINT:BinlogCacheDiskUse:AVERAGE:"Avg  \: %8.2lf %s" \
    GPRINT:BinlogCacheDiskUse:MIN:"Min  \: %8.2lf %s" \
    GPRINT:BinlogCacheDiskUse:MAX:"Max  \: %8.2lf %s\n"

...


The URL for the MySQL Page is via an Alias set in the /etc/apache2/apache.conf:

/etc/apache2/apache.conf

Alias /mysql-status/ "/var/www/mysql"


I have make a php script, that poll every Minute the status from the MySQL Database, the Output must view like this:

Aborted_clients: 23061
Aborted_connects: 3161
Bytes_received: 910057404
Bytes_sent: 3231929810
Com_admin_commands: 264244
Com_alter_table: 882
Com_analyze: 0
Com_backup_table: 0
Com_begin: 0
Com_change_db: 730732
Com_change_master: 0
Com_check: 0
Com_commit: 0
Com_create_db: 0
Com_create_function: 0
Com_create_index: 0
Com_create_table: 382
Com_delete: 117352
Com_delete_multi: 0
Com_drop_db: 0
Com_drop_function: 0
Com_drop_index: 0
Com_drop_table: 382
Com_flush: 3
Com_grant: 5
Com_ha_close: 0
Com_ha_open: 0
Com_ha_read: 0
Com_insert: 5153719
Com_insert_select: 0
Com_kill: 2
Com_load: 0
Com_load_master_data: 0
Com_load_master_table: 0
Com_lock_tables: 0
Com_optimize: 0
Com_purge: 0
Com_rename_table: 0
Com_repair: 0
Com_replace: 117600
Com_replace_select: 0
Com_reset: 0
Com_restore_table: 0
Com_revoke: 0
Com_rollback: 0
Com_savepoint: 0
Com_select: 28475471
Com_set_option: 177475
Com_show_binlog_events: 0
Com_show_binlogs: 44
Com_show_create: 177073
Com_show_databases: 75
Com_show_fields: 177959
Com_show_grants: 488
Com_show_innodb_status: 0
Com_show_keys: 215
Com_show_logs: 0
Com_show_master_status: 0
Com_show_new_master: 0
Com_show_open_tables: 0
Com_show_processlist: 40
Com_show_slave_hosts: 0
Com_show_slave_status: 0
Com_show_status: 1302
Com_show_tables: 179974
Com_show_variables: 40
Com_slave_start: 0
Com_slave_stop: 0
Com_truncate: 0
Com_unlock_tables: 0
Com_update: 869338
Com_update_multi: 0
Connections: 469556
Created_tmp_disk_tables: 948653
Created_tmp_files: 243
Created_tmp_tables: 1138110
Delayed_errors: 0
Delayed_insert_threads: 0
Delayed_writes: 0
Flush_commands: 1
Handler_commit: 0
Handler_delete: 135560
Handler_read_first: 167874
Handler_read_key: 583987088
Handler_read_next: 705054975
Handler_read_prev: 497
Handler_read_rnd: 271529331
Handler_read_rnd_next: 3191670885
Handler_rollback: 0
Handler_update: 1336642
Handler_write: 146055191
Key_blocks_used: 7793
Key_read_requests: 2135209161
Key_reads: 3227024
Key_write_requests: 16497133
Key_writes: 16356367
Max_used_connections: 67
Not_flushed_delayed_rows: 0
Not_flushed_key_blocks: 0
Open_files: 116
Open_streams: 0
Open_tables: 64
Opened_tables: 243640
Qcache_free_blocks: 0
Qcache_free_memory: 0
Qcache_hits: 0
Qcache_inserts: 0
Qcache_lowmem_prunes: 0
Qcache_not_cached: 0
Qcache_queries_in_cache: 0
Qcache_total_blocks: 0
Questions: 36635419
Rpl_status: NULL
Select_full_join: 726796
Select_full_range_join: 992
Select_range: 4542190
Select_range_check: 0
Select_scan: 1485151
Slave_open_temp_tables: 0
Slave_running: OFF
Slow_launch_threads: 151
Slow_queries: 610
Sort_merge_passes: 120
Sort_range: 1079493
Sort_rows: 271730674
Sort_scan: 1244155
Table_locks_immediate: 40481922
Table_locks_waited: 1151
Threads_cached: 0
Threads_connected: 13
Threads_created: 469555
Threads_running: 1
Uptime: 942880

/var/www/mysql/index.php

<?

        $Allowd_IPs="127.0.0.1 10.20.11.10 10.20.11.151 10.20.10.69";
        $DB_User="monitor";
        $DB_Pass="monitor";
        $DB_Name="";
        $DB_Host="10.43.0.11";
        $DB_Port="3306";
        $Debugging="";

        error_reporting(FATAL | ERROR);

        $time_start = microtime(true);

        if ($_SERVER["HTTP_X_FORWARDED_FOR"]) {
                if ($_SERVER["HTTP_CLIENT_IP"]) {
                        $proxy = $_SERVER["HTTP_CLIENT_IP"];
                } else {
                        $proxy = $_SERVER["REMOTE_ADDR"];
                }
                $ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
        } else {
                if ($_SERVER["HTTP_CLIENT_IP"]) {
                        $ip = $_SERVER["HTTP_CLIENT_IP"];
                } else {
                        $ip = $_SERVER["REMOTE_ADDR"];
                }
        }

        echo "<html><head><title>MySQL-Status</title></head><body><table>";


        $vars = explode(' ', $Allowd_IPs);

        foreach ($vars as $addr){
                if($ip == $addr){
                        $IP_Found="true";
                }
        }

        if($IP_Found != "true"){
                echo "<tr><td>Your IP-Address: $ip</td></tr>";
                if (isset($proxy)) {
                        echo "<tr><td>Your Proxy IP-Address: $proxy</td></tr>";
                }
                echo "<tr><td><h2>You are not Allowed, to visit this Site !</h2></td></tr>";
                echo "</table></body></html>";
                exit();
        }

        $link = mysql_connect($DB_Host, $DB_User, $DB_Pass);
        if (!$link) {
                die("<tr><td>Cannot connect to Database: " . mysql_error()."</td></tr>");
        }

        if($Debugging != ""){
                echo "<tr><td><h3>Connection to Database Successfull</h3></td></tr>";
        }

        $result=mysql_query("SHOW STATUS");

        while($row=mysql_fetch_array($result)){
                echo "<tr><td>".$row[0].": ".$row[1]."</td></tr>";
        }

        mysql_close($link);

        $time_end=microtime(true);
        $time = $time_end - $time_start;
        echo "<tr><td>PageLoad Time: $time</td></tr>";

        echo "</table></body></html>";

?>


Don't forget to add the mysql Monitoring User: monitor with pass: monitor to the DB, give him only GRANT USAGE rights !

user@DB-Server:~$ mysql -u root --password='123456'
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 470097 to server version: 4.0.27

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> GRANT USAGE ON *.* TO 'monitor'@'localhost' IDENTIFIED BY 'monitor';

mysql> FLUSH PRIVILEGES;