-
Notifications
You must be signed in to change notification settings - Fork 33
/
README
121 lines (88 loc) · 3.29 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
MySQL Server SNMP Agent.
Copyright (c) 2008,2009 Brice Figureau <brice.figureau@daysofwonder.com>
PREAMBLE
========
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:
http://code.google.com/p/mysql-cacti-templates/
This work is based on the blog post about a SNMP agent:
http://mysqldump.azundris.com/archives/63-Sysadmins-Nightly-Mental-Pain-SNMP.html
This software is released under the GPL v2.
REQUIREMENTS
============
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.
INSTALL
=======
Debian
------
Please build the package:
$ dpkg-buildpackage -rfakeroot -uc- b
and install it
Then, modify /etc/default/mysql-snmp
Other
-----
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
=========
Configure net-snmp
------------------
Add:
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
directive).
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
-l|--process-list|--procs
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:
[client]
host=dbserver
port=3306
user=monitor
password=secret
OPENNMS
=======
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.
datacollection-config.xml
-------------------------
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">
<sysoidMask>.1.3.6.1.4.1.8072.3.</sysoidMask>
<collect>
<includeGroup>mib2-host-resources-system</includeGroup>
<includeGroup>mib2-host-resources-memory</includeGroup>
<includeGroup>net-snmp-disk</includeGroup>
<includeGroup>ucd-loadavg</includeGroup>
<includeGroup>ucd-memory</includeGroup>
<includeGroup>ucd-sysstat</includeGroup>
<includeGroup>mysql</includeGroup>
</collect>
</systemDef>
And now, add the graph definitions from the opennms/mysql.snmp-graph.properties file
to your snmp-graph.properties.