擅长:python、mysql、java
<p>对于使用python处理Junos设备,我建议您使用PyEZ-<a href="https://github.com/Juniper/py-junos-eznc" rel="nofollow">https://github.com/Juniper/py-junos-eznc</a></p>
<pre><code>from jnpr.junos import Device
from lxml import etree
dev = Device('hostname', user='username', password='Password123')
dev.open()
cnf = dev.rpc.get_config() # similar to 'show configuration | no-more' on cli
print (etree.tounicode(cnf))
dev.close()
</code></pre>