From bdc33ebf590426ded3a9d2767d3026b8e8bce0e7 Mon Sep 17 00:00:00 2001 From: Richard Kojedzinszky Date: Thu, 12 Nov 2015 14:44:12 +0100 Subject: [PATCH] Real-time graphs: fix for graph wraps FIX is by querying the HC counters first, and fall back to snmpv1 oids in case of no answer. --- html/data.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/html/data.php b/html/data.php index b55d09c32..4267ddb5d 100644 --- a/html/data.php +++ b/html/data.php @@ -31,14 +31,14 @@ if (is_numeric($_GET['id']) && ($config['allow_unauth_graphs'] || port_permitted $auth = true; } -$in = snmp_get($device, 'ifInOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB'); -$out = snmp_get($device, 'ifOutOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB'); +$in = snmp_get($device, 'ifHCInOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB'); if (empty($in)) { - $in = snmp_get($device, 'ifHCInOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB'); + $in = snmp_get($device, 'ifInOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB'); } +$out = snmp_get($device, 'ifHCOutOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB'); if (empty($out)) { - $out = snmp_get($device, 'ifHCOutOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB'); + $out = snmp_get($device, 'ifOutOctets.'.$port['ifIndex'], '-OUqnv', 'IF-MIB'); } $time = time();