How can i get the secific trap notification if i want to monitor the ifUcastPkts of eth2
ema <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
hello,everyone!
backgroud:
net-snmp-5.4.1 on fc6
eth2 is the network interface i want to monitor, the oid of eh2's ifUcastPkts is .1.3.6.1.2.1.2.2.1.11.4
here's the case:
/root/.snmp/snmpd.conf:(i use the traditional access control)
rwuser ema
trapcommunity public
trap2sink 192.168.1.100 public
#192.168.1.100 is the ip address at which i run snmpd snmptrapd
agentSecName ema
monitor -r 30 -u ema -e ifInUcastPktsNum "eth2InUcastPkts" .1.3.6.1.2.1.2.2.1.11.4 2900000 3000000
notificationEvent ifInUcastPktsNum MY-TEST-MIB::ifInUcastPktsNotif
# ifInUcastPktsNum is a name i named it at liberty
# 2900000 3000000 is a scope from minimum to maximum of eth2' InUcastPkts
# MY-TEST-MIB::ifInUcastPktsNotif is a simple mib file that i copied it into /usr/local/share/snmp/mibs/MY-TEST-MIB.txt
/root/.snmp/snmptrap.conf:
authCommunity log,execute,net public
authUser log,execute,net ema authNoPriv
createUser -e 0x0102030405 ema MD5 password
traphandle MY-TEST-MIB::ifInUcastPktsNotif /home/ema/testScript "my test mib"
MY-TEST-MIB.txt:(reference http://net-snmp.sourceforge.net/wiki/index.php/TUT:snmptrap)
MY-TEST-MIB DEFINITIONS ::= BEGIN
IMPORTS snmpTraps FROM SNMPv2-MIB;
ifInUcastPktsNotif NOTIFICATION-TYPE
STATUS current
DESCRIPTION
"ifInUcastPksNotif is used for testing monitor and notificationEvent, written by ema."
::= { snmpTraps 6 }
END
testScript:(reference http://net-snmp.sourceforge.net/wiki/index.php/TUT:Configuring_snmptrapd)
#!/bin/sh
read host
read ip
vars=
while read oid val
do
if [ "$vars" = "" ]
then
vars="$oid = $val"
else
vars="$vars, $oid = $val"
fi
done
echo trap: $1 $host $ip $vars
results:
when i run
snmpd -d -f -Le
snmptrapd -d -f -Le
at 192.168.1.100
i didn't get the notification when the eh2's ifUcastPkts exceeds the maximum 3000000
is the anything i missed to get it?
any help will be appreciated !
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users