Heartbeat requires network capabilities for ICMP
kvalev opened this issue · 3 comments
Starting an ICMP monitor when running the heartbeat docker image results in the following error:
2017/02/24 02:53:36.459997 loop.go:330: INFO IPv4 ICMP not supported: listen ip4:icmp : socket: operation not permitted
2017/02/24 02:53:36.460013 loop.go:330: INFO IPv6 ICMP not supported: listen ip6:ipv6-icmp : socket: operation not permitted
2017/02/24 02:53:36.460129 manager.go:125: ERR failed to load monitor tasks: failed to initiate IPv4 support when initializing monitor icmp(0)
This can be fixed by setting the network capabilities not only for packetbeat, but also for heartbeat.
As a workaround, the following custom docker image can be used:
FROM docker.elastic.co/beats/heartbeat:5.2.1
USER root
RUN setcap cap_net_raw,cap_net_admin=eip /usr/share/heartbeat/heartbeat
USER heartbeat
Thanks for the high-quality report!
This is fixed in 022eef2 and a new image has been pushed for docker.elastic.co/beats/heartbeat:5.2.1
.
Thanks for the quick fix. I would suggest to also update the README by giving a short explanation/example (similar to the Packetbeat one) on how to configure Heartbeat.
Good idea, thanks. The README will be replaced with formal documentation soon, but it's a great place to capture things that need to make it into the docs.