-
-
Save dirkakrid/e738737da9e2c88741e2e2d0947657cb to your computer and use it in GitHub Desktop.
Using xpath to parse junos router configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jnpr.junos import Device | |
from lxml import etree | |
dev = Device(host='2001:DB8::1', user='jeffl', passwd='pass123') | |
dev.open() | |
config = dev.rpc.get_config() | |
interface_ip = config.xpath("//interface[name='ge-0/0/1']/unit/family/inet/address/name")[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment