Description of problem: The hostname parameter -H is matched against [a-z][a-z0-9]+ for each domain component (actual regexp is a little more complex), so single character domain components fail. Version-Release number of selected component (if applicable): nagios-plugins-ntp-2.2.1-16.20180725git3429dad.el7.x86_64 How reproducible: always Steps to Reproduce: 1. check_ntp -H ntp.i.bitbit.net Actual results: you get error message "No target host specified" (very misleading in itself, it should say "Invalid hostname" or similar instead IMHO) Expected results: use ntp.i.bitbit.net as reference clock. Additional info: bonus issue: the same regexp will also disallow literal IPv6 literal addresses
another example of a hostname which is disallowed is "0.pool.ntp.org". here is a suggested regexp which handles the domain names and IPv6 as a bonus (does not accept IPv4-in-IPv6 literals, only pure v6 literals) my $host = $opt_H if ($opt_H && ($opt_H =~ m/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/ || # IPv4 $opt_H =~ m/^([0-9a-f]{1,4}:){7}([0-9a-f]{1,4})$/i || # IPv6 without :: $opt_H =~ m/^:(:[0-9a-f]{1,4})+$/i || # IPv6 with leading :: $opt_H =~ m/^([0-9a-f]{1,4}:)+:$/i || # IPv6 with trailing :: $opt_H =~ m/^([0-9a-f]{1,4}:)+(:[0-9a-f]{1,4})+$/i || # IPv6 with middle :: $opt_H =~ m/^[a-z0-9][-a-z0-9]*(\.[a-z0-9][-a-z0-9]*)*$/)); # hostnames
Thanks for both the bug and the patch. I would ask that you open this upstream, but that was rather 'dead' when I looked earlier this year. However I do recommend it in case it starts up so others can get this fix.
FEDORA-EPEL-2019-9b63c08c0f has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-9b63c08c0f
FEDORA-EPEL-2019-22c97df420 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-22c97df420
nagios-plugins-2.2.1-17.20190829gitfb792ff.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-22c97df420
nagios-plugins-2.2.1-17.20190829gitfb792ff.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2019-9b63c08c0f
FEDORA-2019-fef2650216 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-fef2650216
nagios-plugins-2.2.1-17.20190829gitfb792ff.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-fef2650216
nagios-plugins-2.2.1-17.20190829gitfb792ff.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.
nagios-plugins-2.2.1-17.20190829gitfb792ff.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.
nagios-plugins-2.2.1-17.20190829gitfb792ff.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report.