File: 02_statistics.patch

package info (click to toggle)
net-snmp 5.7.2.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 34,348 kB
  • sloc: ansic: 268,086; sh: 18,217; perl: 17,235; makefile: 3,702; xml: 508; python: 495; pascal: 124; sql: 47
file content (26 lines) | stat: -rw-r--r-- 1,084 bytes parent folder | download | duplicates (2)
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;