Net-SNMP perl agent for monitoring MySQL servers
Switch branches/tags
Latest commit 1d0b409 May 29, 2014 @masterzen masterzen Merge pull request #28 from dentcat/master
Actually exit after printing version message


MySQL Server SNMP Agent.
Copyright (c) 2008,2009 Brice Figureau <>


mysql-snmp is a MySQL Net-SNMP agent written in Perl, and using the Net-Snmp 
Perl bindings.

It connects to a mysql server and returns information to Net-SNMP when needed.
It parses SHOW INNODB STATUS and other MySQL status variables.

This work is based on Baron Schwartz Mysql Cacti Templates, available at:

This work is based on the blog post about a SNMP agent:

This software is released under the GPL v2.


This package requires Net-SNMP version 5.4.3 or better. Previous versions have bugs preventing
returning 64 bits MIBs objects correctly from a perl agentX.



Please build the package:
$ dpkg-buildpackage -rfakeroot -uc- b

and install it
Then, modify /etc/default/mysql-snmp


Modify the Makefile, and:
$ sudo make install

Then create an init.d startup script. You can look to the debian one
in debian/init.d

Install the MIB file in your mibs directory.


Configure net-snmp

master agentx
to /etc/snmp/snmpd.conf, and restart snmpd
Make sure the mysql-snmp agent is able to open the agentX socket (permissions
and location of said socket can be managed with the snmpd.conf agentXPerms

Configure mysql-snmp

Under debian, the daemon can be configured with /etc/default/mysql-snmp.
On all platform, the configuration is done with command line arguments:

-h|--host HOST          connect to mysql HOST
-P|--port PORT          port to connect to (default 3306)
-u|--user DBUSER        use DBUSER as user to connect to mysql
-p|--password DBPASS    use DBPASS as password to connect to mysql
-c|--config FILE        read MySQL configuration from FILE

-m|--master             check master
-s|--slave              check slave
-b|--heartbeat DB.TABLE table for Percona Toolkit pt-heartbeat 
--oid OID               registering OID
                        enable the MySQL process list
-i|--refresh            refresh interval in seconds

You can specify the mysql connection parameters in a config file using my.cnf format, like this:
For example:



You'll find in the opennms directory the various configuration snippets
that can be used to let opennms graph the value reported by this agent.


Add the content of opennms/mysql.datacollection-config.xml to
your datacollection-config.xml file.

Then add this group to your hosts:
<systemDef name="Net-Snmp">

And now, add the graph definitions from the opennms/ file 
to your