--===============0831030301==
Content-Type: multipart/alternative;
boundary="----=_Part_114797_28431130.1209115215466"

------=_Part_114797_28431130.1209115215466
Content-Type: text/plain; charset=gbk
Content-Transfer-Encoding: 7bit


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.confi 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.txtreference http://net-snmp.sourceforge.net/wiki...p/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

testScriptreference http://net-snmp.sourceforge.net/wiki...ring_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 !






------=_Part_114797_28431130.1209115215466
Content-Type: text/html; charset=gbk
Content-Transfer-Encoding: quoted-printable

 
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 r>here's the case:

 

/root/.snmp/snmpd.confi use the traditional access control)

>
rwuser ema

trapcommunity  public
trap2sink 192.168.1.100 public
#192.1=
68.1.100 is the ip address at which i run snmpd snmptrapd
agentSecName e=
ma

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 300000=
0 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/s=
hare/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 te=
st mib"


MY-TEST-MIB.txtreference -snmp.sourceforge.net/wiki/index.php/TUT:snmptrap">http://net-snmp.sourcefo=
rge.net/wiki/index.php/TUT:snmptrap)

 

MY-TEST-MIB DEFINITIONS ::=3D BEGIN
     &=
nbsp;  IMPORTS snmpTraps FROM SNMPv2-MIB;

ifInUcastPktsNotif NOTIFICATION-TYPE
    STATUS&nbsp=
; current
    DESCRIPTION
    &nbs=
p;       "ifInUcastPksNotif is used for testi=
ng monitor and notificationEvent, written by ema."
    ::=
=3D { snmpTraps 6 }
END

 

testScriptreference rceforge.net/wiki/index.php/TUT:Configuring_snmptrapd">http://net-snmp.sour=
ceforge.net/wiki/index.php/TUT:Configuring_snmptrapd)

#!/bin/sh

read host
read ip
vars=3D

while read oid val
do
   if [ "$vars" =3D "" ]
&nbs=
p;  then
     vars=3D"$oid =3D $val"
 &=
nbsp; else
     vars=3D"$vars, $oid =3D $val"
&nb=
sp;  fi
done

echo trap: $1 $host $ip $vars

 

results:
when i run
   snmpd  -d -f -Le
&nbsp=
;  snmptrapd -d -f -Le
at 192.168.1.100
i didn't get the notific=
ation when the eh2's ifUcastPkts exceeds the maximum 3000000
is the anyt=
hing i missed to get it?
any help will be appreciated !

 

 

 
 
 
 
<=
br>
=20


ze:12px;line-height:15px; color:blue; text-decoration:underline;" href=3D"h=
ttp://popme.163.com/link/004062_0424_7216.html">=C3=E2=B7=D1=BC=A6=B3=E1=B1=
=C8=C8=F8=CC=EC=CC=EC=B3=E9

------=_Part_114797_28431130.1209115215466--



--===============0831030301==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
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;198757...un.com/javaone
--===============0831030301==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users

--===============0831030301==--