1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-15 03:14:23 +00:00

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
This commit is contained in:
Niclas Zeising 2017-07-11 16:50:03 +00:00
parent a82b8d3dbf
commit a16eb9464a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=445504
10 changed files with 183 additions and 1 deletions

View File

@ -188,6 +188,7 @@
SUBDIR += ng_ipacct
SUBDIR += nitpicker
SUBDIR += nrpe
SUBDIR += nrpe3
SUBDIR += nrpe-ssl
SUBDIR += nsca
SUBDIR += nsca-client

View File

@ -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

80
net-mgmt/nrpe3/Makefile Normal file
View File

@ -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>

3
net-mgmt/nrpe3/distinfo Normal file
View File

@ -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

View File

@ -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"

View File

@ -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);

View File

@ -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);

View File

@ -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.
**********************************************************************

9
net-mgmt/nrpe3/pkg-descr Normal file
View File

@ -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/

4
net-mgmt/nrpe3/pkg-plist Normal file
View File

@ -0,0 +1,4 @@
@sample etc/nrpe.cfg.sample
libexec/nagios/check_nrpe3
sbin/nrpe3
@dir(%%NAGIOSUSER%%,%%NAGIOSGROUP%%,755) %%NRPE_PIDDIR%%