CLIEvent. Need more information.

Document created by cdnadmin on Jan 25, 2014
Version 1Show Document
  • View in full screen mode
This document was generated from CDN thread

Created by: Andrey Paraskevopulo on 17-10-2013 04:30:11 AM
There are 2 questions:

1. One PK has CLIEvent event type in CLIListener interface, and this information we use to get info about what command user entered in CLI. So how we can get exact user name that issued this command in CLI
(For example, user entered command in CLI “show run”, and we want to get this command and user’s name who did it, using one PK.)

2. How can we get information about mode, that user located in, when recive CLIEvent. using ONE PK(for example: configure mode, line mode, interface mode and so on).

Subject: RE: CLIEvent. Need more information.
Replied by: Joseph Clarke on 17-10-2013 09:45:01 AM
You can't in onePK today.  However, you can do this using EEM and use EEM as a bridge to your onePK app.  For example:

1event manager applet cli-listener
2 event cli pattern ".*" sync no skip no
3 action 1.0 publish-event sub-system 798 type 1 arg1 $_cli_msg arg2 $_cli_username arg3 $_cli_privilege arg4 $_cli_tty

Then you can use the application event listener in your onePK app to pull out the command from arg1, the username from arg2, the privilege level from arg3, and the VTY line from arg4.

Note: you cannot get the sub-mode today, even from EEM :-(

Subject: RE: CLIEvent. Need more information.
Replied by: Andrey Paraskevopulo on 07-11-2013 02:38:04 AM
TY, it works.
But in this case i can't block the command unlike the use of CLIListener.handleSyncEvent().
CLIEvent will be expanded in the future?

Subject: RE: CLIEvent. Need more information.
Replied by: Joseph Clarke on 07-11-2013 06:53:38 PM
Yes, we have an enhancement open with high priority to enhance the CLIEvent API to support everything you're asking for here.

Subject: RE: CLIEvent. Need more information.
Replied by: Andrey Paraskevopulo on 08-11-2013 12:33:10 AM
Thank you, we will be waiting.

Attachments

    Outcomes