我正在使用 NET-SNMP 和 DISMAN Event MIB 处理陷阱
使用以下 snmpd.conf 配置:
createUser disman MD5 sercrt@1
rouser disman auth
agentSecName disman
#defaultMonitors yes
disk / 90%
disk /var 85%
disk /opt 95%
disk /opt/pkgs 90%
disk /ufda 90%
proc cron
proc rtrcopy 1 1
proc socks1081 1 1
# monitor must have ".." in the line
monitor -u disman -r 30 -o prNames.1 -o prErrMessage.1 "Cron not running" prErrorFlag.1 != 0
monitor -u disman -r 30 -o prNames.2 -o prErrMessage.2 "rtrcopy running" prErrorFlag.2 != 0
monitor -u disman -r 30 -o prNames.3 -o prErrMessage.3 "socks1081 running" prErrorFlag.3 != 0
monitor -u disman -r 30 -o dskPath.1 -o dskErrorMsg.1 "/ is below 90%" dskErrorFlag.1 != 0
monitor -u disman -r 30 -o dskPath.2 -o dskErrorMsg.2 "/var is below 90%" dskErrorFlag.2 != 0
monitor -u disman -r 30 -o dskPath.3 -o dskErrorMsg.3 "/opt is below 90%" dskErrorFlag.3 != 0
monitor -u disman -r 30 -o dskPath.4 -o dskErrorMsg.4 "/opt/pkgs is below 90%" dskErrorFlag.4 != 0
monitor -u disman -r 30 -o dskPath.5 -o dskErrorMsg.5 "/ufda is below 90%" dskErrorFlag.5 != 0
我发现 disman 陷阱正在填充以下变量:
$1 = mteHotTrigger dskTable
$2 = mteHotTargetNameThe ''
$3 = mteHotContextName ''
$4 = mteHotOID .1.3.6.1.4.1.2021.9.1.100.2
$5 = mteHotValue 1
在事件列表中,这对操作员来说信息量不是很大。我想如果我可以用某种有用的文本填充 mteHotContextName,例如“/低于 90%”,那么这将更有用
我看不到如何使用 monitor 指令执行此操作
有谁知道如何做到这一点?