Monday, January 27, 2020

Output in txt file with Python

Hi all,

I am quite new to scripting and I would like to build a script in python for creating a text file with the output from following device (it's Huawei Router -> probable not very relevant):

______________________________________________________________________

screen-length 512 temporary

disp ver

dir

Dis lic

Dis dev

Dis int des

Dis ip int brief

Dis isis peer

Dis bgp peer

dis mpls l2vc

dis alarm all

Dis arp all

dis mpls lsp stat

quit

________________________________________________________________________________

My thinking is that I first need a script for file 1 with the loopback/ management IP (or hostname), the login script and then the script for the second file, where the output will be saved.

Any helping hands ?



No comments:

Post a Comment