cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8002
Views
0
Helpful
1
Replies

If statements EEM?

bravotom99
Level 1
Level 1

I'm wondering how I would set up a script for this.  We have different model 800 series routers but I would like the same EEM script to be on all.  The 881 has FA ports while the 891 has Gig ports.

I'd like to have the EEM script do a 'show version' or any other way to get the model type and parse 881 or 891 and then perform steps based on the results.

 

Show version

If 881

{ int fa 0

 shut }

else

{ int gig 0

  shut

}

1 Reply 1

Dan Frey
Cisco Employee
Cisco Employee

Here is an example using the sysobject id to get the model of the box.  

event manager applet model
 event none
 action 010 cli command "enable"
 action 020 cli command "show snmp sysobjectid"
 action 030 regexp "1\.3\.6\.1\.4\.1\.9\.1\.([0-9]+)" "$_cli_result" match modelid
 action 040 syslog msg "sysobject = $modelid"
 action 050 if $modelid eq "1496"
 action 060  syslog msg "sysobject index $modelid is an 819 router"
 action 070 else
 action 080  syslog msg "sysobject index $modelid is not an 819 router"
 action 090 end

 

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: