How to manually generate traps via Windows and to test the snmptd probe?s Variables section functionality

Document ID : KB000057331
Last Modified Date : 14/02/2018
Show Technical Document Details


Here is the step by step procedure on how to manually generate the traps via Windows and to test the snmptd probe?s Variables section functionality:

1.?? ?Install the net-snmp package ( Take from ). By default, it will be installed on C:\usr\bin
2.?? ?Go to C:\usr\bin
3.?? ?Send the trap as below :
snmptrap -v2c -c public 42 sysName.0 s "MyHost" i 2

This is the v2 trap where:

a.?? ?public is the community of the trap.
b.?? ? is the target IP where you are sending the trap ( It could be your local IP too if you have probe and net-snmp package installed on the same machine ).

This trap will have 4 variables.

To capture the trap, you must have the snmptd probe installed on the target IP with the SNMP service enabled. Once you send the trap, you will receive it in your probe trap Monitor, create the profile and then you can test the probe just by playing around with the probe configuration & original trap variables.
You can always find out more about SNMP trap commands online. Attached please find 2 scripts (batch and shell script ) which contain the trap commands you can use.
Current common Issue ( Not a probe bug):
Alarm with message text as ?Alarm Message text is empty? is generated while dealing with trap variables.

Based on the testing, we have found one of the causes (there could be many):

When incoming trap variable value matches one of the threshold rules defined in the probe but this rule does not have the message text. For example:

a.?? ?You have 4 variables in the trap. And the 3rd variable has a value of ?MyHost?.
b.?? ?You have already configured the profile for this trap with one of the rules as (just a snapshot from the config file ):

????????????????? var = 3
????????????????? oid =
????????????????? op = =
????????????????? val = "MyHost"
????????????????? sev = 2
????????????????? msg =
????????????????? i18n_token =
????????????????? order = 2

c.?? ?You can see that the ?msg? field is empty.
d.?? ?Now, when the trap comes, probe matches the 3rd variable value with the threshold ?val? but it finds that the ?msg? field is empty. So, the probe sends the Alarm message with text as ?Alarm message text is empty? with severity as defined in the Default tab.

Resolution : Just define the message text for every rule

keywords: snmptd configure PDU variables snmp trap snmptrap value message text variable configuration



File Attachments: