Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

If statements EEM?

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
Cisco Employee

Here is an example using the

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

 

 

1058
Views
0
Helpful
1
Replies