Get configured Rrdcached Socket from config (#11351)

* Global Settings - Alert Default Settings

* Revert "Global Settings - Alert Default Settings"

This reverts commit a1af62b146.

* Get RRDCached Socket from Configuration

* socket check

* misstype fix

* travis fix

* .
This commit is contained in:
SourceDoctor
2020-04-01 06:16:15 +02:00
committed by GitHub
parent cdb6a74dc8
commit 7b8ca66c67

View File

@@ -41,17 +41,13 @@ if ($agent_data['app'][$name]) {
$sock = fsockopen($device['hostname'], 42217, $errno, $errstr, 5);
if (!$sock) {
if (file_exists('/var/run/rrdcached.sock')) {
$sock = fsockopen('unix:///var/run/rrdcached.sock');
} elseif (file_exists('/var/run/rrdcached/rrdcached.sock')) {
$sock = fsockopen('unix:///var/run/rrdcached/rrdcached.sock');
} elseif (file_exists('/run/rrdcached.sock')) {
$sock = fsockopen('unix:///run/rrdcached.sock');
} elseif (file_exists('/tmp/rrdcached.sock')) {
$sock = fsockopen('unix:///tmp/rrdcached.sock');
$socket = \LibreNMS\Config::get('rrdcached');
if (substr($socket, 0, 7) == 'unix://') {
if (file_exists(substr($socket, 7))) {
$sock = fsockopen($socket);
}
}
}
if ($sock) {
fwrite($sock, "STATS\n");
$max = -1;