networking-forum.com
Community BlogCommunity Wiki * Register  * Search  * Login
View unanswered postsView active topics

All times are UTC - 6 hours [ DST ]



Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Thu Jan 12, 2012 10:02 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Thu Apr 17, 2008 6:44 pm
Posts: 6048
Location: Perth, WA
Certs: CCNA
Pretty much for testing purposes I'd like to confirm SNMP traps are working and are hitting the right server.

Had a quick search but didn't find any threads specific to what I'm trying to achieve.

viewtopic.php?f=38&t=25021
viewtopic.php?f=38&t=18136


What I can do is create a loopback shut it and unshut it. That works but I'm looking to automate this a bit more. I've tried using clogin but the commands are entered in too quickly for the device to trap the internet change state.

I'm still looking for a solution either increasing the delay between clogin commands entered or a command/snmp string that sends a trap.

_________________
- Pete


Top
 Profile  
 
PostPosted: Thu Jan 12, 2012 10:27 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Thu Apr 17, 2008 6:44 pm
Posts: 6048
Location: Perth, WA
Certs: CCNA
Seems like this is possible.


Quote:
The EEM version 2.0 (available in 12.2S, 12.3T and 12.4) includes the action snmp-trap command, which can generate a trap from an EEM applet.



http://www.cisco.com/en/US/docs/ios/net ... #wp1168326


However not all devices seems to have this command available.

_________________
- Pete


Top
 Profile  
 
PostPosted: Fri Jan 13, 2012 12:10 am 
Offline
Junior Member
Junior Member
User avatar

Joined: Wed Oct 20, 2010 3:35 pm
Posts: 86
Location: New Jersey
Certs: CCNA, CCNAV, Cisco Rich Media Specialist
Is this what your looking for?

ip sla 9
tcp-connect YOUR_IP
owner YOU
tag This is from SLA 9
frequency 60
tos 128
timeout 5000
tag FLL-RO


ip sla reaction-configuration 5 react timeout action-type traponly threshold-type immediate
ip sla schedule 5 start-time now


you can test this with kiwi http://www.kiwisyslog.com/

_________________
www.configbytes.com
I have no special gift, I’m only passionately curious.
- Albert Einstein


Top
 Profile  
 
PostPosted: Fri Jan 13, 2012 12:23 am 
Offline
Post Whore
Post Whore
User avatar

Joined: Thu Apr 17, 2008 6:44 pm
Posts: 6048
Location: Perth, WA
Certs: CCNA
I just need to confirm the snmp-server configuration is correct and traps are being sent to the correct trap server.

The command action snmp-trap does just that and generates the snmp trap for testing purposes but it requires a recent IOS version.

_________________
- Pete


Top
 Profile  
 
PostPosted: Fri Jan 13, 2012 12:49 am 
Offline
Post Whore
Post Whore
User avatar

Joined: Sat Dec 19, 2009 11:52 pm
Posts: 1162
Location: Central Florida
Certs: CCNP, JNCIA, MCSA
If you're trying to validate whether traps are being sent to the server you've configured, try this:

Code:
debug snmp packets


A debug syslog will be displayed showing you the IP where the packet is sent to. Make sure you have 'logging monitor 7' or 'logging console 7' configured (this would be the default).

If you're trying to automate the shut/no shut of an interface, I can't offer much help there.


Top
 Profile  
 
PostPosted: Fri Jan 13, 2012 1:49 am 
Offline
Post Whore
Post Whore
User avatar

Joined: Thu Apr 17, 2008 6:44 pm
Posts: 6048
Location: Perth, WA
Certs: CCNA
Debug on a production device isn't really... lets just say that's not always a good thing. Also I need to confirm traps are making it to the traplogging boxes.

I've got rancid to go through and do

Code:
config t
int lo 99
shut
no shut
exit
no int lo 99
end
exit


But it pastes the configuration so quick the device never has a chance to trap. I should be able to configure a 2-3 second delay between commands in the expect/clogin script so devices have a chance to trap.

_________________
- Pete


Top
 Profile  
 
PostPosted: Fri Jan 13, 2012 5:23 am 
Offline
Post Whore
Post Whore
User avatar

Joined: Tue Mar 31, 2009 4:15 pm
Posts: 4434
Location: South Florida
Certs: More than none
How about TCL? I believe it was around before EEM so may be in older versions of IOS.

_________________
"See packet, be packet, you are packet. Ignore all else!" -The Networker
packetsdropped.wordpress.com


Top
 Profile  
 
PostPosted: Fri Jan 13, 2012 8:01 am 
Offline
Post Whore
Post Whore
User avatar

Joined: Thu Apr 17, 2008 6:44 pm
Posts: 6048
Location: Perth, WA
Certs: CCNA
Yeah one of the voice guys suggested tcl. Scripting isn't my strong suit but here goes nothing.

Sent from mobile internet

_________________
- Pete


Top
 Profile  
 
