Linux SNMP OID’s for CPU,Memory and Disk Statistics

SNMP stands for Simple Network Management Protocol and consists of three key components: managed devices, agents, and network-management systems (NMSs). A managed device is a node that has an SNMP agent and resides on a managed network. These devices can be routers and access server, switches and bridges, hubs, computer hosts, or printers. An agent is a software module residing within a device. This agent translates information into a compatible format with SNMP. An NMS runs monitoring applications. They provide the bulk of processing and memory resources required for network management.

SNMP MIBs, OIDs Overview

MIB stands for Management Information Base and is a collection of information organized hierarchically. These are accessed using a protocol such as SNMP. There are two types of MIBs: scalar and tabular. Scalar objects define a single object instance whereas tabular objects define multiple related object instances grouped in MIB tables.
MIB files for specific devices or systems can be downloaded from here

OIDs or Object Identifiers uniquely identify manged objects in a MIB hierarchy. This can be depicted as a tree, the levels of which are assigned by different organizations. Top level MIB object IDs (OIDs) belong to different standard organizations. Vendors define private branches including managed objects for their own products.

Here is a sample structure of an OID

Iso (1).org(3).dod(6).internet(1).private(4).transition(868).products(2).chassis(4).card(1).slotCps(2)­

Most of the people may be looking for OID’s for Linux OID’s for CPU,Memory and Disk Statistics for this first you need to install SNMP server and clients. If you want to install SNMP server and client installation in linux check here

CPU Statistics

1 minute Load: .
5 minute Load: .
15 minute Load: .

percentage of user CPU time: .
raw user cpu time: .
percentages of system CPU time: .
raw system cpu time: .
percentages of idle CPU time: .
raw idle cpu time: .
raw nice cpu time: .

Memory Statistics

Total Swap Size: .
Available Swap Space: .
Total RAM in machine: .
Total RAM used: .
Total RAM Free: .
Total RAM Shared: .
Total RAM Buffered: .
Total Cached Memory: .

Disk Statistics

The snmpd.conf needs to be edited. Add the following (assuming a machine with a single ‘/’ partition):

disk / 100000 (or)

includeAllDisks 10% for all partitions and disks

The OIDs are as follows

Path where the disk is mounted: .
Path of the device for the partition: .
Total size of the disk/partion (kBytes): .
Available space on the disk: .
Used space on the disk: .
Percentage of space used on disk: .
Percentage of inodes used on disk: .

System Uptime: .


These Commands you need to run on the SNMP server

Get available disk space for / on the target host

#snmpget -v 1 -c “community” target_name_or_ip .

this will return available disk space for the first entry in the ‘disk’ section of snmpd.conf; replace 1 with n for the nth entry

Get the 1-minute system load on the target host

#snmpget -v 1 -c “community” target_name_or_ip .

Get the 5-minute system load on the target host

#snmpget -v 1 -c “community” target_name_or_ip .

Get the 15-minute system load on the target host

#snmpget -v 1 -c “community” target_name_or_ip .

Get amount of available swap space on the target host

#snmpget -v 1 -c “community” target_name_or_ip .

Sponsored Link

