diff --git a/html/includes/graphs/device/fdb_count.inc.php b/html/includes/graphs/device/fdb_count.inc.php index 195d090517..ae683f13ea 100755 --- a/html/includes/graphs/device/fdb_count.inc.php +++ b/html/includes/graphs/device/fdb_count.inc.php @@ -7,11 +7,10 @@ include("includes/graphs/common.inc.php"); $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/fdb_count.rrd"; $rrd_options .= " DEF:value=$rrd_filename:value:AVERAGE"; - $rrd_options .= " CDEF:cvalue=value,86400,/"; $rrd_options .= " COMMENT:'MACs Current Minimum Maximum Average\\n'"; - $rrd_options .= " AREA:cvalue#EEEEEE:value"; - $rrd_options .= " LINE1.25:cvalue#36393D:"; - $rrd_options .= " GPRINT:cvalue:LAST:%6.2lf\ GPRINT:cvalue:AVERAGE:%6.2lf\ "; - $rrd_options .= " GPRINT:cvalue:MAX:%6.2lf\ GPRINT:cvalue:AVERAGE:%6.2lf\\\\n"; + $rrd_options .= " AREA:value#EEEEEE:value"; + $rrd_options .= " LINE1.25:value#36393D:"; + $rrd_options .= " GPRINT:value:LAST:%6.2lf\ GPRINT:cvalue:AVERAGE:%6.2lf\ "; + $rrd_options .= " GPRINT:value:MAX:%6.2lf\ GPRINT:cvalue:AVERAGE:%6.2lf\\\\n"; ?> diff --git a/includes/discovery/entity-sensor.inc.php b/includes/discovery/entity-sensor.inc.php index 28759ba57f..e61feb1de1 100644 --- a/includes/discovery/entity-sensor.inc.php +++ b/includes/discovery/entity-sensor.inc.php @@ -33,6 +33,11 @@ if(is_array($oids[$device['device_id']])) $current = $entry['entPhySensorValue']; #ENTITY-SENSOR-MIB::entPhySensorUnitsDisplay.11 = STRING: "C" + $descr = snmp_get($device, "entPhysicalName.".$index, "-Oqv", "ENTITY-MIB"); + if(!$descr) { snmp_get($device, "entPhysicalDescr.".$index, "-Oqv", "ENTITY-MIB"); } + + $valid = TRUE + $type = $entitysensor[$entry['entPhySensorType']]; $descr = str_replace("temperature", "", $descr); @@ -49,12 +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"); } - - #echo("|".$entry['entPhySensorScale']."|".$entry['entPhySensorPrecision']."|".$divisor."|".$multiplier."|"); - $current = $current * $multiplier / $divisor; - if(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") + if($type == "temperature") { if($current > "200"){ $valid = FALISE; } } + + + 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 { discover_sensor($valid_sensor, $type, $device, $oid, $index, 'entity-sensor', $descr, $divisor, $multiplier, NULL, NULL, NULL, NULL, $current);