mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fixes to sensor detection (next comes more filtering)
git-svn-id: http://www.observium.org/svn/observer/trunk@1548 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -54,11 +54,12 @@ if(is_array($oids[$device['device_id']]))
|
||||
if($entry['entPhySensorScale'] == "mega") { $divisor = "1"; $multiplier = "1000000"; }
|
||||
if($entry['entPhySensorScale'] == "giga") { $divisor = "1"; $multiplier = "1000000000"; }
|
||||
|
||||
if(is_numeric($entry['entPhySensorPrecision']) && $entry['entPhySensorPrecision'] > "0") { $multiplier = $multiplier . str_pad('', $entry['entPhySensorPrecision'], "0"); }
|
||||
if(is_numeric($entry['entPhySensorPrecision']) && $entry['entPhySensorPrecision'] > "0") { $divisor = $divisor . str_pad('', $entry['entPhySensorPrecision'], "0"); }
|
||||
$current = $current * $multiplier / $divisor;
|
||||
|
||||
if($type == "temperature") { if($current > "200"){ $valid = FALSE; } $descr = preg_replace("/[T|t]emperature[|s]/", "", $descr); }
|
||||
|
||||
#echo($descr . "|" . $index . "|" .$current . "|" . $multiplier . "|" . $divisor ."|" . $entry['entPhySensorScale'] . "|" . $entry['entPhySensorPrecision'] . "\n");
|
||||
|
||||
if($valid && mysql_result(mysql_query("SELECT COUNT(*) FROM `sensors` WHERE `device_id` = '".$device['device_id']."' AND `sensor_class` = '".$type."' AND `sensor_type` = 'cisco-entity-sensor' AND `sensor_index` = '".$index."'"),0) == "0")
|
||||
## Check to make sure we've not already seen this sensor via cisco's entity sensor mib
|
||||
|
||||
Reference in New Issue
Block a user