Folks,
I need to use this command (snmptrap) from Linux command line to send my custom message to a trap listener. I need to send the same message in both v1 and v2c depending on user settings.
Here is what I found.
For v1:
snmptrap -v 1 -c Tas hostname 1.3.6.1.4.1.2.3 "" 6 3 1234 s s "This is a test"
The above command works, I see the following message in my listener.
Display of SNMPv1 trap:
community: Tas
enterprise oid: 1.3.6.1.4.1.2.3
..... ibmAgents
agentAddress: hostname
generic-trap: enterpriseSpecific ('00000006'h)
specific-trap: 3 ('00000003'h)
time-stamp: 1234 - 12.34 seconds
varBind oid: OBJECT_IDENTIFIER 1.3.6.1.6
name: snmpV2
value: OCTET_STRING This is a test <- Here is my message.
My listener is a basically an AIX system, running the following command.
clsnmp -c public TRAP
For v2c: I am issuing this command.
snmptrap -v 2c -c "Tas" hostname '1234' 1.3.6.1.4.1.2.3 s s "This is a Test"
The command does not give me any error. But on the listener I see this.
Display of SNMPv2 trap with SNMPV2C security
community: Tas
The message "This is a Test" is not shown.
I am not familiar with snmptrap command - know very little about the protocol also. I have googled the command. My questions...
Is there anything wrong with the v2c command?
Is there anything wrong with my listener command? Let me know if I should something else. I can set up a Linux listener too.
Any suggestion is most welcome. I want to keep it simple - sending a custom message over snmp to a host, v1 and v2c and set up a listener to verify that my commands are working.
Thanks a lot
Tas