Skip to content

Instantly share code, notes, and snippets.

@ksator
Last active July 18, 2021 20:56
Show Gist options
  • Save ksator/93aea7fcba92b9db5e12d5cbdba22788 to your computer and use it in GitHub Desktop.
Save ksator/93aea7fcba92b9db5e12d5cbdba22788 to your computer and use it in GitHub Desktop.
ping and traceroute from pyez
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