Control: tags -1 unreproducible moreinfo

On 11/19/26 3:05 PM, Andre Klärner wrote:
I automatically installed monitoring-plugins-basic v3.0.3+ds-2 earlier
in the morning, and noticed that check_icmp now cannot be convinced to
execute any check, always with the following pattern:

kandre@mainframe(pts/2) ~ % /usr/lib/nagios/plugins/check_icmp -4 172.16.0.253 
-v
add_target called with argument 172.16.0.253
add_target_ip called with: 172.16.0.253
check_icmp: No hosts to check

I can reproduce this, but -H <IP> should be used.

kandre@mainframe(pts/2) ~ %

This does not change when hostnames are given as arguments, or when
explicitly using -H instead of relying on the positional arg. It happens
with hosts that resolve to IPv6, IPv4 or both. Also no kind of literal
IP helps.

-H <IP> works as expected for me:

$ /usr/lib/nagios/plugins/check_icmp -4 -H 172.16.0.253 -v
add_host called with argument 172.16.0.253
add_target called with argument 172.16.0.253
add_target_ip called with: 172.16.0.253
ttl set to 64
setsockopt failed
packets: 5, targets: 1
target_interval: 0.000
crit.rta: 500.000
max_completion_time: 3000.000
crit = {500000, 80%}, warn = {200000, 40%}
target_interval: 0
icmp_pkt_size: 76  timeout: 10
*timeout is not
*timeout is not
*timeout is not
*timeout is not
time_passed: 65  final_wait: 2999935  max_completion_time: 3000000
Waiting for 2999935 micro-seconds (2999.935 msecs)
icmp_sent: 5  icmp_recv: 0  icmp_lost: 0
targets: 1  targets_alive: 1
targets: 1, targets_alive: 1, hosts_ok: 0, hosts_warn: 0, min_hosts_alive: -1
[CRITICAL] - packet loss 100.0% >= 80%
        \_[CRITICAL] - 172.16.0.253
                \_[CRITICAL] - 172.16.0.253
                        \_[OK] - rta 0.000ms
                        \_[CRITICAL] - packet loss 100.0% >= 
80%|'172.16.0.253pl'=100.000000%;;;

The same goes for hosts that resolve to IPv6 addresses:

$ /usr/lib/nagios/plugins/check_icmp -H 8.8.4.4 -H dns.google.com
[OK] - ok=2
        \_[OK] - dns.google.com
                \_[OK] - 2001:4860:4860::8844
                        \_[OK] - rta 8.535ms
                        \_[OK] - packet loss 0.0%
        \_[OK] - 8.8.4.4
                \_[OK] - 8.8.4.4
                        \_[OK] - rta 5.677ms
                        \_[OK] - packet loss 
0.0%|'2001:4860:4860::8844rta'=8ms;;; '2001:4860:4860::8844rtmin'=8.138000ms;;; 
'2001:4860:4860::8844rtmax'=8.984000ms;;; '2001:4860:4860::8844pl'=0.000000%;;; 
'8.8.4.4rta'=5ms;;; '8.8.4.4rtmin'=5.661000ms;;; '8.8.4.4rtmax'=5.712000ms;;; 
'8.8.4.4pl'=0.000000%;;;


Make sure that the capabilities are applied:

# getcap /usr/lib/nagios/plugins/check_icmp
/usr/lib/nagios/plugins/check_icmp cap_net_raw=ep

See also: 
https://sources.debian.org/src/monitoring-plugins/3.0.3%2Bds-2/debian/README.Debian#L68

Kind Regards,

Bas

--
 PGP Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1

Reply via email to