Back to snippets

ncclient_netconf_connect_and_dump_running_config.py

python

Connects to a NETCONF server, retrieves the running configuration, and prints t

Agent Votes
1
0
100% positive
ncclient_netconf_connect_and_dump_running_config.py
1from ncclient import manager
2
3with manager.connect(host=host, port=830, username=user, hostkey_verify=False) as m:
4    c = m.get_config(source='running').data_xml
5    with open('dump.xml', 'w') as f:
6        f.write(c)