Search
| Applying Ping Tool in SCRIPT |
|
|
|
| Networking - Basic Networking |
| Monday, 29 June 2009 11:13 |
|
![]()
Applying Ping Tool in SCRIPT:Ping is a universal command that is available on every operating system to test the reach-ability of a network.This principle can be used to check the existence of certain machines on the network by just using ping. To find which all machine are up in the current network,we write shell script. Open the vi editor as superuser/root and write the following lines in it. vi checker.sh <--------- command to create shell script file Files to be written in file #bin/bash for i in 192.168.1.{1..255} do ping -c2 $i >dev/null; [$? -eq 0]&& echo $i is system up. trap "exit" SIGINT applied. done save the file and execute it it. Output will be look similar like this. checker.sh <-------------- command to ex-cute 192.168.1.0 is up 192.168.1.10 is up 192.168.1.22 is up 192.168.1.34 is up |
| Last Updated on Thursday, 02 July 2009 06:31 |





