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

PR:		249027
Reported by:	Joakim Lindblom
This commit is contained in:
Mathieu Arnold 2020-08-31 12:39:58 +00:00
parent 7354fc1b89
commit 5012daeff6
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=547174
7 changed files with 18 additions and 45 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= monitoring-plugins
PORTVERSION= 2.2
PORTREVISION= 8
PORTREVISION= 9
CATEGORIES= net-mgmt
MASTER_SITES= https://www.monitoring-plugins.org/download/ LOCAL/mat/${PORTNAME}
@ -37,7 +37,7 @@ SSH_PORTABLE_DESC= Build check_ssh with ports openssh (instead of base)
DNS_DESC= Configuration of check_dig and check_dns (see help)
DNS_BASE_DESC= >= 10 means drill for check_dig and no check_dns
DNS_BASE_DESC= Use drill for check_dig and no check_dns
DNS_BINDTOOLS_DESC= Use dig and nslookup from dns/bind-tools
EXTRAOPTS_CONFIGURE_ENABLE= extra-opts
@ -109,6 +109,11 @@ NLS_CONFIGURE_ENABLE= nls
DBI_LIB_DEPENDS= libdbi.so:databases/libdbi
DBI_CONFIGURE_WITH= dbi
DNS_BASE_CONFIGURE_ON= --with-dig-command=/usr/bin/drill \
ac_cv_path_PATH_TO_NSLOOKUP=
DNS_BASE_EXTRA_PATCHES= ${FILESDIR}/extra-patch-dig-to-drill.diff
DNS_BINDTOOLS_BUILD_DEPENDS= ${LOCALBASE}/bin/dig:dns/bind-tools
DNS_BINDTOOLS_RUN_DEPENDS= ${DNS_BINDTOOLS_BUILD_DEPENDS}
DNS_BINDTOOLS_CONFIGURE_ON= --with-dig-command=${LOCALBASE}/bin/dig \
@ -126,15 +131,6 @@ _PING6_CMD= /sbin/ping6 -n -X %d -c %d %s
_PING6_CMD= /sbin/ping6 -n -t %d -c %d %s
.endif
.if ${PORT_OPTIONS:MDNS_BASE}
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-dig-to-drill.diff
CONFIGURE_ARGS+=--with-dig-command=/usr/bin/drill \
ac_cv_path_PATH_TO_NSLOOKUP=
PLIST_SUB+= CHECK_DNS="@comment "
.else
PLIST_SUB+= CHECK_DNS=""
.endif
.if !exists(/usr/bin/ssh) && empty(PORT_OPTIONS:MSSH_PORTABLE)
PLIST_SUB+= SSH="@comment "
.else

View File

@ -6,8 +6,8 @@
/* get the command to run */
- xasprintf (&command_line, "%s %s %s -p %d @%s %s %s +retry=%d +time=%d",
- PATH_TO_DIG, dig_args, query_transport, server_port, dns_server, query_address, record_type, number_tries, timeout_interval_dig);
+ xasprintf (&command_line, "%s %s @%s -z -p %d %s %s %s",
+ PATH_TO_DIG, dig_args, dns_server, server_port, query_transport, query_address, record_type);
+ xasprintf (&command_line, "%s %s %s -p %d @%s %s %s",
+ PATH_TO_DIG, dig_args, query_transport, server_port, dns_server, query_address, record_type);
alarm (timeout_interval);
gettimeofday (&tv, NULL);

View File

@ -1,18 +0,0 @@
** DNS **
Starting from FreeBSD 10.0, BIND has been replaced in base
by unbound. This means that there are no dig and nslookup
utilities for check_dig and check_dns to use. If you choose
DNS_BASE, check_dig will be built using drill instead of
dig, if you use -A the dig options will generally not work,
check drill(1) for the correct ones, also, timeout and retry
will be ignored, and check_dns won't be installed. If you
check any other option, the installed dig and nslookup will
be used.
If you run FreeBSD < 10, you can still use the DNS_BIND*
options to have check_dig and check_dns use the newer dig
and nslookup utilities.
If you use REPLACE_BASE with BIND, choose the DNS_BASE option.

View File

@ -8,7 +8,7 @@ libexec/nagios/check_cluster
libexec/nagios/check_dig
libexec/nagios/check_disk
libexec/nagios/check_disk_smb
%%CHECK_DNS%%libexec/nagios/check_dns
%%DNS_BINDTOOLS%%libexec/nagios/check_dns
libexec/nagios/check_dummy
libexec/nagios/check_file_age
libexec/nagios/check_flexlm

View File

@ -3,7 +3,7 @@
PORTNAME= nagios-plugins
DISTVERSION= 2.3.3
PORTREVISION= 1
PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= net-mgmt
MASTER_SITES= https://www.nagios-plugins.org/download/ \
@ -70,6 +70,10 @@ SSH_PORTABLE_DESC= Build check_ssh with ports openssh (instead of base)
DBI_LIB_DEPENDS= libdbi.so:databases/libdbi
DBI_CONFIGURE_WITH= dbi
DNS_BASE_CONFIGURE_ON= --with-dig-command=/usr/bin/drill \
ac_cv_path_PATH_TO_NSLOOKUP=
DNS_BASE_EXTRA_PATCHES= ${FILESDIR}/extra-patch-dig-to-drill.diff
DNS_BINDTOOLS_BUILD_DEPENDS= ${LOCALBASE}/bin/dig:dns/bind-tools
DNS_BINDTOOLS_RUN_DEPENDS= ${DNS_BINDTOOLS_BUILD_DEPENDS}
DNS_BINDTOOLS_CONFIGURE_ON= --with-dig-command=${LOCALBASE}/bin/dig \
@ -131,15 +135,6 @@ _PING6_CMD= /sbin/ping6 -n -X %d -c %d %s
_PING6_CMD= /sbin/ping6 -n -t %d -c %d %s
.endif
.if ${PORT_OPTIONS:MDNS_BASE}
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-dig-to-drill.diff
CONFIGURE_ARGS+= --with-dig-command=/usr/bin/drill \
ac_cv_path_PATH_TO_NSLOOKUP=
PLIST_SUB+= CHECK_DNS="@comment "
.else
PLIST_SUB+= CHECK_DNS=""
.endif
.if !exists(/usr/bin/ssh) && empty(PORT_OPTIONS:MSSH_PORTABLE)
PLIST_SUB+= SSH="@comment "
.else

View File

@ -6,8 +6,8 @@
/* get the command to run */
- xasprintf (&command_line, "%s %s %s -p %d @%s %s %s +tries=%d +time=%d",
- PATH_TO_DIG, dig_args, query_transport, server_port, dns_server, query_address, record_type, number_tries, timeout_interval_dig);
+ xasprintf (&command_line, "%s %s @%s -z -p %d %s %s %s",
+ PATH_TO_DIG, dig_args, dns_server, server_port, query_transport, query_address, record_type);
+ xasprintf (&command_line, "%s %s %s -p %d @%s %s %s",
+ PATH_TO_DIG, dig_args, query_transport, server_port, dns_server, query_address, record_type);
alarm (timeout_interval);
gettimeofday (&tv, NULL);

View File

@ -8,7 +8,7 @@ libexec/nagios/check_cluster
libexec/nagios/check_dig
libexec/nagios/check_disk
libexec/nagios/check_disk_smb
%%CHECK_DNS%%libexec/nagios/check_dns
%%DNS_BINDTOOLS%%libexec/nagios/check_dns
libexec/nagios/check_dummy
libexec/nagios/check_file_age
libexec/nagios/check_flexlm