Bug 249027

Summary: net-mgmt/monitoring-plugins unable to set port with check_dig
Product: Ports & Packages Reporter: Joakim Lindblom <joakim.lindblom>
Component: Individual Port(s)Assignee: Mathieu Arnold <mat>
Status: Closed FIXED    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (mat)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Joakim Lindblom 2020-08-31 10:37:42 UTC
Using -p for check_dig seems to put the port option for drill after name and server arguments which does not seem to work when using drill.

check_dig -v -H 10.10.10.10 -p 5353 -l test.test
will run
/usr/bin/drill  @10.10.10.10 -z -p 5353  test.test A

An ugly hack with a manual argument seems to work as the port argument will be placed earlier in the command.

check_dig -v -H 10.10.10.10 -p 5353 -l test.test -A '-p 5353'
will run
/usr/bin/drill -p 5353 @10.10.10.10 -z -p 5353  test.test A

The first drill command will ignore the port option but the second will work.

The man pages for drill says "drill [ OPTIONS ] name [ @server ] [ type ] [ class ]" so this argument might need to be moved to a former position in the command.

Maybe this should be solved in the extra-patch-dig-to-drill.diff file?
Comment 1 Mathieu Arnold freebsd_committer freebsd_triage 2020-08-31 12:26:40 UTC
Yes, it should, the patch is a bit old, fixing it.
Comment 2 commit-hook freebsd_committer freebsd_triage 2020-08-31 12:40:32 UTC
A commit references this bug:

Author: mat
Date: Mon Aug 31 12:39:59 UTC 2020
New revision: 547174
URL: https://svnweb.freebsd.org/changeset/ports/547174

Log:
  Fix check_dig when it uses drill and when changing the port.

  PR:		249027
  Reported by:	Joakim Lindblom

Changes:
  head/net-mgmt/monitoring-plugins/Makefile
  head/net-mgmt/monitoring-plugins/files/extra-patch-dig-to-drill.diff
  head/net-mgmt/monitoring-plugins/pkg-help
  head/net-mgmt/monitoring-plugins/pkg-plist
  head/net-mgmt/nagios-plugins/Makefile
  head/net-mgmt/nagios-plugins/files/extra-patch-dig-to-drill.diff
  head/net-mgmt/nagios-plugins/pkg-plist