mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Deliver output for a specific memcached instance (#15759)
To fix issues around 'no memcache output'. Associated with the relevant branch for librenms.
This commit is contained in:
@@ -10,7 +10,6 @@ if (! empty($agent_data['app']['memcached'])) {
|
||||
} else {
|
||||
try {
|
||||
$data = json_app_get($device, $name, '1.1')['data'] ?? [];
|
||||
$data = $data[$app->app_instance] ?? reset($data);
|
||||
} catch (JsonAppException $e) {
|
||||
$error_string = 'ERROR: ' . $e->getCode() . ':' . $e->getMessage();
|
||||
echo PHP_EOL . $name . ':' . $error_string . PHP_EOL;
|
||||
@@ -19,8 +18,7 @@ if (! empty($agent_data['app']['memcached'])) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
echo ' memcached(' . $app->app_instance . ')';
|
||||
$data = $data[$app->app_instance] ?? reset($data); // specified instance or just the first one
|
||||
echo ' memcached ';
|
||||
|
||||
$rrd_def = RrdDefinition::make()
|
||||
->addDataset('uptime', 'GAUGE', 0, 125000000000)
|
||||
|
Reference in New Issue
Block a user