snmp disk monitor

Disk Statistics
Regarding disk statistics one of method is to modify snmpd.conf file (append below contents). Please note that there are some limitations on certain oid/objects like dskTotal, diskAvail (more info here).

#includeAllDisks 10%
disk / 10%
disk /opt 10%
disk /opt/makalu/storage 10%
# where 10% is threshold,it is set when 10% threshold is reached and reachable with UCD-SNMP-MIB::dskErrorFlag.<number>. it defaults to 100kB

List out mountpoints/path
# snmpwalk -v2c -c public localhost UCD-SNMP-MIB::dskPath
UCD-SNMP-MIB::dskPath.1 = STRING: /
UCD-SNMP-MIB::dskPath.2 = STRING: /opt
UCD-SNMP-MIB::dskPath.3 = STRING: /opt/makalu/storage

~# snmpwalk -v2c -c public localhost UCD-SNMP-MIB::dskPercent.3
UCD-SNMP-MIB::dskPercent.3 = INTEGER: 4

~# snmpwalk -v2c -c public localhost UCD-SNMP-MIB::dskDevice.3
UCD-SNMP-MIB::dskDevice.3 = STRING: MainPool/storage

root@myserver:~# df -hT
Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 1.5G 0 1.5G 0% /dev
MainPool/ROOT/root zfs 47G 3.6G 43G 8% /
...
MainPool/application zfs 47G 3.4G 44G 8% /opt
...
MainPool/storage zfs 28G 1.1G 27G 4% /opt/data/storage
...

Note:- The percentage value usage is rounded off to ceiling value

No comments:

Post a Comment