1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
This patch ignores interfaces without statistics.
Index: net-snmp-5.7.2~dfsg/agent/mibgroup/mibII/interfaces.c
===================================================================
--- net-snmp-5.7.2~dfsg.orig/agent/mibgroup/mibII/interfaces.c 2013-01-07 12:53:22.545808176 +0900
+++ net-snmp-5.7.2~dfsg/agent/mibgroup/mibII/interfaces.c 2013-01-07 12:53:22.541808167 +0900
@@ -1592,6 +1592,10 @@
struct ifnet *nnew;
char *stats, *ifstart = line;
+ /* Ignore interfaces with no statistics. */
+ if (strstr(line, "No statistics available."))
+ continue;
+
if (line[strlen(line) - 1] == '\n')
line[strlen(line) - 1] = '\0';
@@ -1624,7 +1628,7 @@
&coll) != 5)) {
if ((scan_line_to_use == scan_line_2_2)
&& !strstr(line, "No statistics available"))
- snmp_log(LOG_ERR,
+ snmp_log(LOG_DEBUG,
"/proc/net/dev data format error, line ==|%s|",
line);
continue;
|