diff options
author | Olli Hauer <ohauer@FreeBSD.org> | 2013-10-04 19:44:10 +0000 |
---|---|---|
committer | Olli Hauer <ohauer@FreeBSD.org> | 2013-10-04 19:44:10 +0000 |
commit | 0f0fe7b6fcba2d84a3d1d720b2718226d5798ac3 (patch) | |
tree | 1688ca6917afe1de8d9f7e5a9b786760fd2c5738 /net-mgmt/nrpe | |
parent | 756402b2815a41a8265c09fee3710a22c8b024f3 (diff) | |
download | ports-0f0fe7b6fcba2d84a3d1d720b2718226d5798ac3.tar.gz ports-0f0fe7b6fcba2d84a3d1d720b2718226d5798ac3.zip |
Notes
Diffstat (limited to 'net-mgmt/nrpe')
-rw-r--r-- | net-mgmt/nrpe/Makefile | 74 | ||||
-rw-r--r-- | net-mgmt/nrpe/distinfo | 2 | ||||
-rw-r--r-- | net-mgmt/nrpe/files/nrpe2.in | 53 | ||||
-rw-r--r-- | net-mgmt/nrpe/files/patch-sample-config-nrpe.cfg.in | 14 | ||||
-rw-r--r-- | net-mgmt/nrpe/files/patch-src-nrpe.c | 28 | ||||
-rw-r--r-- | net-mgmt/nrpe/files/pkg-message.in | 10 | ||||
-rw-r--r-- | net-mgmt/nrpe/pkg-descr | 14 | ||||
-rw-r--r-- | net-mgmt/nrpe/pkg-plist | 9 |
8 files changed, 204 insertions, 0 deletions
diff --git a/net-mgmt/nrpe/Makefile b/net-mgmt/nrpe/Makefile new file mode 100644 index 000000000000..22a3517dc431 --- /dev/null +++ b/net-mgmt/nrpe/Makefile @@ -0,0 +1,74 @@ +# Created by: Paul Dlug<paul@nerdlabs.com> +# $FreeBSD$ + +PORTNAME= nrpe +DISTVERSION= 2.15 +CATEGORIES= net-mgmt +MASTER_SITES= SF/nagios/${PORTNAME}-2.x/${PORTNAME}-${PORTVERSION} + +MAINTAINER= ports@FreeBSD.org +COMMENT= Nagios Remote Plugin Executor + +RUN_DEPENDS= ${LOCALBASE}/libexec/nagios/check_nagios:${PORTSDIR}/net-mgmt/nagios-plugins + +LATEST_LINK= nrpe2 + +USES= perl5 +USE_PERL5= build +USE_RC_SUBR= nrpe2 +GNU_CONFIGURE= yes + +OPTIONS_DEFINE= SSL ARGS + +SSL_DESC= Enable SSL support (disables plain-text server) +ARGS_DESC= Enable command argument processing **Security Risk** + +SSL_USE= OPENSSL=yes +SSL_CONFIGURE_ON= --enable-ssl --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 + +.include <bsd.port.options.mk> + +NAGIOSUSER?= nagios +NAGIOSGROUP?= nagios +NAGIOSDIR?= /var/spool/nagios +USERS= ${NAGIOSUSER} +GROUPS= ${NAGIOSGROUP} + +NAGIOSUID= 181 +NAGIOSGID= ${NAGIOSUID} +NRPE_PIDDIR?= /var/run/nrpe2 + +CONFIGURE_ARGS+=--bindir=${PREFIX}/sbin \ + --libexecdir=${PREFIX}/libexec/nagios \ + --sysconfdir=${PREFIX}/etc \ + --localstatedir=${NAGIOSDIR} \ + --with-nrpe-user=${NAGIOSUSER} \ + --with-nrpe-group=${NAGIOSGROUP} + +PLIST_SUB= NAGIOSDIR=${NAGIOSDIR} \ + NAGIOSUID=${NAGIOSUID} \ + NRPE_PIDDIR=${NRPE_PIDDIR} + +SUB_FILES= pkg-message + +post-patch: + @${REINPLACE_CMD} -e 's|/var/run/nrpe.pid|${NRPE_PIDDIR}/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 +do-install: + ${INSTALL} -d ${STAGEDIR}${NRPE_PIDDIR} + ${INSTALL} -m 750 -d ${STAGEDIR}${NAGIOSDIR} + ${INSTALL_PROGRAM} ${WRKSRC}/src/nrpe ${STAGEDIR}${PREFIX}/sbin/nrpe2 + ${MKDIR} ${STAGEDIR}${PREFIX}/libexec/nagios + ${INSTALL_PROGRAM} ${WRKSRC}/src/check_nrpe ${STAGEDIR}${PREFIX}/libexec/nagios/check_nrpe2 + ${INSTALL_DATA} ${WRKSRC}/sample-config/nrpe.cfg ${STAGEDIR}${PREFIX}/etc/nrpe.cfg.sample + +.include <bsd.port.mk> diff --git a/net-mgmt/nrpe/distinfo b/net-mgmt/nrpe/distinfo new file mode 100644 index 000000000000..fd603631675f --- /dev/null +++ b/net-mgmt/nrpe/distinfo @@ -0,0 +1,2 @@ +SHA256 (nrpe-2.15.tar.gz) = 66383b7d367de25ba031d37762d83e2b55de010c573009c6f58270b137131072 +SIZE (nrpe-2.15.tar.gz) = 419695 diff --git a/net-mgmt/nrpe/files/nrpe2.in b/net-mgmt/nrpe/files/nrpe2.in new file mode 100644 index 000000000000..52a851373db3 --- /dev/null +++ b/net-mgmt/nrpe/files/nrpe2.in @@ -0,0 +1,53 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: nrpe2 +# 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. + +. /etc/rc.subr + +name=nrpe2 +rcvar=nrpe2_enable + +load_rc_config "${name}" + +: ${nrpe2_enable:=NO} +: ${nrpe2_configfile:=%%PREFIX%%/etc/nrpe.cfg} + +required_files="${nrpe2_configfile}" + +command="%%PREFIX%%/sbin/nrpe2" +command_args="-c ${nrpe2_configfile} -d" +extra_commands=reload +sig_reload=HUP + +start_precmd=nrpe2_prestart +stop_precmd=find_pidfile + +find_pidfile() +{ + [ -n "$nrpe2_pidfile" ] && + warn "No longer necessary to set nrpe2_pidfile in rc.conf[.local]" + + if get_pidfile_from_conf pid_file %%PREFIX%%/etc/nrpe.cfg; then + pidfile="$_pidfile_from_conf" + else + pidfile='%%PIDDIR%%/nrpe2.pid' + fi +} + +nrpe2_prestart() +{ + find_pidfile + install -d -o ${nrpe_user:-nagios} ${pidfile%/*} +} + +run_rc_command "$1" diff --git a/net-mgmt/nrpe/files/patch-sample-config-nrpe.cfg.in b/net-mgmt/nrpe/files/patch-sample-config-nrpe.cfg.in new file mode 100644 index 000000000000..9d8893a9e039 --- /dev/null +++ b/net-mgmt/nrpe/files/patch-sample-config-nrpe.cfg.in @@ -0,0 +1,14 @@ +--- sample-config/nrpe.cfg.in.orig 2007-11-24 04:01:23.000000000 +1030 ++++ sample-config/nrpe.cfg.in 2008-02-20 18:39:58.000000000 +1030 +@@ -198,7 +198,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_hda1]=@libexecdir@/check_disk -w 20% -c 10% -p /dev/hda1 ++command[check_root]=@libexecdir@/check_disk -w 20% -c 10% -p / ++command[check_var]=@libexecdir@/check_disk -w 20% -c 10% -p /var ++command[check_tmp]=@libexecdir@/check_disk -w 20% -c 10% -p /tmp ++command[check_usr]=@libexecdir@/check_disk -w 20% -c 10% -p /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 + diff --git a/net-mgmt/nrpe/files/patch-src-nrpe.c b/net-mgmt/nrpe/files/patch-src-nrpe.c new file mode 100644 index 000000000000..c9afacbc76d1 --- /dev/null +++ b/net-mgmt/nrpe/files/patch-src-nrpe.c @@ -0,0 +1,28 @@ +--- src/nrpe.c.orig 2013-07-10 21:18:24.000000000 +0000 ++++ src/nrpe.c 2013-07-10 21:20:25.000000000 +0000 +@@ -89,7 +89,9 @@ + int use_src=FALSE; /* Define parameter for SRC option */ + + ++#ifdef HAVE_SSL + void complete_SSL_shutdown( SSL *); ++#endif + + + int main(int argc, char **argv){ +@@ -1673,6 +1675,7 @@ + return OK; + } + ++#ifdef HAVE_SSL + void complete_SSL_shutdown( SSL *ssl) { + + /* +@@ -1693,6 +1696,7 @@ + if( SSL_shutdown( ssl)) break; + } + } ++#endif + + /* bail if daemon is running as root */ + int check_privileges(void){ diff --git a/net-mgmt/nrpe/files/pkg-message.in b/net-mgmt/nrpe/files/pkg-message.in new file mode 100644 index 000000000000..74fd8d314ff5 --- /dev/null +++ b/net-mgmt/nrpe/files/pkg-message.in @@ -0,0 +1,10 @@ +********************************************************************** + + 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/nrpe/pkg-descr b/net-mgmt/nrpe/pkg-descr new file mode 100644 index 000000000000..1d6937a92950 --- /dev/null +++ b/net-mgmt/nrpe/pkg-descr @@ -0,0 +1,14 @@ +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). + +nrpe2 is incompatible with nrpe version 1, if you are running this version +see net-mgmt/nrpe. Both ports can be installed in parallel but share the same +configuration file by default. This is easily changed in the nrpe startup +file. + +WWW: http://www.nagios.org/ diff --git a/net-mgmt/nrpe/pkg-plist b/net-mgmt/nrpe/pkg-plist new file mode 100644 index 000000000000..c321b61de67f --- /dev/null +++ b/net-mgmt/nrpe/pkg-plist @@ -0,0 +1,9 @@ +@unexec cmp -s %D/etc/nrpe.cfg.sample %D/etc/nrpe.cfg && rm %D/etc/nrpe.cfg || true +etc/nrpe.cfg.sample +@exec test -f %B/nrpe.cfg || install -m 644 %D/%F %B/nrpe.cfg +libexec/nagios/check_nrpe2 +sbin/nrpe2 +@dirrmtry libexec/nagios +@exec install -m 755 -o %%NAGIOSUID%% -d %%NRPE_PIDDIR%% +@dirrmtry %%NAGIOSDIR%% +@dirrmtry %%NRPE_PIDDIR%% |