root / tools / munin2snmp @ 06c8538a
| Nom | Taille | Révision | Âge | Auteur | Commentaire |
|---|---|---|---|---|---|
| MUNIN-MIB | 2,68 ko | 45941d87 | presque 9 ans | Alex Mestiashvili | Add munin2snmp, snmp agent for querying munin-n... |
| README.pod | 2,89 ko | 06c8538a | presque 9 ans | Alex Mestiashvili | Update README.pod |
| munin2snmp | 8,42 ko | 9c29d496 | presque 9 ans | Alex Mestiashvili | Read options from a config file or as the progr... |
Dernières révisions
README
NAME
munin2snmp - SNMP Agent to query munin-node over snmp
REQUIREMENTS
Net::SNMP, Getopt::Long, Pod::Usage perl modules, munin-node with some plugins
Example configuration
/etc/snmp/snmpd.conf
master agentx
agentAddress udp:127.0.0.1:161
rocommunity public 127.0.0.1
On a newer system it is enough to define "master" option only
MUNIN-MIB should be installed on the client, it goes to /usr/local/share/snmp/mibs or /usr/share/munin/mibs or another place where snmpd expects to find the MIB files.
See also http://www.net-snmp.org/wiki/index.php/FAQ:MIBs_03
It is possible to start munin2snmp as non-root user, for example run munin2snmp as Debian-snmp user on Debian Stretch:
fix the /var/agentx permissions:
chmod g+rx /var/agentx
chgrp Debian-snmp /var/agentx
add to /etc/snmp/snmpd.conf:
master agentx
agentXperms 0640 0550 Debian-snmp Debian-snmp
restart snmpd and start the agent as Debian-snmp:
su -l Debian-snmp -s /bin/bash -c "/tmp/munin2snmp.pl --pidfile /tmp/munin2snmp.pid --plugins iostat,vmstat"
Usage
After setting up snmpd, start the agent:
./munin2snmp
Now one can query the agent
snmpwalk -v 2c -mMUNIN-MIB -c public localhost .1.3.6.1.4.1.123456.100.1.1
where "1.3.6.1.4.1.123456.100.1.1" is example OID selected as the base tree for the agent.
Change OBJECT IDENTIFIER in the MUNIN-MIB file if you plan to use a different OID.
You might need to change the host, port, oidbase and munin_plugins you want to use.
The defaults:
$Munin{PORT} = '4949';
$Munin{HOST} = 'localhost'
$oidbase = ".1.3.6.1.4.1.123456.100.1.1"
@munin_plugins = qw ( load cpu df );
One can override the defaults by creating /etc/munin2snmp.conf file with the following configuration options:
munin_port = [port]
munin_host = [host]
base_oid = [oid]
munin_plugins = [comma separated list of munin-node plugins]
Or by specifying the parameters, see munin2snmp --help for the usage
ACKNOWLEDGEMENTS
Heavily inspired by Vincent Bernat: https://github.com/vincentbernat/extend-netsnmp and Masahito Zembutsu: https://github.com/zembutsu/muninwalk
LICENSE
ISC License (ISC)
Copyright (c) 2016, Alex Mestiashvili <mailatgoogl@gmail.com>
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Formats disponibles : Atom
