svn commit: r445504 - in head/net-mgmt: . nrpe nrpe3 nrpe3/files
Niclas Zeising
zeising at FreeBSD.org
Tue Jul 11 16:50:05 UTC 2017
Author: zeising
Date: Tue Jul 11 16:50:03 2017
New Revision: 445504
URL: https://svnweb.freebsd.org/changeset/ports/445504
Log:
Add nrpe3, Nagios Remote Program Execution ver 3.
Add nrpe3, version 3.2.0. NRPE is used to execute remote commands on
machines to monitor them with nagios, icinga or similar programs.
This is added as a separate port, since there are some backwards
compatibility issues with nrpe ver 2.
Update conflicts for nrpe.
PR: 218933 (based on)
Submitted by: brnrd@
Glanced at by: swills
Added:
head/net-mgmt/nrpe3/
- copied from r445159, head/net-mgmt/nrpe/
head/net-mgmt/nrpe3/files/nrpe3.in
- copied, changed from r445159, head/net-mgmt/nrpe/files/nrpe2.in
head/net-mgmt/nrpe3/files/patch-src_check__nrpe.c (contents, props changed)
head/net-mgmt/nrpe3/files/patch-src_nrpe.c
- copied, changed from r445159, head/net-mgmt/nrpe/files/patch-src-nrpe.c
Deleted:
head/net-mgmt/nrpe3/files/nrpe2.in
head/net-mgmt/nrpe3/files/patch-configure
head/net-mgmt/nrpe3/files/patch-sample-config-nrpe.cfg.in
head/net-mgmt/nrpe3/files/patch-src-nrpe.c
Modified:
head/net-mgmt/Makefile
head/net-mgmt/nrpe/Makefile
head/net-mgmt/nrpe3/Makefile
head/net-mgmt/nrpe3/distinfo
head/net-mgmt/nrpe3/files/pkg-message.in
head/net-mgmt/nrpe3/pkg-plist
Modified: head/net-mgmt/Makefile
==============================================================================
--- head/net-mgmt/Makefile Tue Jul 11 16:31:04 2017 (r445503)
+++ head/net-mgmt/Makefile Tue Jul 11 16:50:03 2017 (r445504)
@@ -188,6 +188,7 @@
SUBDIR += ng_ipacct
SUBDIR += nitpicker
SUBDIR += nrpe
+ SUBDIR += nrpe3
SUBDIR += nrpe-ssl
SUBDIR += nsca
SUBDIR += nsca-client
Modified: head/net-mgmt/nrpe/Makefile
==============================================================================
--- head/net-mgmt/nrpe/Makefile Tue Jul 11 16:31:04 2017 (r445503)
+++ head/net-mgmt/nrpe/Makefile Tue Jul 11 16:50:03 2017 (r445504)
@@ -12,7 +12,7 @@ COMMENT?= Nagios Remote Plugin Executor
LICENSE= GPLv2
-CONFLICTS= nrpe-ssl-2.*
+CONFLICTS= nrpe-ssl-2.* nrpe-3.*
USES= perl5
USE_PERL5= build
Modified: head/net-mgmt/nrpe3/Makefile
==============================================================================
--- head/net-mgmt/nrpe/Makefile Thu Jul 6 15:18:01 2017 (r445159)
+++ head/net-mgmt/nrpe3/Makefile Tue Jul 11 16:50:03 2017 (r445504)
@@ -2,27 +2,30 @@
# $FreeBSD$
PORTNAME= nrpe
-DISTVERSION= 2.15
-PORTREVISION= 6
+PORTVERSION= 3.2.0
+PORTREVISION?= 0
CATEGORIES= net-mgmt
-MASTER_SITES= SF/nagios/${PORTNAME}-2.x/${PORTNAME}-${PORTVERSION}
MAINTAINER= zeising at FreeBSD.org
COMMENT?= Nagios Remote Plugin Executor
LICENSE= GPLv2
-CONFLICTS= nrpe-ssl-2.*
+CONFLICTS= nrpe-2.* nrpe-ssl-2.*
+USE_GITHUB= yes
+GH_ACCOUNT= NagiosEnterprises
+GH_TAGNAME= nrpe-${DISTVERSION}
+
USES= perl5
USE_PERL5= build
-USE_RC_SUBR= nrpe2
+USE_RC_SUBR= nrpe3
GNU_CONFIGURE= yes
OPTIONS_DEFINE= SSL ARGS
OPTIONS_RADIO= PLUGINS
OPTIONS_RADIO_PLUGINS= MONPLUGINS NAGPLUGINS
-OPTIONS_DEFAULT=ARGS NAGPLUGINS
+OPTIONS_DEFAULT=NAGPLUGINS SSL
SSL_DESC= Enable SSL support (disables plain-text server)
ARGS_DESC= Enable command argument processing
@@ -30,11 +33,10 @@ NAGPLUGINS_DESC=Use net-mgmt/nagios-plugins
MONPLUGINS_DESC=Use net-mgmt/monitoring-plugins
SSL_USES= ssl
-SSL_CONFIGURE_ON= --enable-ssl --with-ssl=${OPENSSLDIR} \
+SSL_CONFIGURE_ENABLE= ssl
+SSL_CONFIGURE_ON= --with-ssl=${OPENSSLDIR} \
--with-ssl-inc=${OPENSSLINC} \
--with-ssl-lib=${OPENSSLLIB}
-SSL_CONFIGURE_OFF= --disable-ssl
-SSL_CFLAGS= -I${OPENSSLINC}
ARGS_CONFIGURE_ON= --enable-command-args
ARGS_CONFIGURE_OFF= --disable-command-args
@@ -47,7 +49,7 @@ NAGIOSGROUP?= nagios
USERS= ${NAGIOSUSER}
GROUPS= ${NAGIOSGROUP}
-NRPE_PIDDIR?= /var/run/nrpe2
+NRPE_PIDDIR?= /var/run/nrpe3
CONFIGURE_ARGS+=--bindir=${PREFIX}/sbin \
--libexecdir=${PREFIX}/libexec/nagios \
@@ -63,15 +65,16 @@ SUB_LIST+= PIDDIR=${NRPE_PIDDIR}
SUB_FILES= pkg-message
post-patch:
- @${REINPLACE_CMD} -e 's|/var/run/nrpe.pid|${NRPE_PIDDIR}/nrpe2.pid|g' \
+ @${REINPLACE_CMD} -e 's|/var/run/nrpe.pid|${NRPE_PIDDIR}/nrpe3.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/nrpe2
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/nrpe ${STAGEDIR}${PREFIX}/sbin/nrpe3
${MKDIR} ${STAGEDIR}${PREFIX}/libexec/nagios
- ${INSTALL_PROGRAM} ${WRKSRC}/src/check_nrpe ${STAGEDIR}${PREFIX}/libexec/nagios/check_nrpe2
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/check_nrpe ${STAGEDIR}${PREFIX}/libexec/nagios/check_nrpe3
${INSTALL_DATA} ${WRKSRC}/sample-config/nrpe.cfg ${STAGEDIR}${PREFIX}/etc/nrpe.cfg.sample
.include <bsd.port.mk>
Modified: head/net-mgmt/nrpe3/distinfo
==============================================================================
--- head/net-mgmt/nrpe/distinfo Thu Jul 6 15:18:01 2017 (r445159)
+++ head/net-mgmt/nrpe3/distinfo Tue Jul 11 16:50:03 2017 (r445504)
@@ -1,2 +1,3 @@
-SHA256 (nrpe-2.15.tar.gz) = 66383b7d367de25ba031d37762d83e2b55de010c573009c6f58270b137131072
-SIZE (nrpe-2.15.tar.gz) = 419695
+TIMESTAMP = 1499365291
+SHA256 (NagiosEnterprises-nrpe-3.2.0-nrpe-3.2.0_GH0.tar.gz) = 82fd7a112255f6147d2abcc836b9efe74ca85c9915956e1e22966cf159db16cf
+SIZE (NagiosEnterprises-nrpe-3.2.0-nrpe-3.2.0_GH0.tar.gz) = 517774
Copied and modified: head/net-mgmt/nrpe3/files/nrpe3.in (from r445159, head/net-mgmt/nrpe/files/nrpe2.in)
==============================================================================
--- head/net-mgmt/nrpe/files/nrpe2.in Thu Jul 6 15:18:01 2017 (r445159, copy source)
+++ head/net-mgmt/nrpe3/files/nrpe3.in Tue Jul 11 16:50:03 2017 (r445504)
@@ -2,49 +2,49 @@
# $FreeBSD$
#
-# PROVIDE: nrpe2
+# PROVIDE: nrpe3
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
-# Add the following lines to /etc/rc.conf to enable nrpe2:
-# nrpe2_enable (bool): Set to "NO" by default.
-# Set it to "YES" to enable nrpe2.
-# nrpe2_flags (str): Not set by default.
-# nrpe2_configfile (str): Set to "%%PREFIX%%/etc/nrpe.cfg" by default.
+# Add the following lines to /etc/rc.conf to enable nrpe3:
+# nrpe3_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable nrpe3.
+# nrpe3_flags (str): Not set by default.
+# nrpe3_configfile (str): Set to "%%PREFIX%%/etc/nrpe.cfg" by default.
. /etc/rc.subr
-name=nrpe2
-rcvar=nrpe2_enable
+name=nrpe3
+rcvar=nrpe3_enable
load_rc_config "${name}"
-: ${nrpe2_enable:=NO}
-: ${nrpe2_configfile:=%%PREFIX%%/etc/nrpe.cfg}
+: ${nrpe3_enable:=NO}
+: ${nrpe3_configfile:=%%PREFIX%%/etc/nrpe.cfg}
-required_files="${nrpe2_configfile}"
+required_files="${nrpe3_configfile}"
-command="%%PREFIX%%/sbin/nrpe2"
-command_args="-c ${nrpe2_configfile} -d"
+command="%%PREFIX%%/sbin/nrpe3"
+command_args="-c ${nrpe3_configfile} -d"
extra_commands=reload
sig_reload=HUP
-start_precmd=nrpe2_prestart
+start_precmd=nrpe3_prestart
stop_precmd=find_pidfile
find_pidfile()
{
- [ -n "$nrpe2_pidfile" ] &&
- warn "No longer necessary to set nrpe2_pidfile in rc.conf[.local]"
+ [ -n "$nrpe3_pidfile" ] &&
+ warn "No longer necessary to set nrpe3_pidfile in rc.conf[.local]"
- if get_pidfile_from_conf pid_file ${nrpe2_configfile}; then
+ if get_pidfile_from_conf pid_file ${nrpe3_configfile}; then
pidfile="$_pidfile_from_conf"
else
- pidfile='%%PIDDIR%%/nrpe2.pid'
+ pidfile='%%PIDDIR%%/nrpe3.pid'
fi
}
-nrpe2_prestart()
+nrpe3_prestart()
{
find_pidfile
install -d -o ${nrpe_user:-nagios} ${pidfile%/*}
Added: head/net-mgmt/nrpe3/files/patch-src_check__nrpe.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-mgmt/nrpe3/files/patch-src_check__nrpe.c Tue Jul 11 16:50:03 2017 (r445504)
@@ -0,0 +1,11 @@
+--- src/check_nrpe.c.orig 2017-04-17 14:21:54 UTC
++++ src/check_nrpe.c
+@@ -839,7 +839,7 @@ void setup_ssl()
+ 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);
+
Copied and modified: head/net-mgmt/nrpe3/files/patch-src_nrpe.c (from r445159, head/net-mgmt/nrpe/files/patch-src-nrpe.c)
==============================================================================
--- head/net-mgmt/nrpe/files/patch-src-nrpe.c Thu Jul 6 15:18:01 2017 (r445159, copy source)
+++ head/net-mgmt/nrpe3/files/patch-src_nrpe.c Tue Jul 11 16:50:03 2017 (r445504)
@@ -1,77 +1,11 @@
---- src/nrpe.c.orig 2013-09-06 15:27:13 UTC
+--- src/nrpe.c.orig 2017-04-28 10:29:47 UTC
+++ src/nrpe.c
-@@ -30,6 +30,8 @@
- #include "utils.h"
- #include "acl.h"
+@@ -320,7 +320,7 @@ void init_ssl(void)
+ exit(STATE_CRITICAL);
+ }
-+#include <poll.h>
-+
- #ifdef HAVE_SSL
- #include "../include/dh.h"
- #endif
-@@ -100,7 +102,9 @@
- int use_src=FALSE; /* Define parameter for SRC option */
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000
++#if OPENSSL_VERSION_NUMBER >= 0x10100000 && !defined(LIBRESSL_VERSION_NUMBER)
+ SSL_CTX_set_max_proto_version(ctx, 0);
-+#ifdef HAVE_SSL
- void complete_SSL_shutdown( SSL *);
-+#endif
-
-
- int main(int argc, char **argv){
-@@ -266,7 +270,7 @@ int main(int argc, char **argv){
-
- /* use anonymous DH ciphers */
- SSL_CTX_set_cipher_list(ctx,"ADH");
-- dh=get_dh512();
-+ dh=get_dh2048();
- SSL_CTX_set_tmp_dh(ctx,dh);
- DH_free(dh);
- if(debug==TRUE)
-@@ -969,8 +973,14 @@
- continue;
-
- /* socket is nonblocking and we don't have a connection yet */
-- if(errno==EAGAIN)
-+ if(errno==EAGAIN) {
-+ struct pollfd pfd;
-+
-+ pfd.fd = sock;
-+ pfd.events = POLLIN;
-+ poll(&pfd,1,-1);
- continue;
-+ }
-
- /* fix for HP-UX 11.0 - just retry */
- if(errno==ENOBUFS)
-@@ -1207,9 +1217,13 @@
- if(result==STATE_OK && use_ssl==TRUE){
- if((ssl=SSL_new(ctx))!=NULL){
- SSL_set_fd(ssl,sock);
-+ int n = 0;
-
- /* keep attempting the request if needed */
-- while(((rc=SSL_accept(ssl))!=1) && (SSL_get_error(ssl,rc)==SSL_ERROR_WANT_READ));
-+ while( ((rc=SSL_accept(ssl))!=1) && (SSL_get_error(ssl,rc)==SSL_ERROR_WANT_READ) && n <= 600){
-+ usleep(100000);
-+ n++;
-+ }
-
- if(rc!=1){
- syslog(LOG_ERR,"Error: Could not complete SSL handshake. %d\n",SSL_get_error(ssl,rc));
-@@ -1796,6 +1810,7 @@
- return OK;
- }
-
-+#ifdef HAVE_SSL
- void complete_SSL_shutdown( SSL *ssl) {
-
- /*
-@@ -1816,6 +1831,7 @@
- if( SSL_shutdown( ssl)) break;
- }
- }
-+#endif
-
- /* bail if daemon is running as root */
- int check_privileges(void){
Modified: head/net-mgmt/nrpe3/files/pkg-message.in
==============================================================================
--- head/net-mgmt/nrpe/files/pkg-message.in Thu Jul 6 15:18:01 2017 (r445159)
+++ head/net-mgmt/nrpe3/files/pkg-message.in Tue Jul 11 16:50:03 2017 (r445504)
@@ -2,7 +2,7 @@
Enable NRPE in /etc/rc.conf with the following line:
- nrpe2_enable="YES"
+ nrpe3_enable="YES"
A sample configuration is available in %%PREFIX%%/etc/nrpe.cfg.sample.
Copy to nrpe.cfg where required and edit to suit your needs.
Modified: head/net-mgmt/nrpe3/pkg-plist
==============================================================================
--- head/net-mgmt/nrpe/pkg-plist Thu Jul 6 15:18:01 2017 (r445159)
+++ head/net-mgmt/nrpe3/pkg-plist Tue Jul 11 16:50:03 2017 (r445504)
@@ -1,4 +1,4 @@
@sample etc/nrpe.cfg.sample
-libexec/nagios/check_nrpe2
-sbin/nrpe2
+libexec/nagios/check_nrpe3
+sbin/nrpe3
@dir(%%NAGIOSUSER%%,%%NAGIOSGROUP%%,755) %%NRPE_PIDDIR%%
More information about the svn-ports-all
mailing list