Bug 2414403 - nagios-plugins-ping with -4 also checks for IPv6 when using dualstacked dns name
Summary: nagios-plugins-ping with -4 also checks for IPv6 when using dualstacked dns name
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: nagios-plugins
Version: epel9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Guido Aulisi
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-11-12 10:04 UTC by ETES GmbH
Modified: 2026-03-07 03:06 UTC (History)
4 users (show)

Fixed In Version: nagios-plugins-2.4.12-4.fc43 nagios-plugins-2.4.12-4.el10_2 nagios-plugins-2.4.12-4.el9 nagios-plugins-2.4.12-4.fc44 nagios-plugins-2.4.12-4.el8
Clone Of:
Environment:
Last Closed: 2026-03-04 00:56:18 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description ETES GmbH 2025-11-12 10:04:28 UTC
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.

Comment 1 ETES GmbH 2026-02-18 18:02:44 UTC
Hey, did you find some time to have a lock at the issue?

Comment 2 Guido Aulisi 2026-02-22 08:56:38 UTC
I'm working to add your patch

Comment 3 Fedora Update System 2026-02-23 14:45:33 UTC
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

Comment 4 Fedora Update System 2026-02-23 14:55:29 UTC
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

Comment 5 Fedora Update System 2026-02-23 15:06:34 UTC
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

Comment 6 Fedora Update System 2026-02-23 15:44:02 UTC
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

Comment 7 Fedora Update System 2026-02-24 01:15:38 UTC
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.

Comment 8 Fedora Update System 2026-02-24 01:30:23 UTC
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.

Comment 9 Fedora Update System 2026-02-24 02:05:07 UTC
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.

Comment 10 Fedora Update System 2026-02-24 02:05:15 UTC
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.

Comment 11 ETES GmbH 2026-02-25 08:15:05 UTC
Hey, thanks for the quick patch, but is there a way to get the fix also to EPEL 8?

Comment 12 Fedora Update System 2026-02-27 07:35:51 UTC
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

Comment 13 ETES GmbH 2026-02-27 10:05:07 UTC
Thank you very much

Comment 14 Fedora Update System 2026-02-28 02:26:31 UTC
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.

Comment 15 Fedora Update System 2026-03-04 00:56:18 UTC
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.

Comment 16 Fedora Update System 2026-03-04 02:07:35 UTC
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.

Comment 17 Fedora Update System 2026-03-04 02:13:29 UTC
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.

Comment 18 Fedora Update System 2026-03-07 00:25:21 UTC
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.

Comment 19 Fedora Update System 2026-03-07 03:06:34 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.