27 thoughts on “Linux SNMP OID’s for CPU,Memory and Disk Statistics

  1. There is an error on description for OID .
    It is not “Total RAM used” as stated here, but instead, is the available real memory.

  2. You are right, Eduardo.

    The Mem info coming from OIDs and is the just the free Swap memory and the free RAM memory in the machine. So, you can get the used Swap memory and the RAM used memory doing the difference between the Total Swap memory and the free Swap memory for the used Swap memory, and the difference between the Total RAM memory and the free RAM memory for the used RAM memory.

    The OID is for the Total free memory in the machine (free Swap memory + free RAM memory).


  3. Hye does anyone know the OID for getting the remote timestamp from the machine that you are querying? if so It would be much appreciated.



  4. Looks like the following OID returns current date/time


    # date;snmpwalk -Cc -On -v2c -c public localhost .
    Thu May 21 14:21:47 CDT 2009
    . = STRING: Thu May 21 14:21:47 2009

  5. Nice article, thanks. But that error in Total RAM used: . screwed me up. Can you fix that in your article?

    Also, something that may be helpful: According to ( if we did this we could get a reasonable reading of our memory:

    (Used – buffers – cached) / Total * 100 = % memory used

    So you could get the following (expressed as Perl code):

    my $memRealTotalOID = '.';
    my $memRealAvailOID = '.';
    my $memRealBuffersOID = '.';
    my $memRealCachedOID = '.';
    # Memory Calculations
    my $memRealUsed = $memRealTotal - $memRealAvail;

    Then you can alert on % RAM used:

    my $realPercent = (($memRealUsed - $memRealBuffers - $memRealCached )/ $memRealTotal) * 100;

    Hope this helps.

  6. Very good article!

    But I have a question about monitoring multicore CPUs.
    Is it possible to get load of each core via SNMP ?
    If so – wchich OID do I have to watch?


  7. hi,

    unable to get the disk details.Please let me know how get the details like totaldisk,useddisk and availdisk

    Thanks in advance

  8. @Srinu

    For disk info,

    On ubuntu:

    sudo snmpwalk -c public -v 2c ‘ip address’ .
    sudo snmpwalk -0 n -c public -v 2c ‘ip address’ .

    That output will show you all you need to know and the relationships with your storage devices.

    As root user on linux/unix, just remove the sudo from above.

    Good Luck!

  9. Careful, “.” is not server uptime, it is the uptime of the SNMPd instance…
    The right OID for system (e.g. since last boot) uptime is “.”.


  10. I am trying to monitor debian machine in amazon cloud and the oids which you define here doesnt work for them. everytime i use them i get following error

    snmpget -v 1 -c public targetip .

    Error in packet
    Reason: (noSuchName) There is no such variable name in this MIB.
    Failed object: UCD-SNMP-MIB::laLoad.2

    Could you give me some suggestion how to fix this.


  11. there was something wrong with my /etc/snmp/snmpd.conf file. i copy the original snmpd.conf and only change the following section and it started working fine. However the oids which you mentioned still did not work for me. so i saw in my snmpd.conf and there were oids mentioned for load avg cpu usage, i used those and everything was good.

    # source community
    #com2sec paranoid default public
    com2sec local localhost public
    com2sec localnet “requesting servers ip address” public
    #com2sec readwrite default private

    # Second, map the security names into group names:

    # sec.model
    group MyROSystem v1 local
    group MyROSystem v2c local
    group MyROSystem usm local
    group MyROGroup v1 localnet
    group MyROGroup v2c localnet
    group MyROGroup usm localnet
    group MyRWGroup v1 local
    group MyRWGroup v2c local
    group MyRWGroup usm local

  12. I cannot get to the /snmp.html page… how can I get to that content. I need help in configuring cpu utilization alerts in snmpd.conf…

  13. Hi,
    I am unable to get Percentage of Disk Space by using the above SNMP Oid , Please help me out
    Percentage of space used on disk: .


  14. How about monitoring S.M.A.R.T. values on the hard drives? Or at least, the general health status?

  15. Hye does anyone know the OID for getting the remote timestamp from the machine that you are querying? if so It would be much appreciated.

  16. OID for real system uptime is .

    . shows how long SNMP process has been running.

    $ snmpwalk -v 2c -c public srv .
    iso. = Timeticks: (646569178) 74 days, 20:01:31.78
    $ snmpwalk -v 2c -c public srv .
    iso. = Timeticks: (25678087) 2 days, 23:19:40.87

  17. Can you please add serial number, operation system and Model number OIDS….Thanks

  18. Is it possible to get from SNMP information about interfave status? There is an OID for this:

    Is it required to configure OS or snmpd ?


Leave a comment

Your email address will not be published. Required fields are marked *