Last active
July 18, 2021 20:56
-
-
Save ksator/93aea7fcba92b9db5e12d5cbdba22788 to your computer and use it in GitHub Desktop.
ping and traceroute from pyez
This file contains 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="xxx", user="xxx", password="xxx") | |
dev.open() | |
test1=dev.rpc.ping(host="8.8.8.8") | |
print etree.tostring(test1) | |
test2=dev.rpc.traceroute(host="8.8.8.8") | |
print etree.tostring(test2) | |
#or use StartShell object and issue (cli- c “ping 10.101.2.2 count 5 rapid”) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment