Monitoring disk IO with Net-SNMP
From OpenNMS
There are two ways of accomplishing this, depending on your OpenNMS version. If you are using 1.3.2 or above, you can make use of the new arbitrary index Collectd code. If you are using a version prior to that, you will need to create repeating mibObj entities in datacollection-config.xml and multiple report definitions in snmp-graph.properties. This is pretty tedious, and yet another fantastic reason to use 1.3.2 or above.
Contents |
Net SNMP Requirements
I have tested this with net-snmp 5.3.1 and 5.4. If you compile net-snmp yourself, you will need to include the ucd-snmp/diskio MIB module at compilation time thus:
./configure --with-mib-modules=ucd-snmp/diskio
Pre 1.3.2
datacollection-config.xml
Add a new group to collect IO stats from the ucd mib. Note that you'll need to add additional instaces of name, rbyte, wbyte, read and write for each instance that you expect to collect. The dell 2850s with two internal disks that I collect on presented instance 1 for the first hardware raid device and and instance 11 for the second. As ever, your mileage may vary.
<group name = "ucd-diskio" ifType = "ignore">
<mibObj oid=".1.3.6.1.4.1.2021.13.15.1.1.2" instance="1" alias="ucd-io-1-name" type="string"/>
<mibObj oid=".1.3.6.1.4.1.2021.13.15.1.1.3" instance="1" alias="ucd-io-1-rbyte" type="counter"/>
<mibObj oid=".1.3.6.1.4.1.2021.13.15.1.1.4" instance="1" alias="ucd-io-1-wbyte" type="counter"/>
<mibObj oid=".1.3.6.1.4.1.2021.13.15.1.1.5" instance="1" alias="ucd-io-1-read" type="counter"/>
<mibObj oid=".1.3.6.1.4.1.2021.13.15.1.1.6" instance="1" alias="ucd-io-1-write" type="counter"/>
</group>
Then add that group to the Net-SNMP systemDef. By adding this to the standard Net-SNMP systemDef, you'll get these stats collected by default. Note that my example does not contain net-snmp-cpu as I have a separate collection for those metrics (depending on my linux kernel version).
<systemDef name = "Net-SNMP">
<sysoidMask>.1.3.6.1.4.1.8072.3.</sysoidMask>
<collect>
<includeGroup>mib2-host-resources-storage</includeGroup>
<includeGroup>mib2-host-resources-system</includeGroup>
<includeGroup>mib2-host-resources-memory</includeGroup>
<includeGroup>net-snmp-disk</includeGroup>
<includeGroup>ucd-loadavg</includeGroup>
<includeGroup>ucd-memory</includeGroup>
<includeGroup>ucd-sysstat</includeGroup>
<includeGroup>ucd-diskio</includeGroup>
</collect>
</systemDef>
Restart OpenNMS and you should get this collected.
snmp-graph.properties
in the reports section, add:
ucddiskbytesio.disk1, ucddiskaccess.disk1, \
somewhere around your existing net-snmp reports. Then, further down:
report.ucddiskbytesio.disk1.name=Disk bytes IO on 1
report.ucddiskbytesio.disk1.columns=ucd-io-1-rbyte, ucd-io-1-wbyte
report.ucddiskbytesio.disk1.type=node
report.ucddiskbytesio.disk1.propertiesValues=ucd-io-1-name
report.ucddiskbytesio.disk1.command=--title="bytes read/written on {ucd-io-1-name}" \
DEF:rbytes={rrd1}:ucd-io-1-rbyte:AVERAGE \
DEF:wbytes={rrd2}:ucd-io-1-wbyte:AVERAGE \
LINE2:rbytes#00ff00:" bytes read" \
GPRINT:rbytes:AVERAGE:" Avg \\: %8.2lf %s" \
GPRINT:rbytes:MIN:"Min \\: %8.2lf %s" \
GPRINT:rbytes:MAX:"Max \\: %8.2lf %s\n" \
LINE2:wbytes#ff0000:"bytes written" \
GPRINT:wbytes:AVERAGE:"Avg \\: %8.2lf %s" \
GPRINT:wbytes:MIN:"Min \\: %8.2lf %s" \
GPRINT:wbytes:MAX:"Max \\: %8.2lf %s\n"
report.ucddiskaccess.disk1.name=Disk access on 1
report.ucddiskaccess.disk1.columns=ucd-io-1-read, ucd-io-1-write
report.ucddiskaccess.disk1.type=node
report.ucddiskaccess.disk1.propertiesValues=ucd-io-1-name
report.ucddiskaccess.disk1.command=--title="disk access on {ucd-io-1-name}" \
DEF:reads={rrd1}:ucd-io-1-read:AVERAGE \
DEF:writes={rrd2}:ucd-io-1-write:AVERAGE \
LINE2:reads#00ff00:" reads" \
GPRINT:reads:AVERAGE:" Avg \\: %8.2lf %s" \
GPRINT:reads:MIN:"Min \\: %8.2lf %s" \
GPRINT:reads:MAX:"Max \\: %8.2lf %s\n" \
LINE2:writes#ff0000:"writes" \
GPRINT:writes:AVERAGE:"Avg \\: %8.2lf %s" \
GPRINT:writes:MIN:"Min \\: %8.2lf %s" \
GPRINT:writes:MAX:"Max \\: %8.2lf %s\n"
1.3.2
datacollection-config.xml
Create a new resourceType for the index we will use (ucdDiskIOIndex):
<resourceType name="ucdDiskIOIndex" label="Disk IO (UCD MIB)">
<persistenceSelectorStrategy class="org.opennms.netmgt.collectd.PersistAllSelectorStrategy"/>
<storageStrategy class="org.opennms.netmgt.dao.support.IndexStorageStrategy"/>
</resourceType>
Create a new group for the collection. The instance needs to be set to the same name as the new resource type created above.
<group name="ucd-diskio" ifType="all">
<mibObj oid=".1.3.6.1.4.1.2021.13.15.1.1.2" instance="ucdDiskIOIndex" alias="ucd-io-name" type="string"/>
<mibObj oid=".1.3.6.1.4.1.2021.13.15.1.1.3" instance="ucdDiskIOIndex" alias="ucd-io-rbyte" type="counter"/>
<mibObj oid=".1.3.6.1.4.1.2021.13.15.1.1.4" instance="ucdDiskIOIndex" alias="ucd-io-wbyte" type="counter"/>
<mibObj oid=".1.3.6.1.4.1.2021.13.15.1.1.5" instance="ucdDiskIOIndex" alias="ucd-io-read" type="counter"/>
<mibObj oid=".1.3.6.1.4.1.2021.13.15.1.1.6" instance="ucdDiskIOIndex" alias="ucd-io-write" type="counter"/>
</group>
Include the group in the existing net-snmp collection:
<systemDef name="Net-SNMP">
<sysoidMask>.1.3.6.1.4.1.8072.3.</sysoidMask>
<collect>
<includeGroup>mib2-host-resources-storage</includeGroup>
<includeGroup>mib2-host-resources-system</includeGroup>
<includeGroup>mib2-host-resources-memory</includeGroup>
<includeGroup>net-snmp-disk</includeGroup>
<includeGroup>ucd-loadavg</includeGroup>
<includeGroup>ucd-memory</includeGroup>
<includeGroup>ucd-sysstat</includeGroup>
<includeGroup>ucd-diskio</includeGroup>
</collect>
</systemDef>
Restart OpenNMS and you should get this collected.
snmp-graph.properties
in the reports section, add:
ucd.diskbytesio, ucd.diskaccess, \
somewhere around your existing net-snmp reports. Then, further down:
######
###### UCD DiskIO
######
report.ucd.diskbytesio.name=UCD MIB Disk bytes IO
report.ucd.diskbytesio.columns=ucd-io-rbyte, ucd-io-wbyte
report.ucd.diskbytesio.type=ucdDiskIOIndex
report.ucd.diskbytesio.propertiesValues=ucd-io-name
report.ucd.diskbytesio.command=--title="bytes read/written on {ucd-io-name}" \
DEF:rbytes={rrd1}:ucd-io-rbyte:AVERAGE \
DEF:wbytes={rrd2}:ucd-io-wbyte:AVERAGE \
LINE2:rbytes#00ff00:" bytes read" \
GPRINT:rbytes:AVERAGE:" Avg \\: %8.2lf %s" \
GPRINT:rbytes:MIN:"Min \\: %8.2lf %s" \
GPRINT:rbytes:MAX:"Max \\: %8.2lf %s\n" \
LINE2:wbytes#ff0000:"bytes written" \
GPRINT:wbytes:AVERAGE:"Avg \\: %8.2lf %s" \
GPRINT:wbytes:MIN:"Min \\: %8.2lf %s" \
GPRINT:wbytes:MAX:"Max \\: %8.2lf %s\n"
report.ucd.diskaccess.name=UCD MIB Disk access
report.ucd.diskaccess.columns=ucd-io-read, ucd-io-write
report.ucd.diskaccess.type=ucdDiskIOIndex
report.ucd.diskaccess.propertiesValues=ucd-io-name
report.ucd.diskaccess.command=--title="disk access on {ucd-io-name}" \
DEF:reads={rrd1}:ucd-io-read:AVERAGE \
DEF:writes={rrd2}:ucd-io-write:AVERAGE \
LINE2:reads#00ff00:" reads" \
GPRINT:reads:AVERAGE:" Avg \\: %8.2lf %s" \
GPRINT:reads:MIN:"Min \\: %8.2lf %s" \
GPRINT:reads:MAX:"Max \\: %8.2lf %s\n" \
LINE2:writes#ff0000:"writes" \
GPRINT:writes:AVERAGE:"Avg \\: %8.2lf %s" \
GPRINT:writes:MIN:"Min \\: %8.2lf %s" \
GPRINT:writes:MAX:"Max \\: %8.2lf %s\n"
1.3.3 to 1.3.7
This is enabled by default (since subversion revision 6383). The data collection group name is the same name shown in the 1.3.2 section ("ucd-diskio"), however the index name is called "diskIOIndex" and the data source names ("alias"es) have changed.
1.3.8 and later
You will need to edit datacollection-config.xml, and for the "Net-SNMP" and "Net-SNMP (UCD)" system definitions, you will need to add "<includeGroup>ucd-diskio</includeGroup>". The rest of the configuration is setup.









New Pages