README
1MySQL Server SNMP Agent.
2Copyright (c) 2008,2009 Brice Figureau <brice.figureau@daysofwonder.com>
3
4PREAMBLE
5========
6
7mysql-snmp is a MySQL Net-SNMP agent written in Perl, and using the Net-Snmp
8Perl bindings.
9
10It connects to a mysql server and returns information to Net-SNMP when needed.
11It parses SHOW INNODB STATUS and other MySQL status variables.
12
13This work is based on Baron Schwartz Mysql Cacti Templates, available at:
14http://code.google.com/p/mysql-cacti-templates/
15
16This work is based on the blog post about a SNMP agent:
17http://mysqldump.azundris.com/archives/63-Sysadmins-Nightly-Mental-Pain-SNMP.html
18
19This software is released under the GPL v2.
20
21
22REQUIREMENTS
23============
24
25This package requires Net-SNMP version 5.4.3 or better. Previous versions have bugs preventing
26returning 64 bits MIBs objects correctly from a perl agentX.
27
28INSTALL
29=======
30
31Debian
32------
33
34Please build the package:
35$ dpkg-buildpackage -rfakeroot -uc- b
36
37and install it
38Then, modify /etc/default/mysql-snmp
39
40Other
41-----
42
43Modify the Makefile, and:
44$ sudo make install
45
46Then create an init.d startup script. You can look to the debian one
47in debian/init.d
48
49Install the MIB file in your mibs directory.
50
51CONFIGURE
52=========
53
54Configure net-snmp
55------------------
56
57Add:
58master agentx
59to /etc/snmp/snmpd.conf, and restart snmpd
60Make sure the mysql-snmp agent is able to open the agentX socket (permissions
61and location of said socket can be managed with the snmpd.conf agentXPerms
62directive).
63
64Configure mysql-snmp
65--------------------
66
67Under debian, the daemon can be configured with /etc/default/mysql-snmp.
68On all platform, the configuration is done with command line arguments:
69
70-h|--host HOST connect to mysql HOST
71-P|--port PORT port to connect to (default 3306)
72-u|--user DBUSER use DBUSER as user to connect to mysql
73-p|--password DBPASS use DBPASS as password to connect to mysql
74-c|--config FILE read MySQL configuration from FILE
75
76-m|--master check master
77-s|--slave check slave
78-b|--heartbeat DB.TABLE table for Percona Toolkit pt-heartbeat
79--oid OID registering OID
80-l|--process-list|--procs
81 enable the MySQL process list
82-i|--refresh refresh interval in seconds
83
84You can specify the mysql connection parameters in a config file using my.cnf format, like this:
85For example:
86
87[client]
88host=dbserver
89port=3306
90user=monitor
91password=secret
92
93
94OPENNMS
95=======
96
97You'll find in the opennms directory the various configuration snippets
98that can be used to let opennms graph the value reported by this agent.
99
100datacollection-config.xml
101-------------------------
102
103Add the content of opennms/mysql.datacollection-config.xml to
104your datacollection-config.xml file.
105
106Then add this group to your hosts:
107<systemDef name="Net-Snmp">
108 <sysoidMask>.1.3.6.1.4.1.8072.3.</sysoidMask>
109 <collect>
110 <includeGroup>mib2-host-resources-system</includeGroup>
111 <includeGroup>mib2-host-resources-memory</includeGroup>
112 <includeGroup>net-snmp-disk</includeGroup>
113 <includeGroup>ucd-loadavg</includeGroup>
114 <includeGroup>ucd-memory</includeGroup>
115 <includeGroup>ucd-sysstat</includeGroup>
116 <includeGroup>mysql</includeGroup>
117 </collect>
118</systemDef>
119
120And now, add the graph definitions from the opennms/mysql.snmp-graph.properties file
121to your snmp-graph.properties.
122