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. And see here for current known issues.

New Member

Assistance w/Applets

Hi all,

so, here's my situation. I created a real no frills basic applet that triggers on the event "int x/xx" and has an action of "exit". This is working flawlessly, however it drops me to config mode, which i'm not currently seeing as a problem, but i'd like to have it drop me to exec mode, so I changed the action to "end", but once it triggers, the CLI will hang for a few seconds, and then show back up in global config mode. This is the end result as with the 'exit' action, but without the several second hang.

Any ideas about why this behavior is taking place?

3 REPLIES
Cisco Employee

Assistance w/Applets

It would be really helpful to see your applet and know your IOS version.  Applet actions do not affect the current CLI mode so I'm having a hard time envisioning what you're seeing.

New Member

Assistance w/Applets

Hi Joseph,

So here is the config I have:

event manager applet TEST01

event cli pattern "interface GigabitEthernet1/47" sync yes

action exit cli command "exit"

I don't currently have access to the IOS version, but I tested this on 12.4t on a router, and 12.2 x on a 4948. It worked the way I intended, but like I was saying, the 'end' command doesn't behave the same way.

Also, im not following what you mean with this:

 

  "Applet actions do not affect the current CLI mode so I'm having a hard time envisioning what you're seeing."

Thanks for your time,

James

Cisco Employee

Assistance w/Applets

Okay, I see what you're doing.  Your policy is not working the way you expect.  When you invoke a CLI session, that session happens in a brand new VTY.  The commands do not run within the VTY of the user that triggered the policy.  When your command is "exit" IOS EXEC simply closes the CLI session.  However, "end" is not a valid command from EXEC mode.  Try it.  You will end up waiting for the host "end" to resolve (if you have domain-lookup enabled).  This will cause your policy to hang.  If the time it takes to resolve "end" is longer than 20 seconds, the policy will terminate and the "interface gi1/47" command will run (hence the user will be dropped into interface submode).

If you want to control the CLI session of the user that triggers the applet, that is not possible other than preventing the command from running.  Blocking a command from running will happen by default for synchronous policies unless you exit with a non-zero status.

461
Views
0
Helpful
3
Replies