Merge pull request #3949 from florianbeer/memcached

Add snmp polling capability for Memcached
This commit is contained in:
Tony Murray
2016-08-05 14:01:17 -05:00
committed by GitHub
3 changed files with 23 additions and 3 deletions

View File

@@ -106,14 +106,15 @@ LibreNMS contributors:
- Marc Runkel <marc@runkel.org> (mrunkel)
- Josh Driver <keeperofdakeys@gmail.com> (keeperofdakeys)
- Felix Eckhofer <felix@eckhofer.com> (tribut)
- Vikram Adukia <adukia@dropbox.com> (justmedude)
- Vikram Adukia <adukia@dropbox.com> (justmedude)
- Tijmen de Mes <tijmen@ag-projects.com> (tijmenNL)
- Benjamin Busche <benjamin.busche@gmail.com> (optic00)
- Brandon Boudrias <bt.boudrias@gmail.com> (brandune)
- Andy Noyland <andrew@noyland.co.uk> (Zappatron)
- Andy Noyland <andrew@noyland.co.uk> (Zappatron)
- Cercel Valentin <crc@nuamchefazi.ro> (crcro)
- Ahmed Sajid <ahmed4343@hotmail.com> (ahmedsajid)
- Karsten Schmidt <git@guggemand.dk> (guggemand)
- Florian Beer <fb@42dev.eu> (florianbeer)
[1]: http://observium.org/ "Observium web site"
Observium was written by:

View File

@@ -12,6 +12,8 @@ Different applications support a variety of ways collect data: by direct connect
6. [TinyDNS/djbdns](#tinydns-aka-djbdns) - Agent
7. [OS Updates](#os-updates) - extend SNMP
8. [DHCP Stats](#dhcp-stats) - extend SNMP
9. [Memcached](#memcached) - extend SNMP
* [Agent Setup](#agent-setup)
@@ -156,6 +158,15 @@ extend dhcpstats /opt/dhcp-status.sh
4. Restart snmpd on your host
5. On the device page in Librenms, edit your host and check the `DHCP Stats` under the Applications tab.
### Memcached
1. Copy the [memcached script](https://github.com/librenms/librenms-agent/blob/master/agent-local/memcached) to `/usr/local/bin` (or any other suitable location) on your remote server.
2. Make the script executable: `chmod +x /usr/local/memcached`
3. Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf`) and add:
```
extend memcached /usr/local/bin/memcached
```
4. Restart snmpd on your host
5. On the device page in Librenms, edit your host and check `Memcached` under the Applications tab.
Agent Setup
-----------

View File

@@ -1,6 +1,14 @@
<?php
$data = $agent_data['app']['memcached'][$app['app_instance']];
if (!empty($agent_data['app']['memcached'])) {
$data = $agent_data['app']['memcached'][$app['app_instance']];
} else {
$options = '-O qv';
$oid = '.1.3.6.1.4.1.8072.1.3.2.3.1.2.9.109.101.109.99.97.99.104.101.100';
$result = snmp_get($device, $oid, $options);
$result = unserialize(str_replace("<<<app-memcached>>>\n", '', $result));
$data = $result[0];
}
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/app-memcached-'.$app['app_id'].'.rrd';