mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Correct missing/extra data issues
netstats-icmp missing data netstats-tcp extra data
This commit is contained in:
@@ -34,13 +34,15 @@ if ($device['os'] != 'Snom') {
|
||||
);
|
||||
|
||||
$data = snmpwalk_cache_oid($device, 'icmp', array(), 'IP-MIB');
|
||||
$fields = $data[0];
|
||||
$data = $data[0];
|
||||
|
||||
if (isset($fields['icmpInMsgs']) && isset($fields['icmpOutMsgs'])) {
|
||||
if (isset($data['icmpInMsgs']) && isset($data['icmpOutMsgs'])) {
|
||||
$rrd_def = array();
|
||||
$fields = array();
|
||||
foreach ($oids as $oid) {
|
||||
$oid_ds = truncate($oid, 19, '');
|
||||
$rrd_def[] = "DS:$oid_ds:COUNTER:600:U:100000000000";
|
||||
$fields[$oid] = isset($data[$oid]) ? $data[$oid] : 'U';
|
||||
}
|
||||
|
||||
$tags = compact('rrd_def');
|
||||
|
@@ -31,9 +31,11 @@ if ($device['os'] != 'Snom') {
|
||||
$fields = $data[0];
|
||||
|
||||
// use HC Segs if we have them.
|
||||
if (isset($fields['tcpHCInSegs']) && !empty($fields['tcpHCInSegs'])) {
|
||||
$fields['tcpInSegs'] = $fields['tcpHCInSegs'];
|
||||
$fields['tcpOutSegs'] = $fields['tcpHCOutSegs'];
|
||||
if (isset($fields['tcpHCInSegs'])) {
|
||||
if (!empty($fields['tcpHCInSegs'])) {
|
||||
$fields['tcpInSegs'] = $fields['tcpHCInSegs'];
|
||||
$fields['tcpOutSegs'] = $fields['tcpHCOutSegs'];
|
||||
}
|
||||
unset($fields['tcpHCInSegs'], $fields['tcpHCOutSegs']);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user