09-16-2022 11:27 PM
Hi
I need to schedule in python script automation backup all my routers, please let me know the script which I can run the same.
My sample router configuration is as follows.
R120
interface Loopback1
ip address 172.120.10.1 255.255.255.0
!
interface Loopback2
ip address 172.120.20.1 255.255.255.0
!
interface Loopback3
ip address 172.120.30.1 255.255.255.0
!
interface Loopback4
ip address 172.120.40.1 255.255.255.0
!
interface Ethernet0/0
ip address 10.10.120.2 255.255.255.0
duplex auto
!
interface Ethernet0/1
ip address dhcp
duplex auto
!
interface Ethernet0/2
no ip address
shutdown
duplex auto
!
interface Ethernet0/3
no ip address
shutdown
duplex auto
!
!
router eigrp 100
network 10.10.120.0 0.0.0.255
network 172.120.10.0 0.0.0.255
network 172.120.20.0 0.0.0.255
network 172.120.30.0 0.0.0.255
network 172.120.40.0 0.0.0.255
network 192.168.1.0
network 192.168.50.0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
ip route 0.0.0.0 0.0.0.0 192.168.50.1
ip ssh version 2
09-17-2022 01:17 AM
Hello,
you could use Paramiko. The link below is a good read:
https://4sysops.com/archives/cisco-config-backup-with-python/
09-18-2022 06:25 AM
Yes ...I have done the same unable to get a backup configuration from my router R120
after running this scrip there is no error as well
09-18-2022 09:36 AM
Hello,
--> in this script, there is no target IP address
Did configure the --devicelist = "device-list1.txt" ? The text file should contain all of your target IP addresses...
09-18-2022 10:29 PM
Hi,
I have created device list and its generated one file after running script in that "Line has invalid autocommand "show run"
09-19-2022 12:34 AM - edited 09-19-2022 12:39 AM
Hello,
the script looks by the book. I'll try and find what causes this error...
EDIT: I wonder if the problem is the 'show run' you are trying to execute. Do you get the same error when you run e.g. 'sh clock' ?
09-19-2022 02:46 AM
the script in enable mode login to the router, since show run command is not accepting in the router
R43>sh run
^
% Invalid input detected at '^' marker.
09-19-2022 02:57 AM
My router login stage is as follows and I believe this script is executed in user mode
login as: admin
| Password:
R120>en
Password:
R120#
10-17-2022 07:04 AM
Hi,
Please help to resolve this issue ...
10-17-2022 08:30 AM
Hello,
can you post the full running config (sh run) of R120 ?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide