I have been requested by our development Team to create a lab enviroment for testing of various new software our company developes.

in the labhave a cisco switch configured to send out snmp v2 traps and i am looking for a way to generate a trap (of any kind) every 1 - 2 seconds . the switch is configured properly and when using wireshark i can view the snmp traps its sending however in order for a trap to work i need an event to trigger it like a port shutdown or something similar .

this leads me to the question how do i generate such a trap ?

the reason why this must be a trap is because the port i am using to sniff the network is a monitor session port and being such .. it must recevie the traffic .

i tried playing with a CPU trap to maybe trigger some event every 2 seconds but no luck there.

any help or pointers will be much appriciated.


I would try

snmp-server enable traps config

and then go in and out of configure mode. That is manually, but you can do it as often as you want.

Or, you can do

snmp-server enable traps event-manager

and write your own EEM script to do things, but that's not my area of expertise unfortunately.

  • Hello Aaron it seems you were right , thanks for pointing me in the right direction using EEM i managed to create what i needed it was fairly difficult but it works and all is well so Thanks . :) – Eli B Aug 5 '11 at 13:54
  • You might want to add the EEM script you used here so others can refer to it - it sounds like it's a question that could be asked often. – Aaron Aug 5 '11 at 14:44

I don't think there is a test trap command in IOS, you can create a loopback interface and do shut, no shut to generate trap. For automation, you can have expect do the same for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.