Assistance w/Applets

Unanswered Question
Apr 24th, 2012
User Badges:

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?

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Joe Clarke Tue, 04/24/2012 - 17:44
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

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.

james21970 Fri, 04/27/2012 - 19:43
User Badges:

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

Joe Clarke Sat, 04/28/2012 - 17:57
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

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.

Actions

This Discussion