Blog Archives

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 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