Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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@192.168.1.2
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
add comment

3 Answers

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
add comment

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
add comment

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 .1.3.6.1.4.1.2021.9.1
share|improve this answer
add comment

Your Answer

 
discard

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.