Home  >  Q&A  >  body text

python - I want to make a batch ping tool. What method is faster and better?

There are about thousands of machines, so it is best to support machine name detection. What method is everyone using?

怪我咯怪我咯2686 days ago887

reply all(6)I'll reply

  • 世界只因有你

    世界只因有你2017-06-12 09:22:41

    Linux writes shell scripts directly
    Windows uses dos scripts

    reply
    0
  • 学习ing

    学习ing2017-06-12 09:22:41

    Just write a script for this kind of batch

    reply
    0
  • 扔个三星炸死你

    扔个三星炸死你2017-06-12 09:22:41

    ansible?

    reply
    0
  • 为情所困

    为情所困2017-06-12 09:22:41

    My company has recently implemented a ping monitoring tool. It is an open source tool and has some memory leaks. I have modified it slightly. I put it on one of my test vps. The download address is 118.184.56.18/ping.zip. The speed may be a bit slow. After you unzip it, add the machine you want to ping in config.json under conf in the directory, and be sure to change the Type to C. If you have many machines, you can consider writing a script to add them to the configuration in batches. But I found that if json is compressed, the program cannot run, and I don't know how to deal with it. This program is for continuous ping monitoring and will also generate a graphical interface on port 8899. If you only want to do a single monitoring, you can adjust the monitoring interval to a longer time, then run and wait to generate the results (sqlite in the db directory adds the records you want) and then kill the program. Then read the database and you can see a series of ping data. However, if you have thousands of machines pinging at the same time, they may consume more resources. Because this program uses the native ping of Linux system

    reply
    0
  • 女神的闺蜜爱上我

    女神的闺蜜爱上我2017-06-12 09:22:41

    python's nmap moudle may help you I think

    reply
    0
  • 滿天的星座

    滿天的星座2017-06-12 09:22:41

    Hmm. . . Try Smokeping?

    reply
    0
  • Cancelreply