]>
Commit | Line | Data |
---|---|---|
0b08da3b ER |
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 | } | |
61bd956b ER |
46 | --- net-snmp-5.7.1/./agent/mibgroup/ucd-snmp/diskio.c~ 2011-09-28 07:53:47.000000000 +0300 |
47 | +++ net-snmp-5.7.1/./agent/mibgroup/ucd-snmp/diskio.c 2011-12-27 16:33:10.128099629 +0200 | |
48 | @@ -979,7 +979,8 @@ | |
49 | { | |
50 | FILE* parts; | |
51 | time_t now; | |
52 | - | |
53 | + static int first = 1; | |
54 | + | |
55 | now = time(NULL); | |
56 | if (cache_time + CACHE_TIMEOUT > now) { | |
57 | return 0; | |
58 | @@ -1024,7 +1025,11 @@ | |
59 | int rc; | |
60 | parts = fopen("/proc/partitions", "r"); | |
61 | if (!parts) { | |
62 | - snmp_log_perror("/proc/partitions"); | |
63 | + if (first) { | |
64 | + // log error only once | |
65 | + snmp_log_perror("/proc/partitions"); | |
66 | + first = 0; | |
67 | + } | |
68 | return 1; | |
69 | } | |
70 |