Multi IP Ping Host Table

Create bash script to quick ping all the hosts from ip list text file.

By using basic command grep & ping,  one script to check unlimited Host live or not by ping response.
[[email protected] ~]$ vi ip.txt

 
 
 
 
[[email protected] ~]$ vi ping-check.sh
—– Copy Script —–

#!/bin/sh
 grep -v "#" ip.txt | awk '{print $1}' | while read host
 do
 ping -c 1 $host
 done


Note: Do not keep blank lines in file other wise your and your mileage may differ slightly.
Give executable permission to .sh script
[[email protected] ~]$ chmod +x ping-check.sh
Run the script
[[email protected] ~]$ sh ping-check.sh
Get the output

By getting this output you will see the host response.
Enjoy..

5 comments
0 likes
Prev post: Data Backup in secure modeNext post: Nagios Core Monitoring System

Comments

  • Tnk sng

    March 27, 2018 at 6:07 am
    Reply

    This script free me from my daily stress, thanks Linuxmunch Keep it up.

  • try these out

    August 15, 2018 at 11:08 am
    Reply

    Wow, this post is fastidious, my sister is analyzing these things, so I am going to inform her.

  • omit

    August 16, 2018 at 4:52 am
    Reply

    I feel that is among the such a lot significant information for me. And i'm happy studying your article. But want to remark on some common […] Read MoreI feel that is among the such a lot significant information for me. And i'm happy studying your article. But want to remark on some common issues, The web site taste is perfect, the articles is truly nice : D. Good task, cheers Read Less

  • ziva

    August 16, 2018 at 5:50 pm
    Reply

    Hello! Do you use Twitter? I'd like to follow you if that would be okay. I'm undoubtedly enjoying your blog and look forward to new posts.

  • great post to read

    August 30, 2018 at 4:32 pm
    Reply

    I am sure this piece of writing has touched all the internet users, its really really pleasant paragraph on building up new weblog.

Leave a Reply

Your email address will not be published. Required fields are marked *

Aidbs Gallery
Latest Posts
Categories
Archives