cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
519
Views
6
Helpful
3
Replies

endpoint video configuration with python

Hello guys,

 

I have 70 video endpoints to configure.

These are the same parameters for each endpoint.

I would like to use a python script and use the Paramiko library to make my ssh connection and pass the command lines like when I use putty.

The SSH connection seems to be ok, but the command doesn't work. On the other hand via putty it works.

Have you ever tried to do the same thing using paramiko? Should I use something else?

 

Thanks for your feedback

3 Replies 3

dstaudt
Cisco Employee
Cisco Employee

In case using xAPI over websocket instead of SSH is tolerable: https://github.com/cisco-ce/pyxows

If you haven't seen it, CE Deploy is a helpful video endpoint management tool: https://github.com/voipnorm/CE-Deploy

In case using Node.js is tolerable, jsxapi can use SSH (TSH) as transport (along with websockets): https://github.com/cisco-ce/jsxapi

If you really need to use Python/Paramiko, I did get a test app working to use the Communications Manager CLI using Paramiko - could be maybe tweaked for use with a video endpoint TSH: https://github.com/CiscoDevNet/axl-ansible-examples/blob/main/paramiko_test.py

More xAPI developer resources: https://developer.cisco.com/codeexchange/github/repo/CiscoDevNet/awesome-xapi/

Hello dstaudt,

 

So if I understand well, you means that I cannot open an ssh connection with Python library and launch the xConfiguration command.

 

I will check the pyxows, but it's more easier to open a ssh connection and execute the command.

 

Thanks for your feedback

 

 

 

That's certainly possible...the sample I pointed to above could be a good starting point: https://github.com/CiscoDevNet/axl-ansible-examples/blob/main/paramiko_test.py, just piont it at an IOS device.

There are probably lots of other examples, e.g. on GitHub this looks interesting: https://github.com/george-panou/Cisco-IOS-Parallel-CLI

The problem with CLI is that you are 'screen-scraping' text designed to be read by humans, not machines.  Things like timing - how long the CLI takes to appear after SSH connect, likely the problem with your attempts - variable input formats, variable output data formatting/timing, etc. make it difficult to accurately determine if a command succeeded/failed, what the error was, etc.  Retrieving data (like configs) is even harder...
Using a 'real' programmatic targeted API, like the websocket or XML interfaces, normalizes all of that stuff making it predictable/stable to code against.