diff options
author | miwi <miwi@FreeBSD.org> | 2008-11-22 05:00:22 +0800 |
---|---|---|
committer | miwi <miwi@FreeBSD.org> | 2008-11-22 05:00:22 +0800 |
commit | 90382efa26c809bfac5e9d80f879bd2fe450933a (patch) | |
tree | a279a1d5659fd50dc453e1c6eb3c9baaef9e2d99 /net-mgmt | |
parent | 68fd1202ebd674836c3cda5f4bb331d2442afaa5 (diff) | |
download | freebsd-ports-gnome-90382efa26c809bfac5e9d80f879bd2fe450933a.tar.gz freebsd-ports-gnome-90382efa26c809bfac5e9d80f879bd2fe450933a.tar.zst freebsd-ports-gnome-90382efa26c809bfac5e9d80f879bd2fe450933a.zip |
- Update to 2.12
Included in this PR is reload support requested by ports/126476 in addition to a
change in the location of the PID file. I have however opted to move this file to
NAGIOSDIR to reduce the number of directories created by all Nagios related ports.
PR: 128409
Submitted by: Jarrod Sayers <jarrod@netleader.com.au> (maintainer)
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/nrpe2/Makefile | 32 | ||||
-rw-r--r-- | net-mgmt/nrpe2/distinfo | 6 | ||||
-rw-r--r-- | net-mgmt/nrpe2/files/nrpe2.in | 28 | ||||
-rw-r--r-- | net-mgmt/nrpe2/files/patch-src-nrpe.c | 15 | ||||
-rw-r--r-- | net-mgmt/nrpe2/files/pkg-install.in | 8 | ||||
-rw-r--r-- | net-mgmt/nrpe2/files/pkg-message.in | 15 | ||||
-rw-r--r-- | net-mgmt/nrpe2/pkg-plist | 4 |
7 files changed, 59 insertions, 49 deletions
diff --git a/net-mgmt/nrpe2/Makefile b/net-mgmt/nrpe2/Makefile index f3d7ca6e20a7..65337394090d 100644 --- a/net-mgmt/nrpe2/Makefile +++ b/net-mgmt/nrpe2/Makefile @@ -5,24 +5,26 @@ # $FreeBSD$ # -PORTNAME= nrpe2 -PORTVERSION= 2.11 -PORTREVISION= 1 +PORTNAME= nrpe +DISTVERSION= 2.12 CATEGORIES= net-mgmt -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITES= SF MASTER_SITE_SUBDIR= nagios -DISTNAME= nrpe-${PORTVERSION} MAINTAINER= jarrod@netleader.com.au COMMENT= Nagios Remote Plugin Executor RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net-mgmt/nagios-plugins +LATEST_LINK= nrpe2 + USE_PERL5_BUILD= yes USE_RC_SUBR= nrpe2 -OPTIONS= SSL "SSL support" off \ - ARGS "Enable command arguments *POTENTIAL SECURITY RISK*" off +CONFLICTS= nrpe-1.* + +OPTIONS= SSL "Enable SSL support (disables plain-text server)" off \ + ARGS "Enable command argument processing **Security Risk**" off GNU_CONFIGURE= yes @@ -33,15 +35,14 @@ NAGIOSDIR?= /var/spool/nagios NAGIOSUID= 181 NAGIOSGID= ${NAGIOSUID} -CONFIGURE_ARGS+= --bindir=${PREFIX}/sbin \ +CONFIGURE_ARGS= --bindir=${PREFIX}/sbin \ --libexecdir=${PREFIX}/libexec/nagios \ --sysconfdir=${PREFIX}/etc \ + --localstatedir=${NAGIOSDIR} \ --with-nrpe-user=${NAGIOSUSER} \ --with-nrpe-group=${NAGIOSGROUP} -PLIST_FILES= sbin/nrpe2 etc/nrpe.cfg-sample libexec/nagios/check_nrpe2 - -SUB_VARS= NAGIOSDIR=${NAGIOSDIR} \ +PLIST_SUB= NAGIOSDIR=${NAGIOSDIR} \ NAGIOSUSER=${NAGIOSUSER} \ NAGIOSGROUP=${NAGIOSGROUP} \ NAGIOSUID=${NAGIOSUID} \ @@ -51,8 +52,8 @@ SUB_FILES= pkg-install \ pkg-deinstall \ pkg-message -SUB_LIST+= ${SUB_VARS} -PLIST_SUB+= ${SUB_VARS} +SUB_LIST= PREFIX=${PREFIX} \ + ${PLIST_SUB} .include <bsd.port.pre.mk> @@ -65,10 +66,12 @@ CONFIGURE_ARGS+= --disable-ssl .if defined(WITH_ARGS) CONFIGURE_ARGS+= --enable-command-args +.else +CONFIGURE_ARGS+= --disable-command-args .endif post-patch: - @${REINPLACE_CMD} -e 's#nrpe.pid#nrpe2.pid#g' \ + @${REINPLACE_CMD} -e 's#/var/run/nrpe.pid#@localstatedir@/nrpe2.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 @@ -82,6 +85,7 @@ do-install: ${INSTALL_DATA} ${WRKSRC}/sample-config/nrpe.cfg ${PREFIX}/etc/nrpe.cfg-sample post-install: + @${SH} ${PKGINSTALL} ${DISTNAME} POST-INSTALL @${CAT} ${PKGMESSAGE} .include <bsd.port.post.mk> diff --git a/net-mgmt/nrpe2/distinfo b/net-mgmt/nrpe2/distinfo index 49f72f2cab1a..c32c217f9048 100644 --- a/net-mgmt/nrpe2/distinfo +++ b/net-mgmt/nrpe2/distinfo @@ -1,3 +1,3 @@ -MD5 (nrpe-2.11.tar.gz) = dcf3b7c5b7c94c0ba6cbb4999c1161f0 -SHA256 (nrpe-2.11.tar.gz) = 4cedfc2588ba65ebfe4e3310c9fbda08c6f0912cfcc2c1ac96636b6f5c839e1d -SIZE (nrpe-2.11.tar.gz) = 405643 +MD5 (nrpe-2.12.tar.gz) = b2d75e2962f1e3151ef58794d60c9e97 +SHA256 (nrpe-2.12.tar.gz) = 7e8d093abef7d7ffc7219ad334823bdb612121df40de2dbaec9c6d0adeb04cfc +SIZE (nrpe-2.12.tar.gz) = 405725 diff --git a/net-mgmt/nrpe2/files/nrpe2.in b/net-mgmt/nrpe2/files/nrpe2.in index 3d8757e9d6ea..2f94c63efc77 100644 --- a/net-mgmt/nrpe2/files/nrpe2.in +++ b/net-mgmt/nrpe2/files/nrpe2.in @@ -9,25 +9,31 @@ # # Add the following lines to /etc/rc.conf to enable nrpe2: -# -#nrpe2_enable="YES" -# +# nrpe2_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable nrpe2. +# nrpe2_flags (str): Set to "" by default. +# nrpe2_configfile (str): Set to "%%PREFIX%%/etc/nrpe.cfg" by default. # . %%RC_SUBR%% -name=nrpe2 +name="nrpe2" rcvar=`set_rcvar` command="%%PREFIX%%/sbin/nrpe2" -required_files=%%PREFIX%%/etc/nrpe.cfg -command_args="-c ${required_files} -d" -pidfile=/var/run/${name}.pid +command_args="-d" +extra_commands="reload" +pidfile="%%NAGIOSDIR%%/nrpe2.pid" + +sig_reload=HUP + +[ -z "${nrpe2_enable}" ] && nrpe2_enable="NO" +[ -z "${nrpe2_flags}" ] && nrpe2_flags="" +[ -z "${nrpe2_configfile}" ] && nrpe2_configfile="%%PREFIX%%/etc/nrpe.cfg" -# set defaults +load_rc_config "${name}" -nrpe2_enable=${nrpe2_enable:-"NO"} -nrpe2_flags=${nrpe2_flags:-""} +required_files="${nrpe2_configfile}" +command_args="${command_args} -c ${nrpe2_configfile}" -load_rc_config ${name} run_rc_command "$1" diff --git a/net-mgmt/nrpe2/files/patch-src-nrpe.c b/net-mgmt/nrpe2/files/patch-src-nrpe.c deleted file mode 100644 index 632b4c1430d4..000000000000 --- a/net-mgmt/nrpe2/files/patch-src-nrpe.c +++ /dev/null @@ -1,15 +0,0 @@ ---- src/nrpe.c.orig 2007-12-27 05:55:05.000000000 +1030 -+++ src/nrpe.c 2008-02-20 19:19:03.000000000 +1030 -@@ -1458,8 +1458,10 @@ - }while(bytes_read==-1 && errno==EINTR); - } - -- if(bytes_read==-1 && output!=NULL) -- strcpy(output,""); -+ if(bytes_read==-1) -+ *output='\0'; -+ else -+ output[bytes_read]='\0'; - - /* if there was a critical return code and no output AND the command time exceeded the timeout thresholds, assume a timeout */ - if(result==STATE_CRITICAL && bytes_read==-1 && (end_time-start_time)>=timeout){ diff --git a/net-mgmt/nrpe2/files/pkg-install.in b/net-mgmt/nrpe2/files/pkg-install.in index f670f79b45ff..bebb71ec50eb 100644 --- a/net-mgmt/nrpe2/files/pkg-install.in +++ b/net-mgmt/nrpe2/files/pkg-install.in @@ -39,7 +39,7 @@ yesno() { ;; esac echo "Please answer yes or no." - done + done } if [ "$2" = "PRE-INSTALL" ]; then @@ -71,4 +71,10 @@ if [ "$2" = "PRE-INSTALL" ]; then exit 1 fi fi +elif [ "$2" = "POST-INSTALL" ]; then + if [ ! -e "${NAGIOSDIR}" ]; then + /bin/mkdir -p "${NAGIOSDIR}" + /bin/chmod 775 "${NAGIOSDIR}" + /usr/sbin/chown "${NAGIOSUSER}":"${NAGIOSGROUP}" "${NAGIOSDIR}" + fi fi diff --git a/net-mgmt/nrpe2/files/pkg-message.in b/net-mgmt/nrpe2/files/pkg-message.in index 07a76697be7f..0bc9fc1e1435 100644 --- a/net-mgmt/nrpe2/files/pkg-message.in +++ b/net-mgmt/nrpe2/files/pkg-message.in @@ -1,5 +1,10 @@ -************************************************************************* -Available variables you add/set to /etc/rc.conf: -- nrpe2_enable (bool): Set to "NO" by default -- nrpe2_flags (string): Set to "" by default -************************************************************************* +********************************************************************** + + Enable NRPE in /etc/rc.conf with the following line: + + nrpe2_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/nrpe2/pkg-plist b/net-mgmt/nrpe2/pkg-plist new file mode 100644 index 000000000000..cd9fa760324b --- /dev/null +++ b/net-mgmt/nrpe2/pkg-plist @@ -0,0 +1,4 @@ +etc/nrpe.cfg-sample +libexec/nagios/check_nrpe2 +sbin/nrpe2 +@unexec rmdir %%NAGIOSDIR%% 2>/dev/null || true |