retooled sensors discovery. use global $valid_sensor, use sensors table only, replace sensor_precision with sensor_multiplier and sensor_divisor, remove all old discover_* functions and replace with discover_sensor

git-svn-id: http://www.observium.org/svn/observer/trunk@1529 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-07-29 18:25:11 +00:00
parent 57fb938d45
commit 4f2972660f
45 changed files with 314 additions and 617 deletions
+3 -4
View File
@@ -8,10 +8,9 @@ while($dbcurrent = mysql_fetch_array($current_data)) {
$current = snmp_get($device, $dbcurrent['sensor_oid'], "-OUqnv", "SNMPv2-MIB");
if ($dbcurrent['sensor_precision'])
{
$current = $current / $dbcurrent['sensor_precision'];
}
if ($dbcurrent['sensor_divisor']) { $current = $current / $dbcurrent['sensor_divisor']; }
if ($dbcurrent['sensor_multplier']) { $current = $current * $dbcurrent['sensor_multiplier']; }
$currentrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("current-" . $dbcurrent['sensor_descr'] . ".rrd");