cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3314
Views
5
Helpful
4
Replies

alias for guestshell run python + script?

_|brt.drml|_
Level 1
Level 1

I'm looking for a solution to enable a script for clients (local admins) to run some scripts on the switches/routers.

They can enable it by running the guestshell command. But, how can I configure an alias? 

So that one 'keyword' enables the script.

 

Thank you 

1 Accepted Solution

Accepted Solutions

_|brt.drml|_
Level 1
Level 1

Almost, thx for the help, but found a solution. How I searched for it in google changed the results and I found a config/

 

OSW-9300-BL(config)#alias exec ZEROSWITCH guestshell run python /flash/updateswitch.py
OSW-9300-BL(config)#end
OSW-9300-BL#ZEROSWITCH

####---- Welcome to the SW Script - Python - -------------------------------------###

####---- Baseline is OK ---------------------------------------------------------###
==========================================================================================
[(1, 'Change Switch Name - Site Config'),
(2, 'Zeroize the switch config'),
(9, 'Exit the program')]
==========================================================================================
What do you like to d...............

 

View solution in original post

4 Replies 4

Sergiu.Daniluk
VIP Alumni
VIP Alumni

Hi,

 

On nexus switches you can simply use alias command:

switch(config)# cli alias name <alias-command> <real command>

Stay safe,

Sergiu

it is a 9300 series switch ios xe , and the above command failed thanx anyway

@_|brt.drml|_ totally guessing here - Create an EEM applet, which can actually run a Python script. Create the alias to run/exec something like 

 

guestshell run python3 /home/guestshell/setup.py
Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

_|brt.drml|_
Level 1
Level 1

Almost, thx for the help, but found a solution. How I searched for it in google changed the results and I found a config/

 

OSW-9300-BL(config)#alias exec ZEROSWITCH guestshell run python /flash/updateswitch.py
OSW-9300-BL(config)#end
OSW-9300-BL#ZEROSWITCH

####---- Welcome to the SW Script - Python - -------------------------------------###

####---- Baseline is OK ---------------------------------------------------------###
==========================================================================================
[(1, 'Change Switch Name - Site Config'),
(2, 'Zeroize the switch config'),
(9, 'Exit the program')]
==========================================================================================
What do you like to d...............