Expose CPU and Memory Information via SNMP
Issue
How do I expose CPU and memory statistics via SNMP? What is the MIB/OID?
Environment
- Cumulus Linux, all versions
Resolution
The relevant OIDs are:
- CPU: .1.3.6.1.4.1.2021.11 (UCD-SNMP-MIB::systemStats)
- Memory: .1.3.6.1.4.1.2021.4 (UCD-SNMP-MIB::memory)
To configure SNMP to expose CPU and memory information:
-
If you did not enable
snmpd
already, follow instructions in the technical documentation to enable and startsnmpd
. -
Allow access to the OIDs by editing
/etc/snmp/snmpd.conf
. The following example adds the relevant MIBs to thesystemonly
view.############################################################################### # # ACCESS CONTROL # <CONFIGURATION_TRUNCATED/> # Cumulus specific view systemonly included .1.3.6.1.4.1.40310.1 view systemonly included .1.3.6.1.4.1.40310.2 # Memory utilization view systemonly included .1.3.6.1.4.1.2021.4 # CPU utilization view systemonly included .1.3.6.1.4.1.2021.11
-
Restart
snmpd
to reload the configuration:cumulus@switch:~$ sudo service snmpd restart