mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix memcached always reporting "ERROR" for app_state (#10739)
* perform json_encode() on memcached app $response data to match update_application() string parameter * return raw snmp_get result for memcached response data during update_application()
This commit is contained in:
@@ -9,9 +9,9 @@ if (!empty($agent_data['app']['memcached'])) {
|
|||||||
} else {
|
} else {
|
||||||
$oid = '.1.3.6.1.4.1.8072.1.3.2.3.1.2.9.109.101.109.99.97.99.104.101.100';
|
$oid = '.1.3.6.1.4.1.8072.1.3.2.3.1.2.9.109.101.109.99.97.99.104.101.100';
|
||||||
$result = snmp_get($device, $oid, '-Oqv');
|
$result = snmp_get($device, $oid, '-Oqv');
|
||||||
$result = trim($result, '"');
|
$data = trim($result, '"');
|
||||||
$result = unserialize(stripslashes(str_replace("<<<app-memcached>>>\n", '', $result)));
|
$data = unserialize(stripslashes(str_replace("<<<app-memcached>>>\n", '', $data)));
|
||||||
$data = reset($result);
|
$data = reset($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo ' memcached('.$app['app_instance'].')';
|
echo ' memcached('.$app['app_instance'].')';
|
||||||
@@ -60,4 +60,4 @@ $fields = array(
|
|||||||
|
|
||||||
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
$tags = compact('name', 'app_id', 'rrd_name', 'rrd_def');
|
||||||
data_update($device, 'app', $tags, $fields);
|
data_update($device, 'app', $tags, $fields);
|
||||||
update_application($app, $data, $fields);
|
update_application($app, $result, $fields);
|
||||||
|
|||||||
Reference in New Issue
Block a user