0

I'm looking for solution, how to be able to ping some 5000 (up to 10000) IP addresses on a local network each 1 second and immediatelly, when any icmp packet timeouts, it will write output to a file with the unix epoch time of the lost packet and IP address. So I'll be able to measure the length of the network outages in seconds to every IP address.

I'm trying to run that much ping commands in a infinite cycle for each IP address now (so I have a lot of running processes - for all IP addresses I'm sending just one packet. Than ping command finishes itself, I manage its output and run ping command again and so on). But I somehow feel this is not the best way how to do this :|

I can write scripts just in bash and PHP but not in C++, ... So I prefer if you have a solution for my skills :)

Thank you in advance. Pep.

PS: I guess I know how fping works, and I think it is too much slow. It can not ping 5000 IP addresses every second am I right?

user2616411
  • 1
  • 1
  • 3
  • Pinging 5000-10000 machines every second all day long will earn you a lot of hatred from your network admins. Are you really sure you want to do that, or need to do that? – fvu Jul 24 '13 at 22:20
  • I`m admin and owner of the whole local backbone network, so this is not a problem. But yes, few thousands od IP address are our customers, which should not mind to be pinged just once a second, I guess. This is a big try from my side, but I`ll have very detailed statistics how backbone behaves, if it will work. And if I see that one second ping is too much I can still go to two seconds, which is still good. – user2616411 Jul 24 '13 at 22:26

3 Answers3

0

I think this package can help you http://verplant.org/liboping/.

bk1te
  • 1
0

aping can do this.

Example below polls 8192 addresses in less than a second, waits a second and then does it again. Any changes in status to any hosts between polls are written out.

aping -rate 10000 -show delta -sleep 1 10.0.0.0/19
disk eater
  • 121
  • 2
-1
ping IP_ADDRESS_HERE /n NUMBER_OF_PINGS_HERE -l PACKET_SIZE_HERE & ping IP_ADDRESS_HERE /n NUMBER_OF_PINGS_HERE -l PACKET_SIZE_HERE 

Two pings running in one line. Very simple. Add more by adding a & mark.

  • The question is how you can run thousands of pings **in parallel**. Your approach runs them **in series**, that is, one after the other. If the average round trip time is 50 ms, running 5000 would take 250 seconds, more than 4 minutes, and the OP would like to do this every second. And this is not even counting that some pings could timeout and take much longer, which must be considered, given that detecting timeouts is exactly the purpose of all of this. – Fabio says Reinstate Monica Mar 30 '17 at 00:51