node-ping: Wrong alive result on different systems

I am running ping with promise on macOS and it works fine, however when I pushed the code to production server which is Linux 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux I get this result

{ 
  host: 'google.com',
  alive: false,
  output: 'PING google.com (46.162.192.44) 56(84) bytes of data.\n64 bytes from 46.162.192.44: icmp_seq=1 ttl=60 time=1.62 ms\n64 bytes from 46.162.192.44: icmp_seq=2 ttl=60 time=1.53 ms\n\n--- google.com ping statistics ---\n2 packets transmitted, 2 received, 0% packet loss, time 1001ms\nrtt min/avg/max/mdev = 1.531/1.577/1.623/0.046 ms\n',
  time: 1.62 
}

Why is the alive value false when the packet loss is 0%. I ended up manually checking the out put for the correct result.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15

Commits related to this issue

Most upvoted comments

ah, I see ))) seems to be working now, thanks 👍 when will this be pushed to npm?