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-...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
--===============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> <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> </div> <div>/root/.snmp/snmpd.conf:(i use the traditional access control)<br></div= > <div>rwuser ema</div> <div>trapcommunity 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> </div> <div>/root/.snmp/snmptrap.conf:</div> <div> </div> <div>authCommunity log,execute,net public<br>authUser log,execute,net = 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> </div> <div>MY-TEST-MIB DEFINITIONS ::=3D BEGIN<br> &= nbsp; IMPORTS snmpTraps FROM SNMPv2-MIB;</div> <div>ifInUcastPktsNotif NOTIFICATION-TYPE<br> STATUS = ; current<br> DESCRIPTION<br> &nbs= p; "ifInUcastPksNotif is used for testi= ng monitor and notificationEvent, written by ema."<br> ::= =3D { snmpTraps 6 }<br>END</div> <div> </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> if [ "$vars" =3D "" ]<br>&nbs= p; then<br> vars=3D"$oid =3D $val"<br> &= nbsp; else<br> vars=3D"$vars, $oid =3D $val"<br>&nb= sp; fi<br>done</div> <div>echo trap: $1 $host $ip $vars</div> <div> </div> <div>results:<br>when i run <br> snmpd -d -f -Le<br> = ; 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> </div> <div> </div> <div> </div></div><div> </div><div> </div><div> </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==-- |