From nobody Wed May 03 01:30:12 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q9zsK0FKwz48hj1; Wed, 3 May 2023 01:30:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q9zsJ6hWXz44HN; Wed, 3 May 2023 01:30:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683077412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u4DAvooKMyluSbhDKVurhFQGsZ6K+n6AMpl9/9aYNTo=; b=ijMFBIWdd+7G5v2TZBT3bAF++qJznaJiHf7W1uyFBIC9j/NTa9cse/PsCnDQlknkvz2U3R wYOMAuSAZbW6GFtK3DEHC6IiY7piMA3l+0XFnSWvFLrcNm/rmzHEjhKNvyvxHda7SS8fvf LDMMbOPq9B8UcxZbxY1FtEM/1081bXyP2iCoj3wkVe9Jne0MM0QHUFli8xUeu2ScKvXwJk cGxEFmxvAUgpCWiuekPyejXiovXujWVZ6KmhTvaovBrfSqp46/FvKHZKaxDRb9nwSkYAg3 L17DIVNW9YCw1S8J/mBqnRXL1a63qfwfFDtitZJioHtrUKHoWX8f80ao09bo2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683077412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u4DAvooKMyluSbhDKVurhFQGsZ6K+n6AMpl9/9aYNTo=; b=es/+9TCtCYvegIkgl3a9d28I03RHdLHF0hIsC+QZqo8Fd+cqHxPvIFpufJo792p1HxQzT3 jPFgmTRMgCVV2vngaNZJmGQqiTS1arbJSvTVeBE7B9YbPESTT8/xpWNj2icgDvbeBNPpUf oIC3/smcpEoV2RiMAfe2qZOgY6Mr+s7tUf6juaZcwCm79XPzFC+oGz9J+AKku85d53lk1k qwfh3pRDTdMB6ZyteaI+9pNQWCX/gCjAREpuY2O6QGB2V2Qhlr3UKu8wYN1uu4mTUD8//P QZQTMkQRxSPhrSa+DtEjSWcSLTjt++8NG3EJcw2S/0BDkOrkK+s6dPiLIz0NAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683077412; a=rsa-sha256; cv=none; b=kck7yq+SFoOkkWv1q0fS5R8V3R9VSAI2O4RWz5Yez1JdvSSL15PBJWWRboU8NYQHWJDorJ TnUJkL6XbZAcFBRSmUSDcQv825jN8bpRZ0avDUMGCS5LKp7PHXJ9GSyzBt0CWVJJ2XFyoV Q0Px5dK8MP3iwOaKOPj+jP15pkMP/uu1b5XDpoG+LGT3hNyvKbcQ9cRJrGJNlXtngo022U 5ZjrF6mw0xKqSATyIVl0yB2AKXarf1yTWvEh+8uEuDXo5hYyXDLlP/T8jQJ2nT4zTIhfzR PHxpKCemmNU+smS/Sw3o2+S2R60XmsMe8/vnQPskSTcmA2ETqh7A9ENPHNCDwg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q9zsJ5cyCz19nN; Wed, 3 May 2023 01:30:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 3431UCgP077403; Wed, 3 May 2023 01:30:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3431UCVl077390; Wed, 3 May 2023 01:30:12 GMT (envelope-from git) Date: Wed, 3 May 2023 01:30:12 GMT Message-Id: <202305030130.3431UCVl077390@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: 55338de6ad30 - main - net-mgmt/nrpe: Resurrect port with new version List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bofh X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55338de6ad307f8e296f41dd83ce7efa1d9918a8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bofh: URL: https://cgit.FreeBSD.org/ports/commit/?id=55338de6ad307f8e296f41dd83ce7efa1d9918a8 commit 55338de6ad307f8e296f41dd83ce7efa1d9918a8 Author: Muhammad Moinur Rahman AuthorDate: 2023-05-03 01:15:59 +0000 Commit: Muhammad Moinur Rahman CommitDate: 2023-05-03 01:29:51 +0000 net-mgmt/nrpe: Resurrect port with new version THIS WILL REPLACE net-mgmt/nrpe3 WHICH FAILS TO BUILD WITH OpenSSL 3.0.0 and later. nrpe is used to execute Nagios plugins on remote hosts and report the results to the main Nagios server. From the Nagios homepage: Allows you to execute "local" plugins (like check_disk, check_procs, etc.) on remote hosts. The check_nrpe plugin is called from Nagios and actually makes the plugin requests to the remote host. Requires that nrpe be running on the remote host (either as a standalone daemon or as a service under inetd). --- MOVED | 1 - net-mgmt/Makefile | 1 + net-mgmt/nrpe/Makefile | 71 +++++++++++++++++++++++++++ net-mgmt/nrpe/distinfo | 3 ++ net-mgmt/nrpe/files/nrpe.in | 51 +++++++++++++++++++ net-mgmt/nrpe/files/patch-include_common.h.in | 18 +++++++ net-mgmt/nrpe/files/patch-src_check__nrpe.c | 11 +++++ net-mgmt/nrpe/files/patch-src_nrpe.c | 11 +++++ net-mgmt/nrpe/files/pkg-message.in | 12 +++++ net-mgmt/nrpe/pkg-descr | 7 +++ net-mgmt/nrpe/pkg-plist | 4 ++ 11 files changed, 189 insertions(+), 1 deletion(-) diff --git a/MOVED b/MOVED index 795923d2aaf7..88b2fb8ad5fe 100644 --- a/MOVED +++ b/MOVED @@ -4518,7 +4518,6 @@ misc/p5-Asterisk|misc/p5-asterisk-perl|2017-12-29|Rename to match upstream namin www/npm2|www/npm|2017-12-31|Has expired: use www/npm or www/npm-node* instead www/npm3|www/npm|2017-12-31|Has expired: use www/npm or www/npm-node* instead net/rubygem-fog-aws0|net/rubygem-fog-aws|2017-12-31|Has expired: use net/rubygem-fog-aws or net/rubygem-fog-aws1 instead -net-mgmt/nrpe|net-mgmt/nrpe3|2018-01-01|nrpe 2.0 not maintained, use nrpe 3.0 net-mgmt/nrpe-ssl|net-mgmt/nrpe3|2018-01-01|nrpe 2.0 not maintained, use nrpe 3.0 security/gnupg20|security/gnupg|2018-01-01|Has expired: Will reach EOL upstream on 2017-12-31 dns/dualserver|dns/dnsmasq|2018-01-01|Has expired: Please migrate to dns/dnsmasq; over the years dualserver has become unmaintainable diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index d5478f146663..4a58050f10b5 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -206,6 +206,7 @@ SUBDIR += nfsen SUBDIR += ng_ipacct SUBDIR += nitpicker + SUBDIR += nrp3 SUBDIR += nrpe3 SUBDIR += nsca SUBDIR += nsca-client diff --git a/net-mgmt/nrpe/Makefile b/net-mgmt/nrpe/Makefile new file mode 100644 index 000000000000..796f569d74e4 --- /dev/null +++ b/net-mgmt/nrpe/Makefile @@ -0,0 +1,71 @@ +PORTNAME= nrpe +PORTVERSION= 4.1.0 +DISTVERSIONPREFIX= nrpe- +CATEGORIES= net-mgmt + +MAINTAINER= bofh@FreeBSD.org +COMMENT?= Nagios Remote Plugin Executor +WWW= https://www.nagios.org/ + +LICENSE= GPLv2+ +LICENSE_FILE= ${WRKSRC}/LICENSE.md + +USES= perl5 +USE_GITHUB= yes +GH_ACCOUNT= NagiosEnterprises +USE_PERL5= build +USE_RC_SUBR= nrpe + +GNU_CONFIGURE= yes +CONFIGURE_ARGS+=--bindir=${PREFIX}/sbin \ + --libexecdir=${PREFIX}/libexec/nagios \ + --sysconfdir=${PREFIX}/etc \ + --with-nrpe-user=${NAGIOSUSER} \ + --with-nrpe-group=${NAGIOSGROUP} + +SUB_FILES= pkg-message +SUB_LIST+= PIDDIR=${NRPE_PIDDIR} + +USERS= ${NAGIOSUSER} +GROUPS= ${NAGIOSGROUP} + +PLIST_SUB= NAGIOSUSER=${NAGIOSUSER} \ + NAGIOSGROUP=${NAGIOSGROUP} \ + NRPE_PIDDIR=${NRPE_PIDDIR} + +OPTIONS_DEFINE= SSL ARGS +OPTIONS_DEFAULT=NAGPLUGINS SSL +OPTIONS_RADIO= PLUGINS +OPTIONS_RADIO_PLUGINS= MONPLUGINS NAGPLUGINS + +ARGS_DESC= Enable command argument processing +MONPLUGINS_DESC=Use net-mgmt/monitoring-plugins +NAGPLUGINS_DESC=Use net-mgmt/nagios-plugins + +ARGS_CONFIGURE_ENABLE= command-args +MONPLUGINS_RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:net-mgmt/monitoring-plugins +NAGPLUGINS_RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:net-mgmt/nagios-plugins +SSL_USES= ssl +SSL_CONFIGURE_ENABLE= ssl +SSL_CONFIGURE_WITH= ssl=${OPENSSLBASE} ssl-inc=${OPENSSLINC} ssl-lib=${OPENSSLLIB} +SSL_CFLAGS= -I${OPENSSLINC} + +NAGIOSUSER?= nagios +NAGIOSGROUP?= nagios + +NRPE_PIDDIR?= /var/run/nrpe + +post-patch: + @${REINPLACE_CMD} -e 's|/var/run/nrpe.pid|${NRPE_PIDDIR}/nrpe.pid|g' \ + -e 's|/usr/lib/nagios/plugins/|${LOCALBASE}/libexec/nagios/|g' \ + -e 's|/usr/bin/sudo|${LOCALBASE}/bin/sudo|g' \ + ${WRKSRC}/sample-config/nrpe.cfg.in + +do-install: + ${INSTALL} -d ${STAGEDIR}${NRPE_PIDDIR} + ${INSTALL_PROGRAM} ${WRKSRC}/src/nrpe ${STAGEDIR}${PREFIX}/sbin/nrpe + ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/nagios + ${INSTALL_PROGRAM} ${WRKSRC}/src/check_nrpe ${STAGEDIR}${PREFIX}/libexec/nagios/check_nrpe + ${INSTALL_DATA} ${WRKSRC}/sample-config/nrpe.cfg ${STAGEDIR}${PREFIX}/etc/nrpe.cfg.sample + +.include diff --git a/net-mgmt/nrpe/distinfo b/net-mgmt/nrpe/distinfo new file mode 100644 index 000000000000..e18e6769b6d6 --- /dev/null +++ b/net-mgmt/nrpe/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1683075519 +SHA256 (NagiosEnterprises-nrpe-nrpe-4.1.0_GH0.tar.gz) = 500c1845ddbb57e1df8098d107c860498dbad1ea9e4a42c2d59e8d0c19a87259 +SIZE (NagiosEnterprises-nrpe-nrpe-4.1.0_GH0.tar.gz) = 528263 diff --git a/net-mgmt/nrpe/files/nrpe.in b/net-mgmt/nrpe/files/nrpe.in new file mode 100644 index 000000000000..50be3d8cce5f --- /dev/null +++ b/net-mgmt/nrpe/files/nrpe.in @@ -0,0 +1,51 @@ +#!/bin/sh + +# PROVIDE: nrpe +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable nrpe: +# nrpe_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable nrpe. +# nrpe_flags (str): Not set by default. +# nrpe_configfile (str): Set to "%%PREFIX%%/etc/nrpe.cfg" by default. + +. /etc/rc.subr + +name=nrpe +rcvar=nrpe_enable + +load_rc_config "${name}" + +: ${nrpe_enable:=NO} +: ${nrpe_configfile:=%%PREFIX%%/etc/nrpe.cfg} + +required_files="${nrpe_configfile}" + +command="%%PREFIX%%/sbin/nrpe" +command_args="-c ${nrpe_configfile} -d" +extra_commands=reload +sig_reload=HUP + +start_precmd=nrpe_prestart +stop_precmd=find_pidfile + +find_pidfile() +{ + [ -n "$nrpe_pidfile" ] && + warn "No longer necessary to set nrpe_pidfile in rc.conf[.local]" + + if get_pidfile_from_conf pid_file ${nrpe_configfile}; then + pidfile="$_pidfile_from_conf" + else + pidfile='%%PIDDIR%%/nrpe.pid' + fi +} + +nrpe_prestart() +{ + find_pidfile + install -d -o ${nrpe_user:-nagios} ${pidfile%/*} +} + +run_rc_command "$1" diff --git a/net-mgmt/nrpe/files/patch-include_common.h.in b/net-mgmt/nrpe/files/patch-include_common.h.in new file mode 100644 index 000000000000..00616801dbfc --- /dev/null +++ b/net-mgmt/nrpe/files/patch-include_common.h.in @@ -0,0 +1,18 @@ +--- include/common.h.in.orig 2022-07-18 19:27:53 UTC ++++ include/common.h.in +@@ -34,10 +34,15 @@ + # define OPENSSL_NO_DEPRECATED + #endif + #include <@SSL_INC_PREFIX@@SSL_HDR@> ++#include <@SSL_INC_PREFIX@crypto.h> + # ifdef SSL_TYPE_openssl + # include <@SSL_INC_PREFIX@err.h> + # include <@SSL_INC_PREFIX@rand.h> + # include <@SSL_INC_PREFIX@engine.h> ++# include <@SSL_INC_PREFIX@crypto.h> ++# if defined (LIBRESSL_VERSION_NUMBER) ++# include <@SSL_INC_PREFIX@opensslfeatures.h> ++# endif + # endif + #endif + diff --git a/net-mgmt/nrpe/files/patch-src_check__nrpe.c b/net-mgmt/nrpe/files/patch-src_check__nrpe.c new file mode 100644 index 000000000000..4e3fe9480fed --- /dev/null +++ b/net-mgmt/nrpe/files/patch-src_check__nrpe.c @@ -0,0 +1,11 @@ +--- src/check_nrpe.c.orig 2022-07-18 19:27:53 UTC ++++ src/check_nrpe.c +@@ -899,7 +899,7 @@ void setup_ssl() + exit(timeout_return_code); + } + +-#if OPENSSL_VERSION_NUMBER >= 0x10100000 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER) + + SSL_CTX_set_max_proto_version(ctx, 0); + diff --git a/net-mgmt/nrpe/files/patch-src_nrpe.c b/net-mgmt/nrpe/files/patch-src_nrpe.c new file mode 100644 index 000000000000..912e70f7e3ea --- /dev/null +++ b/net-mgmt/nrpe/files/patch-src_nrpe.c @@ -0,0 +1,11 @@ +--- src/nrpe.c.orig 2022-07-18 19:27:53 UTC ++++ src/nrpe.c +@@ -357,7 +357,7 @@ void init_ssl(void) + exit(STATE_CRITICAL); + } + +-#if OPENSSL_VERSION_NUMBER >= 0x10100000 ++#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER) + + SSL_CTX_set_max_proto_version(ctx, 0); + diff --git a/net-mgmt/nrpe/files/pkg-message.in b/net-mgmt/nrpe/files/pkg-message.in new file mode 100644 index 000000000000..ac998ea47098 --- /dev/null +++ b/net-mgmt/nrpe/files/pkg-message.in @@ -0,0 +1,12 @@ +[ +{ type: install + message: <