mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 18:38:25 +00:00
fix: Add check for differently named Cisco Power sensor (#5119)
This commit is contained in:
parent
09767f7e95
commit
e67572cfb7
@ -161,7 +161,7 @@ if ($device['os_group'] == 'cisco') {
|
||||
if ($ok) {
|
||||
discover_sensor($valid['sensor'], $type, $device, $oid, $index, 'cisco-entity-sensor', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entry['entSensorMeasuredEntity']);
|
||||
#Cisco IOS-XR : add a fake sensor to graph as dbm
|
||||
if ($type == "power" and $device['os'] == "iosxr" and preg_match("/power (R|T)x/i", $descr)) {
|
||||
if ($type == "power" and $device['os'] == "iosxr" and (preg_match("/power (R|T)x/i", $descr) or preg_match("/(R|T)x Power/i", $descr))) {
|
||||
// convert Watts to dbm
|
||||
$type = "dbm";
|
||||
$limit_low = 10 * log10($limit_low*1000);
|
||||
|
@ -41,11 +41,12 @@ function poll_sensor($device, $class, $unit)
|
||||
if ($sensor['poller_type'] == 'snmp') {
|
||||
$mibdir = null;
|
||||
|
||||
$sensor_value = trim(str_replace('"', '', $snmp_data[$sensor['sensor_oid']]));
|
||||
|
||||
if (file_exists('includes/polling/sensors/'. $class .'/'. $device['os'] .'.inc.php')) {
|
||||
require_once 'includes/polling/sensors/'. $class .'/'. $device['os'] .'.inc.php';
|
||||
}
|
||||
|
||||
$sensor_value = trim(str_replace('"', '', $snmp_data[$sensor['sensor_oid']]));
|
||||
|
||||
if ($class == 'temperature') {
|
||||
preg_match('/[\d\.\-]+/', $sensor_value, $temp_response);
|
||||
|
Loading…
Reference in New Issue
Block a user