PostPosted: Thu Jan 19, 2012 7:55 pm 
Offline
Member
Member
User avatar

Joined: Wed Aug 19, 2009 7:22 pm
Posts: 220
Location: VA
Certs: CCNP CCIP CCNA-S
I had some customers asking for this request as well. Attached is an EEM script that will send most of the ciscoenvmon traps.

*Edit* After several failed attempts to attach a file, its pasted below.

Code:
# Install this file on the platform local media:
# event manager directory user policy <media>
# event manager policy ciscoEnvMonShutdownNotification.tcl type user
# Policy can be executed manually (user exec mode) on the platform by executing:
# event manager run ciscoEnvMonShutdownNotification.tcl

::cisco::eem::event_register_none
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.2.1.2.1 get_type exact]
set ciscoEnvMonVoltageStatusDescr $snmp_arr(value)

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.2.1.3.1 get_type exact]
set ciscoEnvMonVoltageStatusValue $snmp_arr(value)

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.2.1.7.1 get_type exact]
set ciscoEnvMonVoltageState $snmp_arr(value)


 sys_reqinfo_snmp_trapvar var vbinds2 oid 1.3.6.1.4.1.9.9.13.1.2.1.2 string $ciscoEnvMonVoltageStatusDescr
 sys_reqinfo_snmp_trapvar var vbinds2 oid 1.3.6.1.4.1.9.9.13.1.2.1.3 int $ciscoEnvMonVoltageStatusValue
 sys_reqinfo_snmp_trapvar var vbinds2 oid 1.3.6.1.4.1.9.9.13.1.2.1.7 int $ciscoEnvMonVoltageState

sys_reqinfo_snmp_trap enterprise_oid 1.3.6.1.4.1.9.9.13.3  generic_trapnum 6 specific_trapnum 2 trap_oid 1.3.6.1.4.1.9.9.13.3.0.2 trap_var vbinds2
############################################ciscoEnvMonVoltageNotification########################################################

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.3.1.2.1 get_type exact]
set ciscoEnvMonTemperatureStatusDescr $snmp_arr(value)

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.3.1.3.1 get_type exact]
set ciscoEnvMonTemperatureStatusValue $snmp_arr(value)

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.3.1.6.1 get_type exact]
set ciscoEnvMonTemperatureState $snmp_arr(value)


 sys_reqinfo_snmp_trapvar var vbinds3 oid 1.3.6.1.4.1.9.9.13.1.3.1.2 string $ciscoEnvMonTemperatureStatusDescr
 sys_reqinfo_snmp_trapvar var vbinds3 oid 1.3.6.1.4.1.9.9.13.1.3.1.3 gauge $ciscoEnvMonTemperatureStatusValue
 sys_reqinfo_snmp_trapvar var vbinds3 oid 1.3.6.1.4.1.9.9.13.1.3.1.6 int $ciscoEnvMonTemperatureState

sys_reqinfo_snmp_trap enterprise_oid 1.3.6.1.4.1.9.9.13.3  generic_trapnum 6 specific_trapnum 3 trap_oid 1.3.6.1.4.1.9.9.13.3.0.3 trap_var vbinds3
############################################ciscoEnvMonTemperatureNotification########################################################

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.4.1.2.1 get_type exact]
set ciscoEnvMonFanStatusDescr $snmp_arr(value)

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.4.1.3.1 get_type exact]
set ciscoEnvMonFanState $snmp_arr(value)


 sys_reqinfo_snmp_trapvar var vbinds4 oid 1.3.6.1.4.1.9.9.13.1.4.1.2 string $ciscoEnvMonFanStatusDescr
 sys_reqinfo_snmp_trapvar var vbinds4 oid 1.3.6.1.4.1.9.9.13.1.4.1.3 int $ciscoEnvMonFanState

sys_reqinfo_snmp_trap enterprise_oid 1.3.6.1.4.1.9.9.13.3  generic_trapnum 6 specific_trapnum 4 trap_oid 1.3.6.1.4.1.9.9.13.3.0.4 trap_var vbinds4
############################################ciscoEnvMonFanNotification########################################################

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.5.1.2.1 get_type exact]
set ciscoEnvMonSupplyStatusDescr $snmp_arr(value)

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.5.1.3.1 get_type exact]
set ciscoEnvMonSupplyState $snmp_arr(value)


 sys_reqinfo_snmp_trapvar var vbinds5 oid 1.3.6.1.4.1.9.9.13.1.5.1.2 string $ciscoEnvMonSupplyStatusDescr
 sys_reqinfo_snmp_trapvar var vbinds5 oid 1.3.6.1.4.1.9.9.13.1.5.1.3 int $ciscoEnvMonSupplyState

