mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #2763 from paulgear/mib-poller-more-data-values
MIB-based polling: attempt to support more SNMP counter types
This commit is contained in:
@ -69,8 +69,9 @@ The components involved in MIB-based polling are:
|
|||||||
|
|
||||||
- During discovery, relevant MIBs are parsed using `snmptranslate`, and the
|
- During discovery, relevant MIBs are parsed using `snmptranslate`, and the
|
||||||
data returned is used to populate a database which guides the poller in
|
data returned is used to populate a database which guides the poller in
|
||||||
what to store. At the moment, only OIDs with Unsigned32 and Counter64
|
what to store. At the moment, only OIDs of INTEGER, Integer32, Gauge32,
|
||||||
data types are parsed.
|
Unsigned32, Counter32, and Counter64 data types are parsed, and negative
|
||||||
|
values are untested.
|
||||||
|
|
||||||
- Devices may be excluded from MIB polling by changing the setting in the
|
- Devices may be excluded from MIB polling by changing the setting in the
|
||||||
device edit screen:
|
device edit screen:
|
||||||
|
@ -1040,22 +1040,19 @@ function oid_rrd_type($oid, $mibdef)
|
|||||||
|
|
||||||
case 'INTEGER':
|
case 'INTEGER':
|
||||||
case 'Integer32':
|
case 'Integer32':
|
||||||
// FIXME
|
return 'GAUGE:600:U:U';
|
||||||
return false;
|
|
||||||
|
|
||||||
case 'Counter32':
|
case 'Counter32':
|
||||||
// FIXME
|
|
||||||
return false;
|
|
||||||
|
|
||||||
case 'Counter64':
|
case 'Counter64':
|
||||||
return 'COUNTER:600:0:U';
|
return 'COUNTER:600:0:U';
|
||||||
|
|
||||||
|
case 'Gauge32':
|
||||||
case 'Unsigned32':
|
case 'Unsigned32':
|
||||||
return 'GAUGE:600:U:U';
|
return 'GAUGE:600:0:U';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
} // oid_rrd_type
|
} // oid_rrd_type
|
||||||
|
|
||||||
|
|
||||||
@ -1124,7 +1121,7 @@ function save_mibs($device, $mibname, $oids, $mibdef, &$graphs)
|
|||||||
foreach ($oids as $index => $array) {
|
foreach ($oids as $index => $array) {
|
||||||
foreach ($array as $obj => $val) {
|
foreach ($array as $obj => $val) {
|
||||||
// build up the device_oid row for saving into the database
|
// build up the device_oid row for saving into the database
|
||||||
$numvalue = preg_match('/^\d+$/', $val) ? $val : null;
|
$numvalue = is_numeric($val) ? $val + 0 : 0;
|
||||||
$deviceoids[] = array(
|
$deviceoids[] = array(
|
||||||
'device_id' => $device['device_id'],
|
'device_id' => $device['device_id'],
|
||||||
'oid' => $mibdef[$obj]['oid'].".".$index,
|
'oid' => $mibdef[$obj]['oid'].".".$index,
|
||||||
|
Reference in New Issue
Block a user