]> git.pld-linux.org Git - packages/net-snmp.git/blob - net-snmp-logging.patch
- do not allow hrSWInstalledTable query to use dpkg-query even if it finds it; REL 6
[packages/net-snmp.git] / net-snmp-logging.patch
1 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=475158
2 snmpd: keeps complaining on missing /proc/ stats inside vserver flooding syslog
3
4 diff -r -u net-snmp-5.4.1~dfsg/agent/mibgroup/hardware/cpu/cpu_linux.c net-snmp-5.4.1~dfsg.puck/agent/mibgroup/hardware/cpu/cpu_linux.c
5 --- net-snmp-5.4.1~dfsg/agent/mibgroup/hardware/cpu/cpu_linux.c 2007-02-16 00:09:45.000000000 +1300
6 +++ net-snmp-5.4.1~dfsg.puck/agent/mibgroup/hardware/cpu/cpu_linux.c    2009-05-04 14:35:53.000000000 +1200
7 @@ -249,7 +249,7 @@
8              cpu->pageOut = (unsigned long)pout;
9         } else {
10             if (first)
11 -               snmp_log(LOG_ERR, "No page line in %s\n", STAT_FILE);
12 +               snmp_log(LOG_INFO, "No page line in %s\n", STAT_FILE);
13              cpu->pageIn  = cpu->pageOut = 0;
14         }
15         b = strstr(buff, "swap ");
16 @@ -259,7 +259,7 @@
17              cpu->swapOut = (unsigned long)swpout;
18         } else {
19             if (first)
20 -               snmp_log(LOG_ERR, "No swap line in %s\n", STAT_FILE);
21 +               snmp_log(LOG_INFO, "No swap line in %s\n", STAT_FILE);
22              cpu->swapIn  = cpu->swapOut = 0;
23         }
24      }
25 diff -r -u net-snmp-5.4.1~dfsg/agent/mibgroup/ucd-snmp/vmstat_linux.c net-snmp-5.4.1~dfsg.puck/agent/mibgroup/ucd-snmp/vmstat_linux.c
26 --- net-snmp-5.4.1~dfsg/agent/mibgroup/ucd-snmp/vmstat_linux.c  2006-09-15 12:48:50.000000000 +1200
27 +++ net-snmp-5.4.1~dfsg.puck/agent/mibgroup/ucd-snmp/vmstat_linux.c     2009-05-04 14:35:32.000000000 +1200
28 @@ -316,7 +316,7 @@
29             sscanf(b, "page %u %u", pin, pout);
30         else {
31             if (first)
32 -               snmp_log(LOG_ERR, "No page line in %s\n", STAT_FILE);
33 +               snmp_log(LOG_INFO, "No page line in %s\n", STAT_FILE);
34             *pin = *pout = 0;
35         }
36         b = strstr(buff, "swap ");
37 @@ -324,7 +324,7 @@
38             sscanf(b, "swap %u %u", swpin, swpout);
39         else {
40             if (first)
41 -               snmp_log(LOG_ERR, "No swap line in %s\n", STAT_FILE);
42 +               snmp_log(LOG_INFO, "No swap line in %s\n", STAT_FILE);
43             *swpin = *swpout = 0;
44         }
45      }
46 --- net-snmp-5.7.1/./agent/mibgroup/hardware/cpu/cpu_linux.c~   2011-12-27 15:05:21.000000000 +0200
47 +++ net-snmp-5.7.1/./agent/mibgroup/hardware/cpu/cpu_linux.c    2011-12-27 15:06:39.795180506 +0200
48 @@ -320,5 +320,7 @@
49         if (first)
50             snmp_log(LOG_ERR, "No ctxt line in %s\n", STAT_FILE);
51      }
52 +
53 +       first = 0;
54  }
55  
56 --- net-snmp-5.7.1/./agent/mibgroup/ucd-snmp/diskio.c~  2011-09-28 07:53:47.000000000 +0300
57 +++ net-snmp-5.7.1/./agent/mibgroup/ucd-snmp/diskio.c   2011-12-27 16:33:10.128099629 +0200
58 @@ -979,7 +979,8 @@
59  {
60      FILE* parts;
61      time_t now;
62 -    
63 +    static int first = 1;
64 +
65      now = time(NULL);
66      if (cache_time + CACHE_TIMEOUT > now) {
67          return 0;
68 @@ -1024,7 +1025,11 @@
69         int rc;
70         parts = fopen("/proc/partitions", "r");
71         if (!parts) {
72 -           snmp_log_perror("/proc/partitions");
73 +           if (first) {
74 +               // log error only once
75 +               snmp_log_perror("/proc/partitions");
76 +               first = 0;
77 +           }
78             return 1;
79         }
80  
This page took 0.030796 seconds and 3 git commands to generate.