What's the best way to ping many network devices in parallel?

后端 未结 6 2100
鱼传尺愫
鱼传尺愫 2021-02-09 09:36

I poll a lot of devices in network (more than 300) by iterative ping.

The program polls the devices sequentially, so it\'s slow. I\'d like to enhance the speed of pollin

6条回答
  •  借酒劲吻你
    2021-02-09 10:42

    Please give a try on "chknodes" parallel ping for Linux which will send a single ping to all nodes of your network. It will do also dns reverse lookup and request http response if specified so. It's written completely in bash i.e. you can easily check it or modify it to your needs. Here is a printout of help:

    chknodes -h

    chknodes ---- fast parallel ping

    chknodes [-l|--log] [-h|--help] [-H|--http] [-u|--uninstall] [-v|--version] [-V|--verbose]

    -l | --log Log to file -h | --help Show this help screen -H | --http Check also http response -n | --names Get also host names -u | --uninstall Remove installation -v | --version Show version -V | --verbose Show each ip address pinged

    You need to give execute right for it (like with any sh/bash script) in order to run it:

    chmod +x chknodes
    

    On the first run i.e.

    ./chknodes
    

    it will suggest to install itself to /usr/local/bin/chknodes, after that giving just

    chknodes
    

    will be enough. You can find it here:

    www.homelinuxpc.com/download/chknodes

提交回复
热议问题