Set up SNMP Trap for disk usage

snmpsnmpd

I would like to configure snmpd to send traps for disk usage. Currently the file includes these lines:

disk /ramdisk
ignoreDisk /dev/sda1
ignoreDisk /dev/sda3
disk / 1%
load 60 30 15
linkUpDownNotifications yes

As far as I know that will just allow snmpget requests for this data. How do I enable traps based off this info? Thanks!

Best Answer

Net-snmp can be configured to make internal SNMP query and send traps from DISMAN-EVENT-MIB when disk usage exceeds defined threshold.

In order to send traps for the disk usage, add the following lines to snmpd.conf and restart the agent:

# trap target and community
trap2sink localhost public

# authorization for self monitoring
createUser    internalMonitoringName SHA mysecretpassword AES
rouser        internalMonitoringName
# 
iquerySecName internalMonitoringName

# define
# message to send 
# OID to monitor
# threshold value
monitor DiskAlmostFull dskPercent > 90

Details can be found on http://www.net-snmp.org/wiki/index.php/TUT:DisMan_Monitoring and in man snmpd.conf - section about DisMan Event MIB.

Related Topic