Coder Social home page Coder Social logo

optionalg / mysql-snmp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from masterzen/mysql-snmp

0.0 2.0 0.0 355 KB

Net-SNMP perl agent for monitoring MySQL servers

Home Page: http://www.masterzen.fr/software-contributions/mysql-snmp-monitor-mysql-with-snmp/

License: GNU General Public License v2.0

Makefile 1.72% Roff 4.74% Perl 90.27% Shell 3.27%

mysql-snmp's Introduction

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

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.

mysql-snmp's People

Contributors

kdreyer-usgs avatar michaelsmit avatar dentcat avatar robinbowes avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.