mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix Cisco entity-sensor (#16351)
* Fix Cisco entity-sensor make mw_to_dbm and uw_to_dbm handle negative numbers * fixes and update test data
This commit is contained in:
@@ -228,12 +228,12 @@ if ($device['os_group'] == 'cisco') {
|
||||
// convert Watts to dbm
|
||||
$user_func = 'mw_to_dbm';
|
||||
$type = 'dbm';
|
||||
$limit_low = 10 * log10($limit_low * 1000);
|
||||
$warn_limit_low = 10 * log10($warn_limit_low * 1000);
|
||||
$warn_limit = 10 * log10($warn_limit * 1000);
|
||||
$limit = 10 * log10($limit * 1000);
|
||||
$current = round(10 * log10($current * 1000), 3);
|
||||
$multiplier = 1000;
|
||||
$limit_low = isset($limit_low) ? round(mw_to_dbm($limit_low * $multiplier), 3) : null;
|
||||
$warn_limit_low = isset($limit_low) ? round(mw_to_dbm($warn_limit_low * $multiplier), 3) : null;
|
||||
$warn_limit = isset($limit_low) ? round(mw_to_dbm($warn_limit * $multiplier), 3) : null;
|
||||
$limit = isset($limit_low) ? round(mw_to_dbm($limit * $multiplier), 3) : null;
|
||||
$current = mw_to_dbm($current * $multiplier);
|
||||
//echo("\n".$valid['sensor'].", $type, $device, $oid, $index, 'cisco-entity-sensor', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, $user_func");
|
||||
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'], $user_func);
|
||||
}
|
||||
|
Reference in New Issue
Block a user