Collect Config Backup on Juniper using Python (Simple and Easy Script)

Published: 25 August 2024
on channel: Network Tips and Topics - Plexinor
201
2

"Want more expert insights and updates? Follow us on LinkedIn and explore our company page to connect with us directly. Don’t miss out - click the link and join the conversation!"

Follow us on LinkedIn   / plexinor  
Company Website Https://www.plexinor.com


lab@admin:~$ cat get-configs-in-text
from napalm import get_network_driver
import json
from pprint import pprint
from datetime import datetime
from getpass import getpass
import os
import datetime
from time import time

junos_driver = get_network_driver("junos")
mx_router = junos_driver('192.168.0.132', 'lab',
'lab123')
mx_router.open()
facts = mx_router.get_facts()
hostname = facts['hostname']
date = datetime.datetime.now().strftime('%Y-%m-%d_%H:%M:%S')
conf=open( hostname +'__'+ date + '_config.txt','w')
conf.write(mx_router.get_config()['running'])
conf.close()
mx_router.close()


On this page of the site you can watch the video online Collect Config Backup on Juniper using Python (Simple and Easy Script) with a duration of hours minute second in good quality, which was uploaded by the user Network Tips and Topics - Plexinor 25 August 2024, share the link with friends and acquaintances, this video has already been watched 201 times on youtube and it was liked by 2 viewers. Enjoy your viewing!