Red Hat Bugzilla – Bug 119688
net-snmp does not support new meminfo format
Last modified: 2007-11-30 17:10:39 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6)
Description of problem:
net-snmp is still querying memory (and CPU statistics) based on old
2.4-style file formats in /proc/stat and /proc/meminfo. The data
gathering routines need to be updated for the new file formats.
See the attached patch.
The only questionable choice I made was to include iowait with idle
cpu rather than breaking it out into its own field. Net-SNMP has
support for returning iowait, so it could theoretically return it. I
just wasn't quite sure how to do it properly. This minimal patch at
least returns data that can accurately be compared with data that was
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. start snmp
2. query memory or systemStats tables
Actual Results: memory is just completely wrong. systemStats cpu
counters don't give the complete CPU information.
Expected Results: memory is right. systemStats at least give ALL
counters, even if they are summed in with others.
Created attachment 99038 [details]
patch for memory and cpu gathering
This patch affects the memory and cpu gathering stats. It also includes
support for gathering very large memory statistics. No guarantees for
Created attachment 99039 [details]
The prior patch was still dividing the memory total by 1024 even though it was
already reading a value in kB. This patch removes the 1024 line.
The patch seems to be a little buggy:
You define static unsigned row[MAX_ROW + 1] and sometimes use it as a
char (as expected), other times you assigne a long value to it (row[i]
I'll take a look at it over the next few days, but i general i agree
that the memory reporting needs to be adapted to the latest kernel.
Read ya, Phil
Yeah, it's rough and dirty. It definitely works though (been using it
in production for over a week now). Feel free to correct the messy parts.
Any news on this? I'd love to get rid of all these lines in /var/log/messages
Aug 28 06:30:05 10.0.10.3 snmpd: No page line in /proc/stat
Aug 28 06:30:05 10.0.10.3 snmpd: No swap line in /proc/stat
which I assume is the same problem here..
This problem was fixed in upstream and might not have appear in
net-snmp-5.1.2 version. Paul, which version are you using now?