node_pcap icon indicating copy to clipboard operation
node_pcap copied to clipboard

icmp tracking

Open danielzzz opened this issue 14 years ago • 7 comments

hi!

is it possible to send and monitor ping packets with this library?

thx, regards, dz

danielzzz avatar Aug 16 '10 17:08 danielzzz

You can certainly decode them right now, which might sort of helps.

There isn't a good way to send them yet. I'd like to expose pcap_inject(), but that needs a bit more plumbing.

mranney avatar Aug 16 '10 21:08 mranney

ok, great - looking forward to it - this would allow for some uptime monitoring

danielzzz avatar Aug 16 '10 21:08 danielzzz

In the meantime, you can generate UDP probes using node's dgram support and watch for the ICMP to come back.

mranney avatar Aug 16 '10 21:08 mranney

I need to figure out how to do it, but thanks for a hint!

danielzzz avatar Aug 17 '10 19:08 danielzzz

hi, I did what you suggested and it works moreless fine (some hosts don't answer to udp probes and still answer to ping). But when I try to check hosts on an openvpn network (interface tun) I get the following warrning: pcap.js: decode.packet() - Don't yet know how to decode link type Unknown linktype 12

is it something you have plans to implement?

danielzzz avatar Aug 19 '10 15:08 danielzzz

btw. here is the script I am testing it with: http://github.com/danielzzz/node-ping

danielzzz avatar Aug 19 '10 16:08 danielzzz

I've added support for linktype 12.

Bummer about the UDP probes getting filtered. Support for pcap_inject is coming at some point.

mranney avatar Aug 20 '10 06:08 mranney