From bb9f2310653c2518525b3621201b076895298171 Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sat, 5 Sep 2015 04:18:28 +0200 Subject: [PATCH] see to get new router data recorded via SNMP --- include/classes/rrdstat.php-class | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/classes/rrdstat.php-class b/include/classes/rrdstat.php-class index 7532f00..deb8cda 100644 --- a/include/classes/rrdstat.php-class +++ b/include/classes/rrdstat.php-class @@ -366,8 +366,13 @@ class rrdstat { $evalcode = 'function { return trim('.substr($ds['update'], 4).')); }'; } elseif (substr($ds['update'], 0, 8) == 'snmp-if:') { - $snmphost = 'localhost'; $snmpcomm = 'public'; - list($nix, $ifname, $valtype) = explode(':', $ds['update'], 3); + if (substr_count($ds['update'], ':') >= 4) { + list($nix, $snmphost, $snmpcomm, $ifname, $valtype) = explode(':', $ds['update'], 5); + } + else { + $snmphost = 'localhost'; $snmpcomm = 'public'; + list($nix, $ifname, $valtype) = explode(':', $ds['update'], 3); + } $iflist = explode("\n", `snmpwalk -v2c -c $snmpcomm $snmphost interfaces.ifTable.ifEntry.ifDescr`); $ifnr = null; foreach ($iflist as $ifdesc) { -- 2.43.0