Skip to content

Commit

Permalink
Deliver output for a specific memcached instance (#504)
Browse files Browse the repository at this point in the history
To fix issues around 'no memcache output'. Associated with the relevant branch for librenms.
  • Loading branch information
tevkar committed Feb 22, 2024
1 parent fa4d96c commit f8a8dc8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions snmp/memcached
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ if (! class_exists('Memcached')) {
exit;
}

$server='localhost';
$port=11211;
$m = new Memcached();
$m->addServer('localhost', 11211);
$m->addServer($server, $port);

echo json_encode(array(
'data' => $m->getStats(),
// 'data' => $m->getStats(),
'data' => ($m->getStats())["$server:$port"],
'error' => $m->getLastErrorCode(),
'errorString' => $m->getLastErrorMessage(),
'version' => '1.1',
));

0 comments on commit f8a8dc8

Please sign in to comment.