NetEng PyScript 1: Mass Ping

Python Scripts For Network Engineers 1: Mass Ping


import subprocess
import os
import sys

for ping in range(1,32): #(x,y) x = starting range; y = ending range but not including
address = sys.argv[1] + str(ping)
x =[‘ping’, ‘-c’, ’3′, ‘-W’, ’1′, address])
        if x == 0:
                printping to“, address, “OK
        elif x == 2:
                printno response from“, address
                printping to“, address, “failed!




Pings would then start from up to

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Current month ye@r day *

Notify via Email Only if someone replies to My Comment is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to