czerwonk / ping_exporter

Prometheus exporter for ICMP echo requests using https://github.com/digineo/go-ping
MIT License
512 stars 112 forks source link

IP is marked as unavailable but it is available #114

Open q000p opened 2 months ago

q000p commented 2 months ago

This is info from IP:9427/metrics

# HELP ping_loss_ratio Packet loss from 0.0 to 1.0
# TYPE ping_loss_ratio gauge
ping_loss_ratio{ip="192.168.60.3",ip_version="4",target="192.168.60.3"} 0
ping_loss_ratio{ip="192.168.91.1",ip_version="4",target="192.168.91.1"} 1
ping_loss_ratio{ip="192.168.92.1",ip_version="4",target="192.168.92.1"} 1

And I tried to ping this hosts:

root@monitoring:~# ping 192.168.91.1
PING 192.168.91.1 (192.168.91.1) 56(84) bytes of data.
64 bytes from 192.168.91.1: icmp_seq=1 ttl=62 time=203 ms
64 bytes from 192.168.91.1: icmp_seq=2 ttl=62 time=203 ms
64 bytes from 192.168.91.1: icmp_seq=3 ttl=62 time=202 ms
64 bytes from 192.168.91.1: icmp_seq=4 ttl=62 time=203 ms

--- 192.168.91.1 ping statistics ---
5 packets transmitted, 4 received, 20% packet loss, time 4002ms
rtt min/avg/max/mdev = 202.318/202.836/203.260/0.356 ms
root@monitoring:~# ping 192.168.92.1
PING 192.168.92.1 (192.168.92.1) 56(84) bytes of data.
64 bytes from 192.168.92.1: icmp_seq=1 ttl=62 time=203 ms
64 bytes from 192.168.92.1: icmp_seq=2 ttl=62 time=202 ms
64 bytes from 192.168.92.1: icmp_seq=3 ttl=62 time=203 ms
64 bytes from 192.168.92.1: icmp_seq=4 ttl=62 time=204 ms

--- 192.168.92.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 202.345/203.057/203.979/0.626 ms

What reason to show wrong info?

IaroslavSapak commented 2 months ago

also have the same problem. If I restart the service all starts to work well and metrics show real loss