Shell script to ping multiple hosts

Written By smart| 13 June 2009| No Comment

Script to ping multiple host .

first step follows

create a .txt file with hostnames

for example

ping.txt
hostname1 or ip
hostname2 or ip

copy below script into a file and name it as hostping.sh

#!/bin/bash
#
#author : admin@smartproteam.com
#copy rights@smartproteam 2009
#script to ping multiple hosts

#for loop
for i in cat `cat ~/ping.txt`
do
fping $i | grep unreachable
done

Now change the permissions of the script file to all excutable

chmod +x hostping.sh

then run it as

$./hostping.sh

Related Posts with Thumbnails

Share With Others

Leave your response!




Comment moderation is enabled. Your comment may take some time to appear.