How can i get the secific trap notification if i want to monitor

This is a discussion on How can i get the secific trap notification if i want to monitor within the SNMP Users forums, part of the Networking and Network Related category; --===============0831030301== Content-Type: multipart/alternative; boundary="----=_Part_114797_28431130.1209115215466" ------=_Part_114797_28431130.1209115215466 Content-Type: text/plain; charset=gbk Content-Transfer-...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-25-2008
ema
 
Posts: n/a
Default How can i get the secific trap notification if i want to monitor

--===============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.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...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

testScript:(reference 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

<div>&nbsp;<div>hello,everyone!<br></div>
<div>backgroud:<br>net-snmp-5.4.1 on fc6<br>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<b=
r>here's the case:</div>
<div>&nbsp;</div>
<div>/root/.snmp/snmpd.conf:(i use the traditional access control)<br></div=
>

<div>rwuser ema</div>
<div>trapcommunity&nbsp; public<br>trap2sink 192.168.1.100 public<br>#192.1=
68.1.100 is the ip address at which i run snmpd snmptrapd<br>agentSecName e=
ma</div>
<div>monitor -r 30 -u ema -e ifInUcastPktsNum "eth2InUcastPkts" .1.3.6.1.2.=
1.2.2.1.11.4 2900000 3000000<br>notificationEvent ifInUcastPktsNum MY-TEST-=
MIB::ifInUcastPktsNotif</div>
<div># ifInUcastPktsNum is a name i named it at liberty<br># 2900000 300000=
0 is a scope from minimum to maximum of eth2' InUcastPkts<br># MY-TEST-MIB:=
:ifInUcastPktsNotif is a simple mib file that i copied it into /usr/local/s=
hare/snmp/mibs/MY-TEST-MIB.txt</div>
<div>&nbsp;</div>
<div>/root/.snmp/snmptrap.conf:</div>
<div>&nbsp;</div>
<div>authCommunity log,execute,net public<br>authUser log,execute,net&nbsp;=
ema authNoPriv<br>createUser -e 0x0102030405 ema MD5 password</div>
<div>traphandle MY-TEST-MIB::ifInUcastPktsNotif /home/ema/testScript "my te=
st mib"</div>
<div><br>MY-TEST-MIB.txt:(reference <a target=3D"_blank" href=3D"http://net=
-snmp.sourceforge.net/wiki/index.php/TUT:snmptrap">http://net-snmp.sourcefo=
rge.net/wiki/index.php/TUT:snmptrap</a>)</div>
<div>&nbsp;</div>
<div>MY-TEST-MIB DEFINITIONS ::=3D BEGIN<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; IMPORTS snmpTraps FROM SNMPv2-MIB;</div>
<div>ifInUcastPktsNotif NOTIFICATION-TYPE<br>&nbsp;&nbsp;&nbsp; STATUS&nbsp=
; current<br>&nbsp;&nbsp;&nbsp; DESCRIPTION<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "ifInUcastPksNotif is used for testi=
ng monitor and notificationEvent, written by ema."<br>&nbsp;&nbsp;&nbsp; ::=
=3D { snmpTraps 6 }<br>END</div>
<div>&nbsp;</div>
<div>testScript:(reference <a target=3D"_blank" href=3D"http://net-snmp.sou=
rceforge.net/wiki/index.php/TUT:Configuring_snmptrapd">http://net-snmp.sour=
ceforge.net/wiki/index.php/TUT:Configuring_snmptrapd</a>)<br></div>
<div>#!/bin/sh</div>
<div>read host<br>read ip<br>vars=3D</div>
<div>while read oid val<br>do<br>&nbsp;&nbsp; if [ "$vars" =3D "" ]<br>&nbs=
p;&nbsp; then<br>&nbsp;&nbsp;&nbsp;&nbsp; vars=3D"$oid =3D $val"<br>&nbsp;&=
nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp; vars=3D"$vars, $oid =3D $val"<br>&nb=
sp;&nbsp; fi<br>done</div>
<div>echo trap: $1 $host $ip $vars</div>
<div>&nbsp;</div>
<div>results:<br>when i run <br>&nbsp;&nbsp; snmpd&nbsp; -d -f -Le<br>&nbsp=
;&nbsp; snmptrapd -d -f -Le<br>at 192.168.1.100<br>i didn't get the notific=
ation when the eh2's ifUcastPkts exceeds the maximum 3000000<br>is the anyt=
hing i missed to get it?<br>any help will be appreciated !</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div></div><div>&nbsp;</div><div>&nbsp;</div><div>&nbsp;</div><=
br><!-- footer --><br>=20
<hr>
<font style=3D"font-size:12px;line-height:15px;"></font><a style=3D"font-si=
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</a>
------=_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==--


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:49 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0