Description of problem: When the check is performed with the -4 parameter,a simple ping without -4 is used. This cause problems when using a DNS name as the destination with both IPv4 and IPv6 addresses. By default, ping uses IPv6 if available in DNS and does not make an IPv4 fallback. Therefore, the check fail if IPv4 is reachable, but IPv6 is not and the -4 parameter is passed to the check. The check assumes 'ping' is v4 only (as opposed to ping6). Version-Release number of selected component (if applicable): check_ping v2.4.9 (nagios-plugins 2.4.9) How reproducible: Steps to Reproduce: 1. Set a hosts entry for a reachable IPv4 and a not reachable IPv6 address: echo "23.220.75.232 example.com" >> /etc/hosts echo "2001:DB8::1 example.com" >> /etc/hosts 2. Use following command to check: /usr/lib64/nagios/plugins/check_ping -4 -H example.com -c 200,15% -w 100,5% -s Actual results: Check fail because the previous used IPv6 Documentation Space is not reachable Expected results: Check succeed because the requested check was for IPv4 only and this is reachable. Additional info: There is also an upstream issue: https://github.com/nagios-plugins/nagios-plugins/issues/684 I already rebuild the check with the following patch: diff --git a/nagios-plugins.spec b/nagios-plugins.spec index 0935321..06732f1 100644 --- a/nagios-plugins.spec +++ b/nagios-plugins.spec @@ -626,7 +626,7 @@ Provides check_wave support for Nagios. --with-ps-command="`which ps` -eo 's uid pid ppid vsz rss pcpu etime comm args'" \ --with-ps-format='%s %d %d %d %d %d %f %s %s %n' \ --with-ps-cols=10 \ - --with-ping-command='%{_bindir}/ping -n -U -w %d -c %d %s' \ + --with-ping-command='%{_bindir}/ping -4 -n -U -w %d -c %d %s' \ --with-ping6-command='%{_sbindir}/ping6 -n -U -w %d -c %d %s' \ --enable-extra-opts \ --with-ps-varlist='procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos' The patched check returns the expected result. I also checked the behaviour in other ways and found the following changes in the results: Before: IPv4 and IPv6 reachable -> check_ping -4 -> OK Only IPv6 reachable -> check_ping -4 -> OK Only IPv4 reachable -> check_ping -4 -> CRITICAL IPv4 and IPv6 not reachable -> check_ping -4 -> CRITICAL After: IPv4 and IPv6 reachable -> check_ping -4 -> OK Only IPv6 reachable -> check_ping -4 -> CRITICAL Only IPv4 reachable -> check_ping -4 -> OK IPv4 and IPv6 not reachable -> check_ping -4 -> CRITICAL The behaviour of IPv4/IPv6-only servers does not change with or without the -4/-6 parameter.
Hey, did you find some time to have a lock at the issue?
I'm working to add your patch
FEDORA-2026-fa2270733e (nagios-plugins-2.4.12-4.fc44) has been submitted as an update to Fedora 44. https://bodhi.fedoraproject.org/updates/FEDORA-2026-fa2270733e
FEDORA-2026-bb831183e9 (nagios-plugins-2.4.12-4.fc43) has been submitted as an update to Fedora 43. https://bodhi.fedoraproject.org/updates/FEDORA-2026-bb831183e9
FEDORA-EPEL-2026-459ccc6562 (nagios-plugins-2.4.12-4.el10_2) has been submitted as an update to Fedora EPEL 10.2. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-459ccc6562
FEDORA-EPEL-2026-16e98d67cd (nagios-plugins-2.4.12-4.el9) has been submitted as an update to Fedora EPEL 9. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-16e98d67cd
FEDORA-2026-fa2270733e has been pushed to the Fedora 44 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-fa2270733e` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-fa2270733e See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2026-bb831183e9 has been pushed to the Fedora 43 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-bb831183e9` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-bb831183e9 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-EPEL-2026-459ccc6562 has been pushed to the Fedora EPEL 10.2 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-459ccc6562 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-EPEL-2026-16e98d67cd has been pushed to the Fedora EPEL 9 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-16e98d67cd See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
Hey, thanks for the quick patch, but is there a way to get the fix also to EPEL 8?
FEDORA-EPEL-2026-d5a1dd223e (nagios-plugins-2.4.12-4.el8) has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-d5a1dd223e
Thank you very much
FEDORA-EPEL-2026-d5a1dd223e has been pushed to the Fedora EPEL 8 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2026-d5a1dd223e See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2026-bb831183e9 (nagios-plugins-2.4.12-4.fc43) has been pushed to the Fedora 43 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-EPEL-2026-459ccc6562 (nagios-plugins-2.4.12-4.el10_2) has been pushed to the Fedora EPEL 10.2 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-EPEL-2026-16e98d67cd (nagios-plugins-2.4.12-4.el9) has been pushed to the Fedora EPEL 9 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2026-fa2270733e (nagios-plugins-2.4.12-4.fc44) has been pushed to the Fedora 44 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-EPEL-2026-d5a1dd223e (nagios-plugins-2.4.12-4.el8) has been pushed to the Fedora EPEL 8 stable repository. If problem still persists, please make note of it in this bug report.