scripting
Good Morning
I have 20 Linux machnies with static IP's and all this machnies are installed with redhat enterprise linux 4.3 . I want to write a script to check how many machnies are up and how many machnies are down. Please help me out its urgent... Thanks and Regards Rehan |
Well a quick 'n dirty way is:
Code:
# Assume list of ip addrs in a file, 1 ip per line |
try to use nmap. it's a lot quicker.
Code:
nmap -n -sP -iL ips.dat |
Thanks you very much for the replies.
# Assume list of ip addrs in a file, 1 ip per line for ip in `cat ips.dat` do ping -c1 $ip >/dev/null/ 2>&1 if [[ $? -eq 0 ]] then echo "$ip is up" else echo "$ip is down" fi done The code really helped me.i have just made modifications according to my requirment Thanks u very much |
All times are GMT -5. The time now is 07:37 AM. |