SNMP shows wrong memory details if server has more than 3TB

Issues related to applications and software problems
Post Reply
rravi205
Posts: 3
Joined: 2018/11/29 03:53:25

SNMP shows wrong memory details if server has more than 3TB

Post by rravi205 » 2018/11/29 04:08:28

All my dell servers which have above 3TB memory do not provide correct memory details from SNMP Walk. I use snmp to monitor the servers using nagios. I don't see this issue on the servers which have less than 3TB memory.

Is there any bug in the snmp & would like to know the fix.



snmpwalk -v2c -c public localhost .1.3.6.1.4.1.2021.4
UCD-SNMP-MIB::memIndex.0 = INTEGER: 0
UCD-SNMP-MIB::memErrorName.0 = STRING: swap
UCD-SNMP-MIB::memTotalSwap.0 = INTEGER: 524287984 kB
UCD-SNMP-MIB::memAvailSwap.0 = INTEGER: 523707996 kB
UCD-SNMP-MIB::memTotalReal.0 = INTEGER: -1118190100 kB
UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 1721659204 kB
UCD-SNMP-MIB::memTotalFree.0 = INTEGER: -2049600096 kB
UCD-SNMP-MIB::memMinimumSwap.0 = INTEGER: 16000 kB
UCD-SNMP-MIB::memBuffer.0 = INTEGER: 405176 kB
UCD-SNMP-MIB::memCached.0 = INTEGER: 704223420 kB
UCD-SNMP-MIB::memSwapError.0 = INTEGER: noError(0)
UCD-SNMP-MIB::memSwapErrorMsg.0 = STRING:

$free -g
total used free shared buffers cached
Mem: 3029 1362 1667 0 0 669
-/+ buffers/cache: 692 2337
Swap: 499 0 499


$ uname -a
Linux localhost 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

# rpm -qa net-snmp*
net-snmp-perl-5.5-54.el6.x86_64
net-snmp-devel-5.5-54.el6.x86_64
net-snmp-libs-5.5-54.el6.x86_64
net-snmp-utils-5.5-54.el6.x86_64
net-snmp-libs-5.5-54.el6.i686
net-snmp-5.5-54.el6.x86_64
net-snmp-python-5.5-54.el6.x86_64

Thanks,
Ravi

aks
Posts: 2567
Joined: 2014/09/20 11:22:14

Re: SNMP shows wrong memory details if server has more than 3TB

Post by aks » 2018/11/29 18:15:29

As net-snmp is your agent:

hrMemorySize INTEGER32
Legal values: 0 .. 2147483647
KBytes ReadOnly .1.3.6.1.2.1.25.2.2
Note: this object is based on the KBytes TEXTUAL-CONVENTION.
The amount of physical read-write main memory, typically RAM, contained by the host.
Source: http://www.net-snmp.org/docs/mibs/host. ... ar_current

"Is there any bug in the snmp & would like to know the fix."
No it's not a bug, download the code and fix, simple really.

SNMP is a really awesome thing ('cause it's sort of simple, apart from the many known problems).
Don't use it for large systems for those sort of systems (and you have to much dollars!)

rravi205
Posts: 3
Joined: 2018/11/29 03:53:25

Re: SNMP shows wrong memory details if server has more than 3TB

Post by rravi205 » 2018/11/30 10:53:40

>>No it's not a bug, download the code and fix, simple really.

Kindly elaborate what code need to be downloaded & fixed

User avatar
TrevorH
Forum Moderator
Posts: 24052
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: SNMP shows wrong memory details if server has more than 3TB

Post by TrevorH » 2018/11/30 11:37:09

I don't think you can fix this easily. The hrMemorySize counter is defined as INTEGER so has a maximum valud of 2^32-1 (2TB since the units involved are 1KB each). I am not sure why you think this error only occurs on 3TB as I am 99.99% sure that the problem will happen on any system with 2TB or more installed. The only way in which this could be fixed would be if the type of field was altered to allow more than 2^32 and that field is defined in various RFCs as being limited to 2TB. The only way I can think of in which you might fix this would be to alter the units that it uses so instead of returning 2^32 x 1KB, it used a higher value like 1MB but then that would confuse everything else that uses that field.

So rather than "No it's not a bug, download the code and fix, simple really." it's more a "No, it's not a bug. Please start a discussion about amending the RFC to report values > 2TB on one of the net-snmp mailing lists".
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
avij
Forum Moderator
Posts: 2766
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: SNMP shows wrong memory details if server has more than 3TB

Post by avij » 2018/11/30 11:56:07

As far as I'm aware, SNMP version 2c and up support 64bit counters.

User avatar
TrevorH
Forum Moderator
Posts: 24052
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: SNMP shows wrong memory details if server has more than 3TB

Post by TrevorH » 2018/11/30 12:00:38

They do but the RFC defines this field as INTEGER, 32 bit...
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

rravi205
Posts: 3
Joined: 2018/11/29 03:53:25

Re: SNMP shows wrong memory details if server has more than 3TB

Post by rravi205 » 2018/11/30 17:14:53

Thanks @TrevorH for the clarification. I will try to contact the SNMP mailing list on this issue.

Post Reply