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:
tevkar
2024-02-01 05:23:40 +01:00
committed by GitHub
parent 81bf68ba88
commit 49977a7fa0

View File

@@ -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)