Daryyl/Dale,
It seems when I run snmptrap from command line at the sender and receive and
show it using snmptrapd in receiver side after that if I try to send trap from
inside the code (send_v2trap()),snmptrapd is not able to show the content of
incoming packet.
If I kill snmptrapd and run it again and first start sending Trap from inside
the code snmptrapd is able to show them this time.
snmpinform behaves correctly.I can at the same time send trap from inside
the code as well as using snmpinform from command line and see them both using
snmptrapd.
How can I send Inform message instead of Trap inside the code?
I am using Var_2Trap( ) now.
Regards,
Reza
Note: forwarded message attached.
---------------------------------
Choose the right car based on your needs. Check out Yahoo! Autos new Car
Finder tool.--- Begin Message ---
Thanks Dave/Daryl,
I can now send Trap and receive and see the content of it using snmptarp and
snmptrapd.
There are two problems:
1) No matter what engine ID you define for snmptrapd in /var/net-snampd ,it
has only accept 0x0102030405
snmptrap 0x0102030405 <rest of command> always work even you put the
following line in the snmpd.conf
cretaeUser -e 0x0101010101 Reza MD5 12345678 DES <passw>
snmptrap -e 0x0101010101 <rest of command> doesn't work
2) next issue which is my concern is that I want to send trap inside the
code(send_v2trap( )).
In snmpd.conf I have:
trapsess -e 0x0102030405 -v 3 -u Reza -a MD5 -A 12345678 -x DES -X
9876543210 -l authPriv 192.168.0.204
The following line is excatly the same as line I am using for snmptarp and it
worked with snmptrap command.
But here it dosen't work . it means in reciever I can see the packet comes
in but snmptrapd is not able to show the content of message.
Using Ethreal I looked at the packet content.Both packet are the same except
in the packet genereted by snmptrap Engine Boots =1 Engine Time =0
But in packet genereted from the code Engine Boots=0 Engine Time=0.
I greatly appreciate your help.
Regards,
Reza
Note: forwarded message attached.
---------------------------------
Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on,
when. --- Begin Message ---
Try adding Dsum parameter to snmptrapd to get some extra debug information
(snmptrapd -f -Le Dsum)
I have not managed to get the snmptrap command to work with snmpV3 users but
the snmpinform command did (I think snmpinform is the equivalent to using
snmptrap Ci ...)
I notice you have specified an engine id of 0x0102030405 which I expect is
taken from one of the examples, I assume this is the same engine id used by
the trap sink? If not I expect it probably should be.
I have been using one of the SNMP examples, below is information from my
configuration and script files if it helps. Check you have the authuser
entry in your configuration file.
The example I have been using including MIB files can be found here...
http://www.net-snmp.org/tutorial/tutorial-5/commands/snmptrap.html
Darryl
A trap handler (/home/myuser/trap.sh)
-------------------------------
#!/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
Trapd configuration (snmptrapd.conf)
------------------------------------
authuser log,execute,net testuser
authCommunity log,execute,net public
trapcommunity public
# the generic traps
traphandle SNMPv2-MIB::coldStart /home/myuser/trap.sh cold
traphandle SNMPv2-MIB::warmStart /home/myuser /trap.sh warm
traphandle IF-MIB::linkDown /home/myuser /trap.sh down
traphandle IF-MIB::linkUp /home/myuser /trap.sh up
traphandle SNMPv2-MIB::authenticationFailure /home/myuser /trap.sh auth
# this one is deprecated
traphandle .1.3.6.1.6.3.1.1.5.6 /home/support/trap.sh egp-neighbor-loss
# enterprise specific traps
traphandle TRAP-TEST-MIB::demo-trap /home/myuser /trap.sh demo-trap
traphandle NOTIFICATION-TEST-MIB::demo-notif /home/ myuser /trap.sh
demo-notif
All of the following commands worked for me...
snmptrap -v 1 -c public 192.168.28.22 TRAP-TEST-MIB::demotraps
192.168.144.229 6 17 "" SNMPv2-MIB::sysLocation.0 s "Just here"
snmptrap -v 2c -c public 192.168.28.22 "" NOTIFICATION-TEST-MIB::demo-notif
SNMPv2-MIB::sysLocation.0 s "just here"
snmpinform -v 3 -u usera -a MD5 -A mypassword -l authNoPriv 192.168.28.22
coldStart.0
________________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Reza
Salehi
Sent: 31 July 2007 20:52
To: SNMP FORUM
Subject: problem in receiving traps in SNMP-V3
Hi All,
I am able to send and receive Trap in V2 mode but in V3 I can send trap but
I am not able to see them using snmptrapd.I can see the packets coming
using -d switch but not able to see the content of the message.
This is what I am doing.
At the sender :
snmptrap -e 0x0102030405 -v 3 -u Reza -a MD5 -A 12345678 -l authNoPriv
192.168.0.204 42 coldStart.0
and in reciver runinng snmptrapd -Le -f -d
and in /var/net-snmp/snmptrapd.conf
createUser -e 0x0102030405 Reza MD5 12345678 DES 9876543210
I appreciate it if you could help me out.
Regards,
Reza
________________________________________
Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel
and lay it on us.
--- End Message ---
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
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
--- End Message ---
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
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