mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user