sys_reqinfo_snmp_trap enterprise_oid 1.3.6.1.4.1.9.9.13.3  generic_trapnum 6 specific_trapnum 5 trap_oid 1.3.6.1.4.1.9.9.13.3.0.5 trap_var vbinds5
############################################ciscoEnvMonRedundantSupplyNotification########################################################

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.2.1.2.1 get_type exact]
set ciscoEnvMonVoltageStatusDescr $snmp_arr(value)

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.2.1.3.1 get_type exact]
set ciscoEnvMonVoltageStatusValue $snmp_arr(value)

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.2.1.7.1 get_type exact]
set ciscoEnvMonVoltageState $snmp_arr(value)


 sys_reqinfo_snmp_trapvar var vbinds6 oid 1.3.6.1.4.1.9.9.13.1.2.1.2 string $ciscoEnvMonVoltageStatusDescr
 sys_reqinfo_snmp_trapvar var vbinds6 oid 1.3.6.1.4.1.9.9.13.1.2.1.3 gauge $ciscoEnvMonVoltageStatusValue
 sys_reqinfo_snmp_trapvar var vbinds6 oid 1.3.6.1.4.1.9.9.13.1.2.1.7 int $ciscoEnvMonVoltageState

sys_reqinfo_snmp_trap enterprise_oid 1.3.6.1.4.1.9.9.13.3  generic_trapnum 6 specific_trapnum 6 trap_oid 1.3.6.1.4.1.9.9.13.3.0.6 trap_var vbinds6
############################################ciscoEnvMonVoltStatusChangeNotif########################################################

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.3.1.2.1 get_type exact]
set ciscoEnvMonTemperatureStatusDescr $snmp_arr(value)

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.3.1.3.1 get_type exact]
set ciscoEnvMonTemperatureStatusValue $snmp_arr(value)

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.3.1.6.1 get_type exact]
set ciscoEnvMonTemperatureState $snmp_arr(value)


 sys_reqinfo_snmp_trapvar var vbinds7 oid 1.3.6.1.4.1.9.9.13.1.3.1.2 string $ciscoEnvMonTemperatureStatusDescr
 sys_reqinfo_snmp_trapvar var vbinds7 oid 1.3.6.1.4.1.9.9.13.1.3.1.3 gauge $ciscoEnvMonTemperatureStatusValue
 sys_reqinfo_snmp_trapvar var vbinds7 oid 1.3.6.1.4.1.9.9.13.1.3.1.6 int $ciscoEnvMonTemperatureState

sys_reqinfo_snmp_trap enterprise_oid 1.3.6.1.4.1.9.9.13.3  generic_trapnum 6 specific_trapnum 7 trap_oid 1.3.6.1.4.1.9.9.13.3.0.7 trap_var vbinds7
############################################ciscoEnvMonTempStatusChangeNotif########################################################

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.4.1.2.1 get_type exact]
set ciscoEnvMonFanStatusDescr $snmp_arr(value)

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.4.1.3.1 get_type exact]
set ciscoEnvMonFanState $snmp_arr(value)


 sys_reqinfo_snmp_trapvar var vbinds8 oid 1.3.6.1.4.1.9.9.13.1.4.1.2 string $ciscoEnvMonFanStatusDescr
 sys_reqinfo_snmp_trapvar var vbinds8 oid 1.3.6.1.4.1.9.9.13.1.4.1.3 int $ciscoEnvMonFanState

sys_reqinfo_snmp_trap enterprise_oid 1.3.6.1.4.1.9.9.13.3  generic_trapnum 6 specific_trapnum 8 trap_oid 1.3.6.1.4.1.9.9.13.3.0.8 trap_var vbinds8
############################################ciscoEnvMonFanStatusChangeNotif########################################################

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.5.1.2.1 get_type exact]
set ciscoEnvMonSupplyStatusDescr $snmp_arr(value)

 array set snmp_arr [sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.13.1.5.1.3.1 get_type exact]
set ciscoEnvMonSupplyState $snmp_arr(value)


 sys_reqinfo_snmp_trapvar var vbinds9 oid 1.3.6.1.4.1.9.9.13.1.5.1.2 string $ciscoEnvMonSupplyStatusDescr
 sys_reqinfo_snmp_trapvar var vbinds9 oid 1.3.6.1.4.1.9.9.13.1.5.1.3 int $ciscoEnvMonSupplyState

sys_reqinfo_snmp_trap enterprise_oid 1.3.6.1.4.1.9.9.13.3  generic_trapnum 6 specific_trapnum 9 trap_oid 1.3.6.1.4.1.9.9.13.3.0.9 trap_var vbinds9
############################################ciscoEnvMonSuppStatusChangeNotif########################################################

_________________
_______________________________________________________________________
There are 10 types of people in the world. Those who understand binary and those who don't.


Top
 Profile  
 
PostPosted: Thu Jan 19, 2012 8:04 pm 
Offline
Post Whore
Post Whore
User avatar

Joined: Thu Apr 17, 2008 6:44 pm
Posts: 6048
Location: Perth, WA
Certs: CCNA
:thinking:

_________________
- Pete


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group