Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to monitor Disk usage over SNMP using MRTG on CentOS5.2. I'm open to any suggestions as to the best way to achieve this (I would also like to do other metrics like CPU). Please don't assume I know anything about MRTG.

I am using the following config:

LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt,/usr/share/snmp/mibs/TCP-MIB.txt
workdir: /var/www/html/mrtg/temp/
# Disk Usage Monitoring

Target[servername.]: dskPercent.0&dskPercent.0:OpenNm3@
Title[servername.]: / on servername
routers.cgi*Desc[servername.]: / on servername
routers.cgi*ShortDesc[servername.]: /
MaxBytes[servername.]: 100
AbsMax[servername.]: 100
Options[servername.]: growright,nopercent,gauge
YLegend[servername.]: used disk space
ShortLegend[servername.]: % used
Legend1[servername.]: usage
Legend2[servername.]: usage
Legend3[servername.]: peak usage
Legend4[servername.]: peak usage
LegendI[servername.]: usage
LegendO[servername.]: usage
routers.cgi*Icon[servername.]: disk-sm.gif
routers.cgi*Options[servername.]: noo,nomax,noabsmax
Unscaled[servername.]: dwmy

I receive the errors:

Unknown SNMP var dskPercent.0
 at /usr/bin/mrtg line 2035
Unknown SNMP var dskPercent.0
 at /usr/bin/mrtg line 2035

From forum surfing etc the suggestion is to use the fully qualified OIDs, I'd like to avoid this (for readability). So essentially I'm wondering where can I find a mib file compatible with mrtg for it's reference or a working config file.

share|improve this question
up vote 2 down vote accepted

If you are not wedded to MRTG, I'd suggest Cacti as a superior SNMP-based monitoring tool. Cacti understands the MIBs ahead of time and you should be able to just select the partitions you want to monitor.

Cacti can be installed via Yum from the RPMforge repository.

share|improve this answer
likely this is the direction I'll head; I'm not fixated on MRTG; mostly it just bugs me I've never been able to get it working. – Antitribu Oct 7 '09 at 8:09
As I doubt anyone will step forward with the answer and this was the solution that eventually implemented I'll flag it as the answer... Honestly it was easier than direct config of MRTG and produced more what I was eventually looking for anyway. – Antitribu Oct 27 '09 at 9:09

Instead of dskPercent, try using hrStorageUsed.x

Give the command snmpwalk -v1 -c <communityname> localhost hrStorage, and you will get list of values you are looking for.

share|improve this answer

To be able to use the dskPercent OID nickname in MRTG, you need to load the UCD-SNMP-MIB, which you are doing. So the error you see has nothing to do with the MIB not being loaded into MRTG. Trying to put the full OID will not help.

Rather it is your snmp agent on the machine you're trying to monitor which doesn't have any entry in the dskTable. This table is only populated if you have one or multiple disk configuration lines in your snmpd.conf configuration file (provided you use net-snmp). For example, you can have 2 lines like:

disk    /
disk    /var

To make sure the snmp tree does contain the dskPercent table after such a configuration, check with a CLI snmp tool, for example:

snmpwalk -v2c -C yourcommunity localhost dskTable

(or, if your snmpwalk is not configured to used OID nicknames)

snmpwalk -v2c -C yourcommunity localhost .
share|improve this answer

Since you are using MRTG with Routers2, there is a generic cfgmaker host template available at which will automatically generate MRTG configurations for many things, including the storage OIDs. These take advantage of the Routers2 additional features to give you combination graphs. It should work with any SNMP-capable host.

You can use it with standard MRTG cfgmaker like this:

cfgmake --host-template=generic.htp community@device > device.cfg
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.