1
0
mirror of https://github.com/librenms/librenms-agent.git synced 2024-05-09 09:54:52 +00:00
Tony Murray e6fa86dc82 Fix memcached security vulnerability (#428)
Add snmp extend script
2022-10-16 11:15:25 -05:00

23 lines
512 B
PHP
Executable File

#!/usr/bin/php
<?php
if (! class_exists('Memcached')) {
echo json_encode(array(
'data' => false,
'error' => 99,
'errorString' => 'php-memcached extension is not available, it must be installed and enabled.',
'version' => '1.1'
));
exit;
}
$m = new Memcached();
$m->addServer('localhost', 11211);
echo json_encode(array(
'data' => $m->getStats(),
'error' => $m->getLastErrorCode(),
'errorString' => $m->getLastErrorMessage(),
'version' => '1.1',
));