check_dns reports "OK" when nslookup fails with "connection refused"

Bug #1992535 reported by andrew bezella
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
monitoring-plugins (Ubuntu)
New
Undecided
Unassigned

Bug Description

the behavior of `nslookup` appears to have changed between 9.16.1-Ubuntu and 9.18.1-1ubuntu1.2-Ubuntu. when a nameserver is down the 9.16.1-Ubuntu version reports:
;; connection timed out; no servers could be reached

while the 9.18.1-1ubuntu1.2-Ubuntu version reports:
;; communications error to 207.241.225.184#53: connection refused

however, the `check_dns` plugin was not updated for this new output. this results in an incorrect "OK" when the service being checked has in fact been stopped:

% nslookup -sil www.archive.org. 207.241.225.184
;; communications error to 207.241.225.184#53: connection refused
% /usr/lib/nagios/plugins/check_dns --server=207.241.225.184 --hostname=www.archive.org.
DNS OK: 0.031 seconds response time. www.archive.org. returns |time=0.030945s;;;0.000000

the attached patch (based on https://github.com/monitoring-plugins/monitoring-plugins/pull/1634) seems to resolve the issue.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: monitoring-plugins-standard 2.3.1-1ubuntu4
ProcVersionSignature: Ubuntu 5.15.0-48.54-generic 5.15.53
Uname: Linux 5.15.0-48-generic x86_64
ApportVersion: 2.20.11-0ubuntu82.1
Architecture: amd64
CasperMD5CheckResult: unknown
Date: Tue Oct 11 16:54:27 2022
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/zsh
SourcePackage: monitoring-plugins
UpgradeStatus: Upgraded to jammy on 2022-10-03 (8 days ago)

Revision history for this message
andrew bezella (abezella) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "local-check_dns_nslookup_unreachable.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.