Version 6 (modified by human, 10 years ago) (diff)



Net-SNMP is the F/OSS SNMP agent for POSIX-compatible systems.


Monitoring CPU Usage

Monitoring Memory Usage

Monitoring Network Interface Traffic

Monitoring File System Capacity

Monitoring Processes

Monitoring Uptime

Monitoring TCP/UDP (L4) Sockets

Monitoring Disk I/O Activity

Fixed Disk Storage Device usage access statistics are provided by the UCD-DISKIO-MIB as implemented by the Net-SNMP agent. There is a convenient table in the MIB that maps the I/O operations, bytes read/written, and average load from each device probed by the kernel: UCD-DISKIO-MIB::diskioTable

Example output:

system% snmptable -v2c -c [string] localhost diskIOTable    
SNMP table: UCD-DISKIO-MIB::diskIOTable

 diskIOIndex diskIODevice diskIONRead diskIONWritten diskIOReads diskIOWrites diskIOLA1 diskIOLA5 diskIOLA15 diskIONReadX diskIONWrittenX
           1          da0    93798944     2122439680     1481216     11776749         1         1          1  34453537312    268410412032
           2          da1    52808736     2122439680     1481217     11776749         1         1          1  34412547104    268410412032

  • Time-metered load averages for the last 1, 5, or 15 minutes are represented in UCD-DISKIO-MIB by diskIOLA[1|5|15](if your agent supports them):

The [1|5|15] minute average load of disk (%)"

  • diskION[Read|Written] is defined in the MIB as:

The number of bytes read/writen from/to this device since boot.

Note: diskIONReadX|diskIONWrittenX provide Counter64 versions

  • diskIO[Writes|Reads] identifies operations, not bytes:

The number of write/read accesses to this device since boot.

Note: diskIOwrites numbers provide a read-operations count, which, depending on how the Net-SNMP agent code for the UCD-DISKIO-MIB is implemented in your operating system, is likely the number of read()/write() calls from the VFS layer to the device driver within the kernel. Each read operation will result in a byte count from the device sector size identified in (256/512/1024/2048/4096-byte allocation units per HOST-RESOURCES-MIB::hrStorageTable)


$ snmptable -v2c -c [community] localhost  hrStorageTable
SNMP table: HOST-RESOURCES-MIB::hrStorageTable

 hrStorageIndex                                hrStorageType         hrStorageDescr hrStorageAllocationUnits hrStorageSize hrStorageUsed hrStorageAllocationFailures
              1         HOST-RESOURCES-TYPES::hrStorageOther         Memory Buffers                256 Bytes             0        178772                           0
              2           HOST-RESOURCES-TYPES::hrStorageRam            Real Memory               4096 Bytes        198876         38467                           0
              3 HOST-RESOURCES-TYPES::hrStorageVirtualMemory             Swap Space               4096 Bytes        524256         19580                           0
              4         HOST-RESOURCES-TYPES::hrStorageOther Memory Buffer Clusters               1024 Bytes         25600       -184744                           0
              5     HOST-RESOURCES-TYPES::hrStorageFixedDisk                      /               2048 Bytes        506487         30268                           0
              6     HOST-RESOURCES-TYPES::hrStorageFixedDisk                   /dev                512 Bytes             2             2                           0
              7     HOST-RESOURCES-TYPES::hrStorageFixedDisk                   /opt               2048 Bytes      56734705 

Graphing the Data in MRTG:

  • Average Load

Unlike most I/O OIDs, this is an Integer/Counter?-type data that you would graph like CPU Usage:

    SYNTAX      Integer32 (0..100)
    MAX-ACCESS  read-only
    STATUS      current
        "The 1 minute average load of disk (%)"
    ::= { diskIOEntry 9 }
  • I/O Operations

This data is stored in the MIB as a Counter32 variable. You can graph non-linear growth overall to observe patterns (which will reset when the integer overlaps at 232) or you can graph "usage" by letting MRTG calculate bytes/second using the "non-gauge" method.

Examples of both are seen below.

To ensure that MRTG can reference individuals cells of the table, ensure that MRTG parses the MIB file for UCD-DISKIO-MIB on your system:

LoadMIBs: /usr/local/share/snmp/mibs/UCD-DISKIO-MIB.txt


PageTop[hostname.diskio.bytes]: <h1>Bytes Read/Written gm0</h1>
ShortLegend[hostname.diskio.bytes]: Bytes: 
YLegend[hostname.diskio.bytes]: Bytes: 
LegendI[hostname.diskio.bytes]: Bytes Read:
LegendO[hostname.diskio.bytes]: Bytes Written: 
Legend1[hostname.diskio.bytes]: Bytes Read: 
Legend2[hostname.diskio.bytes]: Bytes Written: 

Target[hostname.diskio.bytestotal]: diskIONRead.1&diskIONWritten.1:community@hostname
Maxbytes[hostname.diskio.bytestotal]: 4294967295
Options[hostname.diskio.bytestotal]: nopercent,gauge,growright
Title[hostname.diskio.bytestotal]: Bytes Read/Written gm0 total
PageTop[hostname.diskio.bytestotal]: <h1>Bytes Read/Written gm0 total</h1>
ShortLegend[hostname.diskio.bytestotal]: Bytes: 
YLegend[hostname.diskio.bytestotal]: Bytes: 
LegendI[hostname.diskio.bytestotal]: Bytes Read:
LegendO[hostname.diskio.bytestotal]: Bytes Written: 
Legend1[hostname.diskio.bytestotal]: Bytes Read: 
Legend2[hostname.diskio.bytestotal]: Bytes Written: 
kMG[hostname.diskio.bytestotal]: k,M,G,T,P,X


And to graph I/O operations (both "usage" and "total"):

Target[]: diskIOWrites.1&diskIOReads.1:community@system
Maxbytes[]: 1000000000
Options[]: nopercent,growright
Title[]: Read/Write I/O ops gm0 (not bytes)
PageTop[]: <h1>Reads/Write I/O ops gm0 (not bytes)</h1>
ShortLegend[]: IOs: 
YLegend[]: IOs: 
LegendI[]: Writes
LegendO[]: Reads
Legend1[]: Writes
Legend2[]: Reads

Target[system.diskio.rwtotal]: diskIOWrites.1&diskIOReads.1:community@system
Maxbytes[system.diskio.rwtotal]: 10000000000
Options[system.diskio.rwtotal]: nopercent,gauge,growright
Title[system.diskio.rwtotal]: Reads/Write I/O ops gm0 total (not bytes)
PageTop[system.diskio.rwtotal]: <h1>Reads/Write I/O ops gm0 total (not bytes)</h1>
ShortLegend[system.diskio.rwtotal]: IOs: 
YLegend[system.diskio.rwtotal]: IOs: 
LegendI[system.diskio.rwtotal]: Writes
LegendO[system.diskio.rwtotal]: Reads
Legend1[system.diskio.rwtotal]: Writes
Legend2[system.diskio.rwtotal]: Reads
kMG[system.diskio.rwtotal]: k,M,G,T,P,X

And associated screenshot:

This section was contributed by Brian A. Seklecki <bseklecki@…> and Sean Mcafee <smcfaee@…>


NOTE: The content of this website is accessible with any browser. The graphical design though relies completely on CSS2 styles. If you see this text, this means that your browser does not support CSS2. Consider upgrading to a standard conformant browser like Mozilla Firefox or Opera but also Apple's Safari or KDE's Konqueror for example.