Rrdcached SNMP: Add poller feature for RRDCached SNMP to query remote agent. (#12430)

* Add poller feature for RRDCached queries via SNMP

* Docs Update

* Update Documentation to include localhost RRDCached monitor.

* update doc.

* update/fix

* Update Applications.md

as requested, remove RRDCached Security ref for local polling.

* Update Applications.md

* Update Applications.md

Co-authored-by: Tony Murray <[email protected]>
This commit is contained in:
Cupid@zul
2021-02-14 10:00:56 -06:00
committed by GitHub
co-authored by Tony Murray
parent b86dbcf693
commit f9a379fa3c
2 changed files with 36 additions and 1 deletions
+27
View File
@@ -128,6 +128,7 @@ by following the steps under the `SNMP Extend` heading.
1. [PureFTPd](#pureftpd) - SNMP extend
1. [Raspberry PI](#raspberry-pi) - SNMP extend
1. [Redis](#redis) - SNMP extend
1. [RRDCached](#rrdcached) - SNMP extend
1. [SDFS info](#sdfs-info) - SNMP extend
1. [Seafile](#seafile) - SNMP extend
1. [SMART](#smart) - SNMP extend
@@ -1651,6 +1652,32 @@ SNMP extend script to monitor your Redis Server
extend redis /etc/snmp/redis.py
```
# RRDCached
Install/Setup:
For Install/Setup Local Librenms RRDCached: Please see [RRDCached](RRDCached.md)
Will collect stats by:
1: Connecting directly to the associated device on port 42217
2: Monitor thru snmp with SNMP extend, as outlined below
3: Connecting to the rrdcached server specified by the `rrdcached` setting
SNMP extend script to monitor your (remote) RRDCached via snmp
## SNMP Extend
1: Download the script onto the desired host. `wget
https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/rrdcached
-O /etc/snmp/rrdcached`
2: Make the script executable: `chmod +x /etc/snmp/rrdcached`
3: Edit your snmpd.conf file (usually `/etc/snmp/snmpd.conf`) and add:
```
extend rrdcached /etc/snmp/rrdcached
```
# Seafile
SNMP extend script to monitor your Seafile Server
@@ -40,6 +40,13 @@ if ($agent_data['app'][$name]) {
$sock = fsockopen($device['hostname'], 42217, $errno, $errstr, 5);
if (! $sock) {
d_echo("\nNo Socket to rrdcached server " . $device['hostname'] . ":42217 try to get rrdcached from SNMP\n");
$oid = '.1.3.6.1.4.1.8072.1.3.2.3.1.2.9.114.114.100.99.97.99.104.101.100';
$result = snmp_get($device, $oid, '-Oqv');
$data = trim($result, '"');
$data = str_replace("<<<rrdcached>>>\n", '', $data);
}
if (strlen($data) < 100) {
$socket = \LibreNMS\Config::get('rrdcached');
if (substr($socket, 0, 6) == 'unix:/') {
$socket_file = substr($socket, 5);
@@ -47,6 +54,7 @@ if ($agent_data['app'][$name]) {
$sock = fsockopen('unix://' . $socket_file);
}
}
d_echo("\nNo SnmpData " . $device['hostname'] . ' fallback to local rrdcached unix://' . $socket_file . "\n");
}
if ($sock) {
fwrite($sock, "STATS\n");
@@ -61,7 +69,7 @@ if ($agent_data['app'][$name]) {
$count++;
}
fclose($sock);
} else {
} elseif (strlen($data) < 100) {
d_echo("ERROR: $errno - $errstr\n");
}
}