diff --git a/doc/Extensions/MIB-based-polling.md b/doc/Extensions/MIB-based-polling.md index 0909aacfb7..8358c44e78 100644 --- a/doc/Extensions/MIB-based-polling.md +++ b/doc/Extensions/MIB-based-polling.md @@ -69,9 +69,8 @@ The components involved in MIB-based polling are: - During discovery, relevant MIBs are parsed using `snmptranslate`, and the data returned is used to populate a database which guides the poller in - what to store. At the moment, only OIDs of INTEGER, Integer32, Unsigned32, - Counter32, and Counter64 data types are parsed, and negative values are - untested. + what to store. At the moment, only OIDs with Unsigned32 and Counter64 + data types are parsed. - Devices may be excluded from MIB polling by changing the setting in the device edit screen: diff --git a/includes/snmp.inc.php b/includes/snmp.inc.php index 4f15260aa8..8a7cb80690 100644 --- a/includes/snmp.inc.php +++ b/includes/snmp.inc.php @@ -1040,19 +1040,22 @@ function oid_rrd_type($oid, $mibdef) case 'INTEGER': case 'Integer32': - return 'GAUGE:600:U:U'; + // FIXME + return false; case 'Counter32': + // FIXME + return false; + case 'Counter64': return 'COUNTER:600:0:U'; - case 'Gauge32': case 'Unsigned32': - return 'GAUGE:600:0:U'; - + return 'GAUGE:600:U:U'; } return false; + } // oid_rrd_type @@ -1121,7 +1124,7 @@ function save_mibs($device, $mibname, $oids, $mibdef, &$graphs) foreach ($oids as $index => $array) { foreach ($array as $obj => $val) { // build up the device_oid row for saving into the database - $numvalue = is_numeric($val) ? $val + 0 : 0; + $numvalue = preg_match('/^\d+$/', $val) ? $val : null; $deviceoids[] = array( 'device_id' => $device['device_id'], 'oid' => $mibdef[$obj]['oid'].".".$index,