While monitoring memory usage for some Cisco Nexus 9000 switches, I noticed an incorrect memory information from the "Cisco Nexus 9000 Series by SNMP" template, "Memory discovery" LLD.
Also, the template still uses the old SNMP discovery method. It's not bad per se, but could be updated to the walk method.
For the "Memory discovery", we see the item prototypes with the following OIDs
- "Used memory" - "1.3.6.1.4.1.9.9.221.1.1.1.1.7" (cempMemPoolUsed)
- "Free memory" - "1.3.6.1.4.1.9.9.221.1.1.1.1.8" (cempMemPoolFree)
These OIDs are not appropriate because they only provide 32-bit values.
The device also reports a free memory overflow with OID "1.3.6.1.4.1.9.9.221.1.1.1.1.19". This particular value indicates that the free memory pool value exceeds 32-bit.
When we check the device memory, we see the discrepancy. The SNMP OIDs show much less free memory than what the device shows.
$ snmpbulkwalk -v 2c -c [community] [device.ip] -Oe -Ot -On 1.3.6.1.4.1.9.9.221.1.1.1.1.8 .1.3.6.1.4.1.9.9.221.1.1.1.1.8.22.1 = Gauge32: 1004048384 .1.3.6.1.4.1.9.9.221.1.1.1.1.8.23.1 = Gauge32: 706064384 .1.3.6.1.4.1.9.9.221.1.1.1.1.8.24.1 = Gauge32: 120156160 .1.3.6.1.4.1.9.9.221.1.1.1.1.8.43.1 = Gauge32: 879243264 .1.3.6.1.4.1.9.9.221.1.1.1.1.8.44.1 = Gauge32: 886362112 .1.3.6.1.4.1.9.9.221.1.1.1.1.8.45.1 = Gauge32: 885133312 .1.3.6.1.4.1.9.9.221.1.1.1.1.8.47.1 = Gauge32: 886435840 .1.3.6.1.4.1.9.9.221.1.1.1.1.8.48.1 = Gauge32: 2769399808 .1.3.6.1.4.1.9.9.221.1.1.1.1.8.49.1 = Gauge32: 4205068288 .1.3.6.1.4.1.9.9.221.1.1.1.1.8.50.1 = Gauge32: 1469542400 .1.3.6.1.4.1.9.9.221.1.1.1.1.8.51.1 = Gauge32: 1464926208
SWITCHN9K# sh system internal memory-usage-per-module Slot 01: Used:3021512704 bytes, Free:5298593792 bytes, Total:8320106496 bytes Slot 02: Used:3319713792 bytes, Free:5000392704 bytes, Total:8320106496 bytes Slot 03: Used:3905114112 bytes, Free:4414992384 bytes, Total:8320106496 bytes Slot 22: Used:3001999360 bytes, Free:13764710400 bytes, Total:16766709760 bytes Slot 23: Used:2995970048 bytes, Free:13770747904 bytes, Total:16766717952 bytes Slot 24: Used:2997198848 bytes, Free:13769519104 bytes, Total:16766717952 bytes Slot 26: Used:2995339264 bytes, Free:13771370496 bytes, Total:16766709760 bytes Slot 27: Used:9703735296 bytes, Free:7000530944 bytes, Total:16704266240 bytes Slot 28: Used:8203976704 bytes, Free:8500289536 bytes, Total:16704266240 bytes Slot 29: Used:653111296 bytes, Free:1469542400 bytes, Total:2122653696 bytes Slot 30: Used:657481728 bytes, Free:1465171968 bytes, Total:2122653696 bytes
A better OID for the memory items is the following because they are 64-bit values.
- "Used memory" - "1.3.6.1.4.1.9.9.221.1.1.1.1.18" (cempMemPoolHCUsed)
- "Free memory" - "1.3.6.1.4.1.9.9.221.1.1.1.1.20" (cempMemPoolHCFree)