aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/nrpe3
diff options
context:
space:
mode:
authorNiclas Zeising <zeising@FreeBSD.org>2017-07-11 16:50:03 +0000
committerNiclas Zeising <zeising@FreeBSD.org>2017-07-11 16:50:03 +0000
commita16eb9464a125e3e7d79122b92d63edf61eca243 (patch)
tree7926058c4bfbe57355e3b804e11d741e5b0e51f4 /net-mgmt/nrpe3
parenta82b8d3dbf8da5c186ecdedc6ac371bbef3d73bb (diff)
downloadports-a16eb9464a125e3e7d79122b92d63edf61eca243.tar.gz
ports-a16eb9464a125e3e7d79122b92d63edf61eca243.zip
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
Notes
Notes: svn path=/head/; revision=445504
Diffstat (limited to 'net-mgmt/nrpe3')
-rw-r--r--net-mgmt/nrpe3/Makefile80
-rw-r--r--net-mgmt/nrpe3/distinfo3
-rw-r--r--net-mgmt/nrpe3/files/nrpe3.in53
-rw-r--r--net-mgmt/nrpe3/files/patch-src_check__nrpe.c11
-rw-r--r--net-mgmt/nrpe3/files/patch-src_nrpe.c11
-rw-r--r--net-mgmt/nrpe3/files/pkg-message.in10
-rw-r--r--net-mgmt/nrpe3/pkg-descr9
-rw-r--r--net-mgmt/nrpe3/pkg-plist4
8 files changed, 181 insertions, 0 deletions
diff --git a/net-mgmt/nrpe3/Makefile b/net-mgmt/nrpe3/Makefile
new file mode 100644
index 000000000000..a53916e7d53d
--- /dev/null
+++ b/net-mgmt/nrpe3/Makefile
@@ -0,0 +1,80 @@
+# Created by: Paul Dlug<paul@nerdlabs.com>
+# $FreeBSD$
+
+PORTNAME= nrpe
+PORTVERSION= 3.2.0
+PORTREVISION?= 0
+CATEGORIES= net-mgmt
+
+MAINTAINER= zeising@FreeBSD.org
+COMMENT?= Nagios Remote Plugin Executor
+
+LICENSE= GPLv2
+
+CONFLICTS= nrpe-2.* nrpe-ssl-2.*
+
+USE_GITHUB= yes
+GH_ACCOUNT= NagiosEnterprises
+GH_TAGNAME= nrpe-${DISTVERSION}
+
+USES= perl5
+USE_PERL5= build
+USE_RC_SUBR= nrpe3
+GNU_CONFIGURE= yes
+
+OPTIONS_DEFINE= SSL ARGS
+OPTIONS_RADIO= PLUGINS
+OPTIONS_RADIO_PLUGINS= MONPLUGINS NAGPLUGINS
+OPTIONS_DEFAULT=NAGPLUGINS SSL
+
+SSL_DESC= Enable SSL support (disables plain-text server)
+ARGS_DESC= Enable command argument processing
+NAGPLUGINS_DESC=Use net-mgmt/nagios-plugins
+MONPLUGINS_DESC=Use net-mgmt/monitoring-plugins
+
+SSL_USES= ssl
+SSL_CONFIGURE_ENABLE= ssl
+SSL_CONFIGURE_ON= --with-ssl=${OPENSSLDIR} \
+ --with-ssl-inc=${OPENSSLINC} \
+ --with-ssl-lib=${OPENSSLLIB}
+
+ARGS_CONFIGURE_ON= --enable-command-args
+ARGS_CONFIGURE_OFF= --disable-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
+
+NAGIOSUSER?= nagios
+NAGIOSGROUP?= nagios
+USERS= ${NAGIOSUSER}
+GROUPS= ${NAGIOSGROUP}
+
+NRPE_PIDDIR?= /var/run/nrpe3
+
+CONFIGURE_ARGS+=--bindir=${PREFIX}/sbin \
+ --libexecdir=${PREFIX}/libexec/nagios \
+ --sysconfdir=${PREFIX}/etc \
+ --with-nrpe-user=${NAGIOSUSER} \
+ --with-nrpe-group=${NAGIOSGROUP}
+
+PLIST_SUB= NAGIOSUSER=${NAGIOSUSER} \
+ NAGIOSGROUP=${NAGIOSGROUP} \
+ NRPE_PIDDIR=${NRPE_PIDDIR}
+SUB_LIST+= PIDDIR=${NRPE_PIDDIR}
+
+SUB_FILES= pkg-message
+
+post-patch:
+ @${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/nrpe3
+ ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/nagios
+ ${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>
diff --git a/net-mgmt/nrpe3/distinfo b/net-mgmt/nrpe3/distinfo
new file mode 100644
index 000000000000..22b14250e8e2
--- /dev/null
+++ b/net-mgmt/nrpe3/distinfo
@@ -0,0 +1,3 @@
+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
diff --git a/net-mgmt/nrpe3/files/nrpe3.in b/net-mgmt/nrpe3/files/nrpe3.in
new file mode 100644
index 000000000000..e6c113dcba97
--- /dev/null
+++ b/net-mgmt/nrpe3/files/nrpe3.in
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: nrpe3
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# 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=nrpe3
+rcvar=nrpe3_enable
+
+load_rc_config "${name}"
+
+: ${nrpe3_enable:=NO}
+: ${nrpe3_configfile:=%%PREFIX%%/etc/nrpe.cfg}
+
+required_files="${nrpe3_configfile}"
+
+command="%%PREFIX%%/sbin/nrpe3"
+command_args="-c ${nrpe3_configfile} -d"
+extra_commands=reload
+sig_reload=HUP
+
+start_precmd=nrpe3_prestart
+stop_precmd=find_pidfile
+
+find_pidfile()
+{
+ [ -n "$nrpe3_pidfile" ] &&
+ warn "No longer necessary to set nrpe3_pidfile in rc.conf[.local]"
+
+ if get_pidfile_from_conf pid_file ${nrpe3_configfile}; then
+ pidfile="$_pidfile_from_conf"
+ else
+ pidfile='%%PIDDIR%%/nrpe3.pid'
+ fi
+}
+
+nrpe3_prestart()
+{
+ find_pidfile
+ install -d -o ${nrpe_user:-nagios} ${pidfile%/*}
+}
+
+run_rc_command "$1"
diff --git a/net-mgmt/nrpe3/files/patch-src_check__nrpe.c b/net-mgmt/nrpe3/files/patch-src_check__nrpe.c
new file mode 100644
index 000000000000..ac9737d62143
--- /dev/null
+++ b/net-mgmt/nrpe3/files/patch-src_check__nrpe.c
@@ -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);
+
diff --git a/net-mgmt/nrpe3/files/patch-src_nrpe.c b/net-mgmt/nrpe3/files/patch-src_nrpe.c
new file mode 100644
index 000000000000..d1d103f7eb2b
--- /dev/null
+++ b/net-mgmt/nrpe3/files/patch-src_nrpe.c
@@ -0,0 +1,11 @@
+--- src/nrpe.c.orig 2017-04-28 10:29:47 UTC
++++ src/nrpe.c
+@@ -320,7 +320,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/nrpe3/files/pkg-message.in b/net-mgmt/nrpe3/files/pkg-message.in
new file mode 100644
index 000000000000..7c7ea9568a00
--- /dev/null
+++ b/net-mgmt/nrpe3/files/pkg-message.in
@@ -0,0 +1,10 @@
+**********************************************************************
+
+ Enable NRPE in /etc/rc.conf with the following line:
+
+ 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.
+
+**********************************************************************
diff --git a/net-mgmt/nrpe3/pkg-descr b/net-mgmt/nrpe3/pkg-descr
new file mode 100644
index 000000000000..483177b58d37
--- /dev/null
+++ b/net-mgmt/nrpe3/pkg-descr
@@ -0,0 +1,9 @@
+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).
+
+WWW: http://www.nagios.org/
diff --git a/net-mgmt/nrpe3/pkg-plist b/net-mgmt/nrpe3/pkg-plist
new file mode 100644
index 000000000000..9b52107d7adb
--- /dev/null
+++ b/net-mgmt/nrpe3/pkg-plist
@@ -0,0 +1,4 @@
+@sample etc/nrpe.cfg.sample
+libexec/nagios/check_nrpe3
+sbin/nrpe3
+@dir(%%NAGIOSUSER%%,%%NAGIOSGROUP%%,755) %%NRPE_PIDDIR%%