cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
287
Views
1
Helpful
3
Replies

A question about EEM configuration.

Mitrixsen
Level 1
Level 1

Hello, everyone.

Is there any way to configure an EEM applet to display a message saying "dont do that" when someone issues the switchport trunk allowed vlan command but not display it if the command is switchport trunk allowed vlan add?


SW1(config)#event manager applet TRUNK
SW1(config-applet)#event cli pattern "switchport trunk allowed vlan" sync yes
SW1(config-applet)#action 1.0 syslog msg "dont do that!"

What I've configured above of course doesn't achieve what I want it to. There are two problems:

1. It always displays the "dont do that message" regardless of whether I issue the switchport trunk allowed vlan command under interface mode, global config mode, enable mode, whenever I type switchport trunk allowed vlan, that syslog message is generated. Is there any way to only have it appear when issued under interface config mode?

2. The message appears regardless of whether I use switchport trunk allowed vlan or switchport trunk allowed vlan add. Is there any way to add an exception for commands with the add keyword, or?

Thank you.
David

2 Accepted Solutions

Accepted Solutions

I will start by use 

1-

Sync No 

2- 

Make message appear when add specific vlan like 

....vlan add 100

Try above abd check

Also why you use syslog why not use only " puts "

MHM

View solution in original post

I think so, there is two possible solution here. You could use regex in the event cli, with a trigger. You check the config-if and exclude your keyword, add. If you wanted to go further here you could apply this at interface level and not global level I believe.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

View solution in original post

3 Replies 3

I will start by use 

1-

Sync No 

2- 

Make message appear when add specific vlan like 

....vlan add 100

Try above abd check

Also why you use syslog why not use only " puts "

MHM


@MHM Cisco World wrote:

I will start by use 

1-

Sync No 

2- 

Make message appear when add specific vlan like 

....vlan add 100

Try above abd check

Also why you use syslog why not use only " puts "

MHM


Hello. 
I've started with EEM today for my ENCOR exam, I haven't covered the puts keyword yet!
David

I think so, there is two possible solution here. You could use regex in the event cli, with a trigger. You check the config-if and exclude your keyword, add. If you wanted to go further here you could apply this at interface level and not global level I believe.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io