diff options
author | Martin Matuska <mm@FreeBSD.org> | 2007-07-24 12:57:40 +0000 |
---|---|---|
committer | Martin Matuska <mm@FreeBSD.org> | 2007-07-24 12:57:40 +0000 |
commit | c55da37cb05145921993be49df7757a958904304 (patch) | |
tree | 10802b850df6e7184f2d3d7ae47669eb621e707a /net-mgmt/nrpe2 | |
parent | 4bf69b47730c026e25881ce8055683a554930ff7 (diff) | |
download | ports-c55da37cb05145921993be49df7757a958904304.tar.gz ports-c55da37cb05145921993be49df7757a958904304.zip |
Notes
Diffstat (limited to 'net-mgmt/nrpe2')
-rw-r--r-- | net-mgmt/nrpe2/Makefile | 62 | ||||
-rw-r--r-- | net-mgmt/nrpe2/files/nrpe2.in (renamed from net-mgmt/nrpe2/files/nrpe2.sh.in) | 0 | ||||
-rw-r--r-- | net-mgmt/nrpe2/files/patch-sample-config-nrpe.cfg.in | 10 | ||||
-rw-r--r-- | net-mgmt/nrpe2/files/pkg-deinstall.in | 22 | ||||
-rw-r--r-- | net-mgmt/nrpe2/files/pkg-install.in | 74 | ||||
-rw-r--r-- | net-mgmt/nrpe2/pkg-deinstall | 19 | ||||
-rw-r--r-- | net-mgmt/nrpe2/pkg-install | 68 |
7 files changed, 142 insertions, 113 deletions
diff --git a/net-mgmt/nrpe2/Makefile b/net-mgmt/nrpe2/Makefile index a72dd2a46184..d3664f08708b 100644 --- a/net-mgmt/nrpe2/Makefile +++ b/net-mgmt/nrpe2/Makefile @@ -7,30 +7,53 @@ PORTNAME= nrpe2 PORTVERSION= 2.7 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net-mgmt MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= nagios DISTNAME= nrpe-${PORTVERSION} -MAINTAINER= dan@langille.org +MAINTAINER= jarrod@netleader.com.au COMMENT= Nagios Remote Plugin Executor RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net-mgmt/nagios-plugins -GNU_CONFIGURE= yes USE_PERL5_BUILD= yes +USE_RC_SUBR= nrpe2 + +OPTIONS= SSL "SSL support" off \ + ARGS "Enable command arguments *POTENTIAL SECURITY RISK*" off + +GNU_CONFIGURE= yes -USE_RC_SUBR= nrpe2.sh -SUB_FILES= pkg-message +NAGIOSUSER?= nagios +NAGIOSGROUP?= nagios +NAGIOSDIR?= /var/spool/nagios + +NAGIOSUID= 181 +NAGIOSGID= ${NAGIOSUID} + +CONFIGURE_ARGS= --bindir=${PREFIX}/sbin \ + --libexecdir=${PREFIX}/libexec/nagios \ + --sysconfdir=${PREFIX}/etc \ + --with-nrpe-user=${NAGIOSUSER} \ + --with-nrpe-group=${NAGIOSGROUP} \ + --prefix=${PREFIX} PLIST_FILES= sbin/nrpe2 etc/nrpe.cfg-sample libexec/nagios/check_nrpe2 -CONFIGURE_ARGS= --libexecdir=${PREFIX}/libexec/nagios \ - --bindir=${PREFIX}/sbin --sysconfdir=${PREFIX}/etc +SUB_VARS= NAGIOSDIR=${NAGIOSDIR} \ + NAGIOSUSER=${NAGIOSUSER} \ + NAGIOSGROUP=${NAGIOSGROUP} \ + NAGIOSUID=${NAGIOSUID} \ + NAGIOSGID=${NAGIOSGID} -OPTIONS= SSL "SSL support" off \ - ARGS "Enable command arguments *POTENTIAL SECURITY RISK*" off +SUB_FILES= pkg-install \ + pkg-deinstall \ + pkg-message + +SUB_LIST+= ${SUB_VARS} +PLIST_SUB+= ${SUB_VARS} .include <bsd.port.pre.mk> @@ -45,24 +68,21 @@ CONFIGURE_ARGS+= --disable-ssl CONFIGURE_ARGS+= --enable-command-args .endif -post-build: - @${REINPLACE_CMD} -e 's|nrpe.pid|nrpe2.pid|g' \ - ${WRKSRC}/sample-config/nrpe.cfg +post-patch: + @${REINPLACE_CMD} -e 's#nrpe.pid#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 pre-install: - PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + @${SH} ${PKGINSTALL} ${DISTNAME} PRE-INSTALL do-install: ${INSTALL_PROGRAM} ${WRKSRC}/src/nrpe ${PREFIX}/sbin/nrpe2 - ${INSTALL_PROGRAM} ${WRKSRC}/src/check_nrpe \ - ${PREFIX}/libexec/nagios/check_nrpe2 - ${INSTALL_DATA} ${WRKSRC}/sample-config/nrpe.cfg \ - ${PREFIX}/etc/nrpe.cfg-sample + ${INSTALL_PROGRAM} ${WRKSRC}/src/check_nrpe ${PREFIX}/libexec/nagios/check_nrpe2 + ${INSTALL_DATA} ${WRKSRC}/sample-config/nrpe.cfg ${PREFIX}/etc/nrpe.cfg-sample post-install: - ${CAT} ${PKGMESSAGE} - -post-deinstall: - PKG_PREFIX=${PREFIX} ${SH} ${PKGDEINSTALL} ${PKGNAME} DEINSTALL + @${CAT} ${PKGMESSAGE} .include <bsd.port.post.mk> diff --git a/net-mgmt/nrpe2/files/nrpe2.sh.in b/net-mgmt/nrpe2/files/nrpe2.in index 3d8757e9d6ea..3d8757e9d6ea 100644 --- a/net-mgmt/nrpe2/files/nrpe2.sh.in +++ b/net-mgmt/nrpe2/files/nrpe2.in diff --git a/net-mgmt/nrpe2/files/patch-sample-config-nrpe.cfg.in b/net-mgmt/nrpe2/files/patch-sample-config-nrpe.cfg.in index f474e1363508..a5c7fad27f60 100644 --- a/net-mgmt/nrpe2/files/patch-sample-config-nrpe.cfg.in +++ b/net-mgmt/nrpe2/files/patch-sample-config-nrpe.cfg.in @@ -1,7 +1,7 @@ ---- sample-config/nrpe.cfg.in~ Mon Dec 11 21:04:00 2006 -+++ sample-config/nrpe.cfg.in Wed Jan 31 20:40:28 2007 +--- sample-config/nrpe.cfg.in.orig Tue Dec 12 12:34:00 2006 ++++ sample-config/nrpe.cfg.in Tue Jun 26 20:16:45 2007 @@ -190,8 +190,10 @@ - + command[check_users]=@libexecdir@/check_users -w 5 -c 10 command[check_load]=@libexecdir@/check_load -w 15,10,5 -c 30,25,20 -command[check_disk1]=@libexecdir@/check_disk -w 20 -c 10 -p /dev/hda1 @@ -11,5 +11,5 @@ +command[check_disk_tmp]=@libexecdir@/check_disk -w 20 -c 10 --path /tmp +command[check_disk_usr]=@libexecdir@/check_disk -w 20 -c 10 --path /usr command[check_zombie_procs]=@libexecdir@/check_procs -w 5 -c 10 -s Z - command[check_total_procs]=@libexecdir@/check_procs -w 150 -c 200 - + command[check_total_procs]=@libexecdir@/check_procs -w 150 -c 200 + diff --git a/net-mgmt/nrpe2/files/pkg-deinstall.in b/net-mgmt/nrpe2/files/pkg-deinstall.in new file mode 100644 index 000000000000..6b20aa9bc962 --- /dev/null +++ b/net-mgmt/nrpe2/files/pkg-deinstall.in @@ -0,0 +1,22 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +NAGIOSDIR=%%NAGIOSDIR%% +NAGIOSUSER=%%NAGIOSUSER%% +NAGIOSGROUP=%%NAGIOSGROUP%% + +if [ "$2" = "POST-DEINSTALL" ]; then + if /usr/sbin/pw group show "${NAGIOSGROUP}" 2>&1 >/dev/null; then + echo "You should manually remove the \"${NAGIOSGROUP}\" group." + fi + + if /usr/sbin/pw user show "${NAGIOSUSER}" 2>&1 >/dev/null; then + echo "You should manually remove the \"${NAGIOSUSER}\" user." + fi + + if [ -e "${NAGIOSDIR}" ]; then + echo "You should manually remove the \"${NAGIOSDIR}\" directory." + fi +fi diff --git a/net-mgmt/nrpe2/files/pkg-install.in b/net-mgmt/nrpe2/files/pkg-install.in new file mode 100644 index 000000000000..f670f79b45ff --- /dev/null +++ b/net-mgmt/nrpe2/files/pkg-install.in @@ -0,0 +1,74 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +NAGIOSDIR=%%NAGIOSDIR%% +NAGIOSUSER=%%NAGIOSUSER%% +NAGIOSGROUP=%%NAGIOSGROUP%% +NAGIOSUID=%%NAGIOSUID%% +NAGIOSGID=%%NAGIOSGID%% + +ask() { + local question default answer + + question=$1 + default=$2 + if [ -z "${PACKAGE_BUILDING}" ]; then + read -p "${question} [${default}]? " answer + fi + if [ "x${answer}" = "x" ]; then + answer=${default} + fi + echo ${answer} +} + +yesno() { + local default question answer + + question=$1 + default=$2 + while :; do + answer=$(ask "${question}" "${default}") + case "${answer}" in + [Yy][Ee][Ss]|[Yy]) + return 0 + ;; + [Nn][Oo]|[Nn]) + return 1 + ;; + esac + echo "Please answer yes or no." + done +} + +if [ "$2" = "PRE-INSTALL" ]; then + if /usr/sbin/pw group show "${NAGIOSGROUP}" 2>&1 >/dev/null; then + echo "You already have a \"${NAGIOSGROUP}\" group, so I will use it." + else + echo "You need a \"${NAGIOSGROUP}\" group." + if yesno "Would you like me to create it" "YES"; then + /usr/sbin/pw groupadd "${NAGIOSGROUP}" -g "${NAGIOSGID}" -h - || \ + /usr/sbin/pw groupadd "${NAGIOSGROUP}" -h - || exit + echo "Done." + else + echo "Please create the \"${NAGIOSGROUP}\" group manually and try again." + exit 1 + fi + fi + + if /usr/sbin/pw user show "${NAGIOSUSER}" 2>&1 >/dev/null; then + echo "You already have a \"${NAGIOSUSER}\" user, so I will use it." + else + echo "You need a \"${NAGIOSUSER}\" user." + if yesno "Would you like me to create it" "YES"; then + /usr/sbin/pw useradd "${NAGIOSUSER}" -u "${NAGIOSUID}" -g "${NAGIOSGROUP}" -h - -d "${NAGIOSDIR}" \ + -s /sbin/nologin -c "Nagios pseudo-user" || \ + /usr/sbin/pw useradd "${NAGIOSUSER}" -g "${NAGIOSGROUP}" -h - -d "${NAGIOSDIR}" \ + -s /sbin/nologin -c "Nagios pseudo-user" || exit + else + echo "Please create the \"${NAGIOSUSER}\" user manually and try again." + exit 1 + fi + fi +fi diff --git a/net-mgmt/nrpe2/pkg-deinstall b/net-mgmt/nrpe2/pkg-deinstall deleted file mode 100644 index 6be8827ebc4e..000000000000 --- a/net-mgmt/nrpe2/pkg-deinstall +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -PATH=/bin:/usr/bin:/usr/sbin -TMPFILE=/tmp/services-$RANDOM-$$ - - -PKG_PREFIX=${PKG_PREFIX:=/usr/local} - -case "$2" in -"DEINSTALL") - # Note how to delete UID/GID - USER=nagios - GROUP=nagios - if pw usershow "${USER}" 2>/dev/null 1>&2; then - echo "To delete nagios user permanently, use 'pw userdel ${USER}'" - echo "To delete nagios group permanently, use 'pw groupdel ${GROUP}'" - fi - ;; -esac diff --git a/net-mgmt/nrpe2/pkg-install b/net-mgmt/nrpe2/pkg-install deleted file mode 100644 index d40f64242dc6..000000000000 --- a/net-mgmt/nrpe2/pkg-install +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# -# $FreeBSD: /tmp/pcvs/ports/net-mgmt/nrpe2/Attic/pkg-install,v 1.1 2003-01-09 22:13:58 edwin Exp $ -# - -PKG_PREFIX=${PKG_PREFIX:=/usr/local} - -user=nagios -group=nagios - -ask() { - local question default answer - - question=$1 - default=$2 - if [ -z "${PACKAGE_BUILDING}" ]; then - read -p "${question} [${default}]? " answer - fi - if [ x${answer} = x ]; then - answer=${default} - fi - echo ${answer} -} - -yesno() { - local dflt question answer - - question=$1 - dflt=$2 - while :; do - answer=$(ask "${question}" "${dflt}") - case "${answer}" in - [Yy]*) return 0;; - [Nn]*) return 1;; - esac - echo "Please answer yes or no." - done -} - -if [ x"$2" = xPRE-INSTALL ]; then - if /usr/sbin/pw groupshow "${group}" 2>/dev/null; then - echo "You already have a group \"${group}\", so I will use it." - else - echo "You need a group \"${group}\"." - if yesno "Would you like me to create it" y; then - /usr/sbin/pw groupadd ${group} -h - || exit - echo "Done." - else - echo "Please create it, and try again." - exit 1 - fi - fi - - if /usr/sbin/pw user show "${user}" 2>/dev/null; then - echo "You already have a user \"${user}\", so I will use it." - else - echo "You need a user \"${user}\"." - if yesno "Would you like me to create it" y; then - /usr/sbin/pw useradd ${user} -g ${group} -h - -d ${PKG_PREFIX}/var/nagios \ - -s /nonexistent -c "Nagios pseudo-user" || exit - echo "Done." - else - echo "Please create it, and try again." - exit 1 - fi - fi - -fi |