diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2012-08-23 23:07:05 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2012-08-23 23:07:05 +0000 |
commit | 22b5195c4339642bac63483963707ea683a88f0a (patch) | |
tree | 77f7ac0d9971a045f5f6f18402f031f1b7fb3af0 /net-analyzer/nrpe | |
parent | Move nagios-nrpe to just nrpe. (diff) | |
download | historical-22b5195c4339642bac63483963707ea683a88f0a.tar.gz historical-22b5195c4339642bac63483963707ea683a88f0a.tar.bz2 historical-22b5195c4339642bac63483963707ea683a88f0a.zip |
Move from net-analyzer/nagios-nrpe to net-analyzer/nrpe, as the package work with Icinga just fine.
Package-Manager: portage-2.2.0_alpha121/cvs/Linux x86_64
RepoMan-Options: --force
Diffstat (limited to 'net-analyzer/nrpe')
-rw-r--r-- | net-analyzer/nrpe/ChangeLog | 347 | ||||
-rw-r--r-- | net-analyzer/nrpe/files/nagios-nrpe-2.13-command-args.patch | 15 | ||||
-rw-r--r-- | net-analyzer/nrpe/files/nagios-nrpe-2.13-multiline.patch | 200 | ||||
-rw-r--r-- | net-analyzer/nrpe/files/nagios-nrpe-2.13-tcpd.patch | 33 | ||||
-rw-r--r-- | net-analyzer/nrpe/files/nrpe-nagios3 | 36 | ||||
-rw-r--r-- | net-analyzer/nrpe/files/nrpe-nagios3-r1 | 22 | ||||
-rw-r--r-- | net-analyzer/nrpe/files/nrpe.init | 30 | ||||
-rw-r--r-- | net-analyzer/nrpe/files/nrpe.xinetd | 11 | ||||
-rw-r--r-- | net-analyzer/nrpe/files/nrpe.xinetd.2 | 5 | ||||
-rw-r--r-- | net-analyzer/nrpe/metadata.xml | 12 | ||||
-rw-r--r-- | net-analyzer/nrpe/nrpe-2.12-r102.ebuild | 93 | ||||
-rw-r--r-- | net-analyzer/nrpe/nrpe-2.13-r2.ebuild | 121 | ||||
-rw-r--r-- | net-analyzer/nrpe/nrpe-2.13-r3.ebuild | 111 |
13 files changed, 1036 insertions, 0 deletions
diff --git a/net-analyzer/nrpe/ChangeLog b/net-analyzer/nrpe/ChangeLog new file mode 100644 index 000000000000..06f421bc877c --- /dev/null +++ b/net-analyzer/nrpe/ChangeLog @@ -0,0 +1,347 @@ +# ChangeLog for net-analyzer/nagios-nrpe +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nrpe/ChangeLog,v 1.1 2012/08/23 23:07:05 flameeyes Exp $ + +*nagios-nrpe-2.13-r3 (23 Aug 2012) + + 23 Aug 2012; Diego E. Pettenò <flameeyes@gentoo.org> +files/nrpe.init, + +files/nrpe.xinetd.2, +nagios-nrpe-2.13-r3.ebuild, -files/multiline.patch, + -nagios-nrpe-2.12-r103.ebuild, nagios-nrpe-2.13-r2.ebuild: + Remove old; revision bump to cleanup install, improve init script, always + install xinetd file as other packages do. Prepare for pkgmove. + + 19 Aug 2012; Diego E. Pettenò <flameeyes@gentoo.org> metadata.xml: + Re-assign to sysadmin herd. + + 15 Jul 2012; Raúl Porcel <armin76@gentoo.org> nagios-nrpe-2.13-r2.ebuild: + alpha/sparc stable wrt #397603 + + 14 Jun 2012; Michael Weber <xmw@gentoo.org> nagios-nrpe-2.13-r2.ebuild: + ppc stable (bug 397603) + + 14 Jun 2012; Jeff Horelick <jdhore@gentoo.org> nagios-nrpe-2.13-r2.ebuild: + marked x86 per bug 397603 + + 13 Jun 2012; Jeroen Roovers <jer@gentoo.org> nagios-nrpe-2.13-r2.ebuild: + Stable for HPPA (bug #397603). + + 12 Jun 2012; Agostino Sarubbo <ago@gentoo.org> nagios-nrpe-2.13-r2.ebuild: + Stable for amd64, wrt bug #397603 + +*nagios-nrpe-2.13-r2 (11 Jun 2012) + + 11 Jun 2012; Christian Ruppert <idl0r@gentoo.org> + -nagios-nrpe-2.13-r1.ebuild, +nagios-nrpe-2.13-r2.ebuild: + Typo + +*nagios-nrpe-2.13-r1 (10 Jun 2012) + + 10 Jun 2012; Christian Ruppert <idl0r@gentoo.org> -nagios-nrpe-2.13.ebuild, + +nagios-nrpe-2.13-r1.ebuild, +files/nagios-nrpe-2.13-command-args.patch: + Fix command-args option, bug 397603. + + 07 Jun 2012; Christian Ruppert <idl0r@gentoo.org> metadata.xml, + nagios-nrpe-2.12-r102.ebuild, nagios-nrpe-2.12-r103.ebuild: + Fix some repoman complains + +*nagios-nrpe-2.13 (07 Jun 2012) + + 07 Jun 2012; Christian Ruppert <idl0r@gentoo.org> +nagios-nrpe-2.13.ebuild, + +files/nagios-nrpe-2.13-multiline.patch, +files/nagios-nrpe-2.13-tcpd.patch, + +files/nrpe.xinetd, +files/nrpe-nagios3-r1: + Version bump, fixes bug 410891, 289733, 326367, 367257, 398175, 410171 and + 418297. Thanks to all reporters/contributors. + + 29 Apr 2012; Tobias Klausmann <klausman@gentoo.org> files/nrpe-nagios3: + Fix init script to not trigger warnings on newer versions of OpenRC + + 04 Apr 2012; Jeroen Roovers <jer@gentoo.org> -files/nrpe: + Unused. + + 09 Feb 2012; Pacho Ramos <pacho@gentoo.org> metadata.xml: + Drop maintainer due retirement, bug #85926 + + 08 Jul 2011; Samuli Suominen <ssuominen@gentoo.org> + nagios-nrpe-2.12-r102.ebuild, nagios-nrpe-2.12-r103.ebuild: + Convert from "useq" to "use". + + 04 Nov 2010; Tobias Scherbaum <dertobi123@gentoo.org> + +nagios-nrpe-2.12-r103.ebuild, -nagios-nrpe-2.12-r104.ebuild: + Revert revbump, restore -r103 (#289722) + +*nagios-nrpe-2.12-r104 (31 Oct 2010) + + 31 Oct 2010; Tobias Scherbaum <dertobi123@gentoo.org> + -nagios-nrpe-2.12.ebuild, -nagios-nrpe-2.12-r1.ebuild, + -nagios-nrpe-2.12-r103.ebuild, +nagios-nrpe-2.12-r104.ebuild: + Remove command-args use flag, as it pretty much does nothing anyways ... + (#289722) + +*nagios-nrpe-2.12-r103 (31 Dec 2009) + + 31 Dec 2009; Tobias Scherbaum <dertobi123@gentoo.org> + +nagios-nrpe-2.12-r103.ebuild, +files/multiline.patch: + Revbump, add support for large, multiline output (#264467). Also do + respect LDFALGS when building nrpe_check_control. + + 18 Mar 2009; Brent Baude <ranger@gentoo.org> nagios-nrpe-2.12-r102.ebuild: + Marking nagios-nrpe-2.12-r102 ppc stable for bug 256177 + + 07 Mar 2009; Markus Meier <maekke@gentoo.org> + nagios-nrpe-2.12-r102.ebuild: + amd64/x86 stable, bug #256177 + + 04 Mar 2009; Ferris McCormick <fmccor@gentoo.org> + nagios-nrpe-2.12-r102.ebuild: + Sparc stable, part of Bug #256177. + + 06 Feb 2009; Jeroen Roovers <jer@gentoo.org> nagios-nrpe-2.12-r102.ebuild: + Stable for HPPA (bug #256177). + + 01 Feb 2009; Tobias Klausmann <klausman@gentoo.org> + nagios-nrpe-2.12-r102.ebuild: + Stable on alpha, bug #256177 + + 26 Jan 2009; Brent Baude <ranger@gentoo.org> nagios-nrpe-2.12-r102.ebuild: + Marking nagios-nrpe-2.12-r102 ppc64 stable for bug 256177 + + 04 Aug 2008; Jeroen Roovers <jer@gentoo.org> metadata.xml: + Describe local USE flags for GLEP 56. + +*nagios-nrpe-2.12-r102 (04 Aug 2008) +*nagios-nrpe-2.12-r1 (04 Aug 2008) + + 04 Aug 2008; Tobias Scherbaum <dertobi123@gentoo.org> + +nagios-nrpe-2.12-r1.ebuild, -nagios-nrpe-2.12-r101.ebuild, + +nagios-nrpe-2.12-r102.ebuild: + Create pidfile in /var/run/nrpe (#233859) + + 02 Jul 2008; Jeroen Roovers <jer@gentoo.org> nagios-nrpe-2.12.ebuild: + Stable for HPPA (LuckyLuke). + + 27 Jun 2008; Tobias Scherbaum <dertobi123@gentoo.org> + -nagios-nrpe-2.10.ebuild: + Clean old versions + + 27 Jun 2008; Tobias Scherbaum <dertobi123@gentoo.org> + nagios-nrpe-2.12.ebuild: + AMD64 stable, #224019 + + 05 Jun 2008; Friedrich Oslage <bluebird@gentoo.org> + nagios-nrpe-2.12.ebuild: + stable on sparc, bug 224019 + + 04 Jun 2008; Markus Rothe <corsair@gentoo.org> nagios-nrpe-2.12.ebuild: + Stable on ppc64; bug #224019 + + 01 Jun 2008; Christian Faulhammer <opfer@gentoo.org> + nagios-nrpe-2.12.ebuild: + stable x86, bug 224019 + + 31 May 2008; Tobias Scherbaum <dertobi123@gentoo.org> + nagios-nrpe-2.12.ebuild, nagios-nrpe-2.12-r101.ebuild: + Add ~hppa, #224019 + +*nagios-nrpe-2.12-r101 (27 Apr 2008) + + 27 Apr 2008; Tobias Scherbaum <dertobi123@gentoo.org> + +nagios-nrpe-2.12-r101.ebuild: + bump for nagios-3 + + 14 Mar 2008; Caleb Tennis <caleb@gentoo.org> nagios-nrpe-2.10.ebuild: + amd64 stable, per bug #205335 + +*nagios-nrpe-2.12 (14 Mar 2008) + + 14 Mar 2008; Tobias Scherbaum <dertobi123@gentoo.org> -files/nrpe-2.5.1, + -nagios-nrpe-2.5.1.ebuild, +nagios-nrpe-2.12.ebuild: + Version bump as per #213317, thanks to Krzysztof Olędzki + + 05 Feb 2008; Markus Rothe <corsair@gentoo.org> nagios-nrpe-2.10.ebuild: + Stable on ppc64 + + 21 Jan 2008; Raúl Porcel <armin76@gentoo.org> nagios-nrpe-2.10.ebuild: + sparc stable wrt #205335 + + 12 Jan 2008; Dawid Węgliński <cla@gentoo.org> nagios-nrpe-2.10.ebuild: + Stable on x86 (bug #205335) + +*nagios-nrpe-2.10 (04 Dec 2007) + + 04 Dec 2007; Tobias Scherbaum <dertobi123@gentoo.org> + -nagios-nrpe-2.8.1.ebuild, +nagios-nrpe-2.10.ebuild: + Version bump, bug #199338 + + 02 Jul 2007; Piotr Jaroszyński <peper@gentoo.org> + nagios-nrpe-2.5.1.ebuild, nagios-nrpe-2.8.1.ebuild: + (QA) RESTRICT clean up. + +*nagios-nrpe-2.8.1 (10 Jun 2007) + + 10 Jun 2007; Tobias Scherbaum <dertobi123@gentoo.org> -files/nrpe-1.8, + -files/nrpe-1.8.cfg, -files/nrpe-2.3, -files/nrpe-2.5.2, + -nagios-nrpe-1.8-r1.ebuild, -nagios-nrpe-2.3.ebuild, + -nagios-nrpe-2.5.2.ebuild, -nagios-nrpe-2.5.2-r1.ebuild, + -nagios-nrpe-2.7.1-r2.ebuild, +nagios-nrpe-2.8.1.ebuild: + Version bump, clean out old versions. + +*nagios-nrpe-2.7.1-r2 (06 Jun 2007) + + 06 Jun 2007; Markus Ullmann <jokey@gentoo.org> + -nagios-nrpe-2.7.1-r1.ebuild, +nagios-nrpe-2.7.1-r2.ebuild: + Fix revdep-rebuild bug #146667 + + 28 Apr 2007; Sven Wegener <swegener@gentoo.org> nagios-nrpe-1.8-r1.ebuild, + nagios-nrpe-2.3.ebuild, nagios-nrpe-2.5.2.ebuild: + Fix *initd, *confd and *envd calls (#173884, #174266) + + 28 Apr 2007; Torsten Veller <tove@gentoo.org> nagios-nrpe-2.5.1.ebuild, + nagios-nrpe-2.5.2-r1.ebuild, nagios-nrpe-2.7.1-r1.ebuild: + Use newinitd + + 13 Mar 2007; Martin Jackson <mjolnir@gentoo.org> +files/nrpe, + -nagios-nrpe-2.7.1.ebuild, +nagios-nrpe-2.7.1-r1.ebuild: + Install nrpe init.d script to fix #170547 + +*nagios-nrpe-2.7.1-r1 (12 Mar 2007) + + 12 Mar 2007; <> nagios-nrpe-2.7.1-r1.ebuild files/digest-nagios-nrpe-2.7.1-r1 + # INSERT ENTRY HERE + +*nagios-nrpe-2.7.1 (12 Mar 2007) + + 12 Mar 2007; Martin Jackson <mjolnir@gentoo.org> + +nagios-nrpe-2.7.1.ebuild: + Version bump to 2.7.1 + + 20 Feb 2007; Markus Ullmann <jokey@gentoo.org> ChangeLog: + Redigest for Manifest2 + + 21 Oct 2006; Thomas Cort <tcort@gentoo.org> nagios-nrpe-2.5.2-r1.ebuild: + Added ~alpha keyword wrt Bug #110130. + +*nagios-nrpe-2.5.2-r1 (18 Sep 2006) + + 18 Sep 2006; Benjamin Smee <strerror@gentoo.org> + +nagios-nrpe-2.5.2-r1.ebuild: + fix for revdep-rebuild issues bug #146667 + + 17 Aug 2006; Gustavo Zacarias <gustavoz@gentoo.org> + nagios-nrpe-2.5.1.ebuild: + Stable on sparc + + 06 Jul 2006; Markus Rothe <corsair@gentoo.org> nagios-nrpe-2.5.1.ebuild: + Stable on ppc64 + + 04 Jul 2006; Lance Albertson <ramereth@gentoo.org> +files/nrpe-2.5.2: + * Add init script (forgot it before!) + +*nagios-nrpe-2.5.2 (04 Jul 2006) + + 04 Jul 2006; Lance Albertson <ramereth@gentoo.org> -files/nrpe-2.0, + -files/nrpe-2.0.cfg, -nagios-nrpe-2.0.ebuild, -nagios-nrpe-2.0-r1.ebuild, + nagios-nrpe-2.5.1.ebuild, +nagios-nrpe-2.5.2.ebuild: + * Version bump + * Marked 2.5.1 stable on x86 + * Removed old ebuilds/files + + 07 May 2006; Markus Rothe <corsair@gentoo.org> nagios-nrpe-2.3.ebuild: + Stable on ppc64 + + 05 May 2006; Gustavo Zacarias <gustavoz@gentoo.org> + nagios-nrpe-2.3.ebuild: + Stable on sparc wrt security #132159 + +*nagios-nrpe-2.5.1 (27 Apr 2006) + + 27 Apr 2006; Lance Albertson <ramereth@gentoo.org> +files/nrpe-2.5.1, + nagios-nrpe-2.3.ebuild, +nagios-nrpe-2.5.1.ebuild: + * Version bump + * Added reload to init script (2.5.1 added this feature) + * Stable on x86 (2.3) + + 07 Feb 2006; Simon Stelling <blubb@gentoo.org> nagios-nrpe-2.0-r1.ebuild: + stable on amd64 + +*nagios-nrpe-2.3 (04 Feb 2006) + + 04 Feb 2006; Lance Albertson <ramereth@gentoo.org> +files/nrpe-2.3, + metadata.xml, +nagios-nrpe-2.3.ebuild: + * Version bump + + 20 Nov 2005; Lance Albertson <ramereth@gentoo.org> + nagios-nrpe-2.0-r1.ebuild: + * Clean up how the binaries are installed in the ebuild + + 07 Oct 2005; Gustavo Zacarias <gustavoz@gentoo.org> + nagios-nrpe-2.0-r1.ebuild: + Stable on sparc + + 09 Sep 2005; Lance Albertson <ramereth@gentoo.org> + nagios-nrpe-2.0-r1.ebuild: + * Marked stable on x86 + +*nagios-nrpe-2.0-r1 (10 Jul 2005) + + 10 Jul 2005; Lance Albertson <ramereth@gentoo.org> + +nagios-nrpe-2.0-r1.ebuild: + * Added configure option for command-args + * Added nrpe_check_control from contrib + + 03 May 2005; Eldad Zack <eldad@gentoo.org> nagios-nrpe-1.8-r1.ebuild, + nagios-nrpe-2.0.ebuild: + Changed perms for check_nrpe and nrpe to 0750. + + 13 Apr 2005; Eldad Zack <eldad@gentoo.org> nagios-nrpe-1.8-r1.ebuild, + nagios-nrpe-2.0.ebuild: + tighter perms for /etc/nagios/nrpe.cfg. Thanks to Romang <zataz@zataz.net>. + Bug #88937. + + 20 Mar 2005; Eldad Zack <eldad@gentoo.org> nagios-nrpe-2.0.ebuild: + Generate the dh.h header file for better security. + + 11 Dec 2004; Benjamin Schindler <config@gentoo.org> + nagios-nrpe-2.0.ebuild: + Stable on amd64 + + 30 Nov 2004; Sven Wegener <swegener@gentoo.org> nagios-nrpe-2.0.ebuild: + Fixed invalid atoms in *DEPEND. + + 25 Oct 2004; Eldad Zack <eldad@gentoo.org> nagios-nrpe-2.0.ebuild: + Now featuring SSL useflag, as suggested by Christian Theune <ct@gocept.com>. + Closes #68704. + + 24 Oct 2004; Jason Wever <weeve@gentoo.org> nagios-nrpe-2.0.ebuild: + Stable on sparc. + + 18 Mar 2004; Philip Walls <malverian@gentoo.org> nagios-nrpe-2.0.ebuild + Stable on x86 and amd64 + +*nagios-nrpe-2.0 (10 Mar 2004) + 10 Mar 2004; Philip Walls <malverian@gentoo.org> nagios-nrpe-2.0.ebuild + Version bump. Removed old nrpe init script and nrpe.cfg. Added metadata + +*nagios-nrpe-1.8-r1 (17 Jun 2003) + 06 Dec 2003; Heinrich Wendel <lanius@gentoo.org> nagios-nrpe-1.8-r1.ebuild: + bug 34355 + + 17 Jun 2003; Dean Bailey <alron@gentoo.org> nagios-nrpe-1.8-r1 : + Fix for bugs #17885 and #19539, updated sample conf also. + + 28 Feb 2003; Dean Bailey <alron@gentoo.org> nagios-nrpe-1.8 : + Moved to x86 stable + +*nagios-nrpe-1.8 + 09 Feb 2003; Dean Bailey <alron@gentoo.org> nagios-nrpe-1.8 : + Version bump + + 15 Jan 2003; Dean Bailey <alron@gentoo.org> nagios-nrpe-1.7 : + Changed ~x86 to x86 and added ~sparc and ~ppc keywords + +*nagios-nrpe-1.7 (13 Jan 2003) + 13 Jan 2003; Dean Bailey <alron@gentoo.org> nagios-nrpe-1.7 : + Updated to version 1.7. + +*nagios-nrpe-1.5 (1 Nov 2002) + 1 Nov 2002; Dean Bailey <alron@gentoo.org> nagios-nrpe-1.5 : + Initial import. Ebuild submitted by Dean Bailey <alron@gentoo.org>. diff --git a/net-analyzer/nrpe/files/nagios-nrpe-2.13-command-args.patch b/net-analyzer/nrpe/files/nagios-nrpe-2.13-command-args.patch new file mode 100644 index 000000000000..fe6751aa55ee --- /dev/null +++ b/net-analyzer/nrpe/files/nagios-nrpe-2.13-command-args.patch @@ -0,0 +1,15 @@ +--- configure.old 2008-03-10 22:04:41.000000000 +0100 ++++ configure.in 2012-01-04 09:46:38.000000000 +0100 +@@ -362,7 +362,11 @@ + AC_SUBST(NAGIOS_INSTALL_OPTS) + + +-AC_ARG_ENABLE(command-args,--enable-command-args allows clients to specify command arguments. *** THIS IS A SECURITY RISK! *** Read the SECURITY file before using this option!,AC_DEFINE_UNQUOTED(ENABLE_COMMAND_ARGUMENTS)) ++AC_ARG_ENABLE(command-args,--enable-command-args allows clients to specify command arguments. *** THIS IS A SECURITY RISK! *** Read the SECURITY file before using this option!,[ ++ if test x$enableval = xyes; then ++ AC_DEFINE_UNQUOTED(ENABLE_COMMAND_ARGUMENTS) ++ fi ++ ]) + + + AC_PATH_PROG(PERL,perl) diff --git a/net-analyzer/nrpe/files/nagios-nrpe-2.13-multiline.patch b/net-analyzer/nrpe/files/nagios-nrpe-2.13-multiline.patch new file mode 100644 index 000000000000..8d96149cb36e --- /dev/null +++ b/net-analyzer/nrpe/files/nagios-nrpe-2.13-multiline.patch @@ -0,0 +1,200 @@ +diff --git a/include/common.h b/include/common.h +index 202dec4..86f8e32 100755 +--- a/include/common.h ++++ b/include/common.h +@@ -41,7 +41,7 @@ + #define DEFAULT_SOCKET_TIMEOUT 10 /* timeout after 10 seconds */
+ #define DEFAULT_CONNECTION_TIMEOUT 300 /* timeout if daemon is waiting for connection more than this time */
+
+-#define MAX_INPUT_BUFFER 2048 /* max size of most buffers we use */
++#define MAX_INPUT_BUFFER 16384 /* max size of most buffers we use */
+ #define MAX_FILENAME_LENGTH 256
+
+ #define MAX_HOST_ADDRESS_LENGTH 256 /* max size of a host address */
+@@ -55,12 +55,14 @@ +
+ #define QUERY_PACKET 1 /* id code for a packet containing a query */
+ #define RESPONSE_PACKET 2 /* id code for a packet containing a response */
++#define RESPONSE_PACKET_WITH_MORE 3 /* id code for a packet containing a response, with more data to follow */
+
+ #define NRPE_PACKET_VERSION_3 3 /* packet version identifier */
+ #define NRPE_PACKET_VERSION_2 2
+ #define NRPE_PACKET_VERSION_1 1 /* older packet version identifiers (no longer supported) */
+
+ #define MAX_PACKETBUFFER_LENGTH 1024 /* max amount of data we'll send in one query/response */
++ /* WARNING - do not change this as older clients/servers will not work */
+
+ typedef struct packet_struct{
+ int16_t packet_version;
+diff --git a/src/check_nrpe.c b/src/check_nrpe.c +index 0adced1..ff4b920 100755 +--- a/src/check_nrpe.c ++++ b/src/check_nrpe.c +@@ -221,6 +221,11 @@ int main(int argc, char **argv){ + return STATE_UNKNOWN;
+ }
+
++ /* Altinity patch: Allow multiple packets to be received */
++ /* Indentation not corrected to allow simpler patching */
++ /* START MULTI_PACKET LOOP */
++ do {
++
+ /* wait for the response packet */
+ bytes_to_recv=sizeof(receive_packet);
+ if(use_ssl==FALSE)
+@@ -233,31 +238,24 @@ int main(int argc, char **argv){ + /* reset timeout */
+ alarm(0);
+
+- /* close the connection */
+-#ifdef HAVE_SSL
+- if(use_ssl==TRUE){
+- SSL_shutdown(ssl);
+- SSL_free(ssl);
+- SSL_CTX_free(ctx);
+- }
+-#endif
+- graceful_close(sd,1000);
+-
+ /* recv() error */
+ if(rc<0){
+ printf("CHECK_NRPE: Error receiving data from daemon.\n");
++ graceful_close(sd,1000);
+ return STATE_UNKNOWN;
+ }
+
+ /* server disconnected */
+ else if(rc==0){
+ printf("CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.\n");
++ graceful_close(sd,1000);
+ return STATE_UNKNOWN;
+ }
+
+ /* receive underflow */
+ else if(bytes_to_recv<sizeof(receive_packet)){
+ printf("CHECK_NRPE: Receive underflow - only %d bytes received (%d expected).\n",bytes_to_recv,sizeof(receive_packet));
++ graceful_close(sd,1000);
+ return STATE_UNKNOWN;
+ }
+
+@@ -271,21 +269,21 @@ int main(int argc, char **argv){ + calculated_crc32=calculate_crc32((char *)&receive_packet,sizeof(receive_packet));
+ if(packet_crc32!=calculated_crc32){
+ printf("CHECK_NRPE: Response packet had invalid CRC32.\n");
+- close(sd);
++ graceful_close(sd,1000);
+ return STATE_UNKNOWN;
+ }
+
+ /* check packet version */
+ if(ntohs(receive_packet.packet_version)!=NRPE_PACKET_VERSION_2){
+ printf("CHECK_NRPE: Invalid packet version received from server.\n");
+- close(sd);
++ graceful_close(sd,1000);
+ return STATE_UNKNOWN;
+ }
+
+ /* check packet type */
+- if(ntohs(receive_packet.packet_type)!=RESPONSE_PACKET){
++ if(ntohs(receive_packet.packet_type)!=RESPONSE_PACKET && ntohs(receive_packet.packet_type)!=RESPONSE_PACKET_WITH_MORE){
+ printf("CHECK_NRPE: Invalid packet type received from server.\n");
+- close(sd);
++ graceful_close(sd,1000);
+ return STATE_UNKNOWN;
+ }
+
+@@ -297,8 +295,18 @@ int main(int argc, char **argv){ + if(!strcmp(receive_packet.buffer,""))
+ printf("CHECK_NRPE: No output returned from daemon.\n");
+ else
+- printf("%s\n",receive_packet.buffer);
+- }
++ printf("%s",receive_packet.buffer);
++
++ } while (ntohs(receive_packet.packet_type)==RESPONSE_PACKET_WITH_MORE);
++ /* END MULTI_PACKET LOOP */
++
++ /* Finish output with newline */
++ printf("\n");
++
++ /* close the connection */
++ graceful_close(sd,1000);
++
++ }
+
+ /* reset the alarm */
+ else
+@@ -434,6 +442,14 @@ int graceful_close(int sd, int timeout){ + struct timeval tv;
+ char buf[1000];
+
++#ifdef HAVE_SSL
++ if(use_ssl==TRUE){
++ SSL_shutdown(ssl);
++ SSL_free(ssl);
++ SSL_CTX_free(ctx);
++ }
++#endif
++
+ /* send FIN packet */
+ shutdown(sd,SHUT_WR);
+ for(;;){
+diff --git a/src/nrpe.c b/src/nrpe.c +index f2b0164..dfa8262 100755 +--- a/src/nrpe.c ++++ b/src/nrpe.c +@@ -972,6 +972,8 @@ void handle_connection(int sock){ + char processed_command[MAX_INPUT_BUFFER];
+ int result=STATE_OK;
+ int early_timeout=FALSE;
++ int bytes_copied=0;
++ char *pbuffer=&buffer[0];
+ int rc;
+ int x;
+ #ifdef DEBUG
+@@ -1188,6 +1190,14 @@ void handle_connection(int sock){ + if(buffer[strlen(buffer)-1]=='\n')
+ buffer[strlen(buffer)-1]='\x0';
+
++ /* Altinity patch to allow multi packet responses */
++ /* Loop not indented to allow easier patching */
++ /* START MULTI_PACKET LOOP */
++ do {
++
++ if(debug==TRUE)
++ syslog(LOG_DEBUG,"Sending response - bytes left: %d", strlen(pbuffer));
++
+ /* clear the response packet buffer */
+ bzero(&send_packet,sizeof(send_packet));
+
+@@ -1196,11 +1206,17 @@ void handle_connection(int sock){ +
+ /* initialize response packet data */
+ send_packet.packet_version=(int16_t)htons(NRPE_PACKET_VERSION_2);
+- send_packet.packet_type=(int16_t)htons(RESPONSE_PACKET);
+ send_packet.result_code=(int16_t)htons(result);
+- strncpy(&send_packet.buffer[0],buffer,MAX_PACKETBUFFER_LENGTH);
++ strncpy(&send_packet.buffer[0],pbuffer,MAX_PACKETBUFFER_LENGTH);
+ send_packet.buffer[MAX_PACKETBUFFER_LENGTH-1]='\x0';
+-
++
++ bytes_copied = strlen(&send_packet.buffer[0]);
++ pbuffer = pbuffer+bytes_copied;
++ if(strlen(pbuffer)>0)
++ send_packet.packet_type=(int16_t)htons(RESPONSE_PACKET_WITH_MORE);
++ else
++ send_packet.packet_type=(int16_t)htons(RESPONSE_PACKET);
++
+ /* calculate the crc 32 value of the packet */
+ send_packet.crc32_value=(u_int32_t)0L;
+ calculated_crc32=calculate_crc32((char *)&send_packet,sizeof(send_packet));
+@@ -1219,6 +1235,9 @@ void handle_connection(int sock){ + SSL_write(ssl,&send_packet,bytes_to_send);
+ #endif
+
++ } while (strlen(pbuffer) > 0);
++ /* END MULTI_PACKET LOOP */
++
+ #ifdef HAVE_SSL
+ if(ssl){
+ SSL_shutdown(ssl);
diff --git a/net-analyzer/nrpe/files/nagios-nrpe-2.13-tcpd.patch b/net-analyzer/nrpe/files/nagios-nrpe-2.13-tcpd.patch new file mode 100644 index 000000000000..67dd22e05310 --- /dev/null +++ b/net-analyzer/nrpe/files/nagios-nrpe-2.13-tcpd.patch @@ -0,0 +1,33 @@ +--- configure.in.orig 2008-03-10 22:04:41.000000000 +0100 ++++ configure.in 2012-01-08 17:59:49.804613011 +0100 +@@ -147,11 +147,27 @@ + AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl") + AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket") + AC_SUBST(SOCKETLIBS) +-AC_CHECK_LIB(wrap,main,[ +- LIBWRAPLIBS="$LIBWRAPLIBS -lwrap" ++ ++AC_ARG_ENABLE(tcp-wrapper,--enable-tcp-wrapper enables support for TCP wrappers. *** DISABLING IS A SECURITY RISK! *** Read the SECURITY file before using this option! (default: auto),[ ++ if test x$enableval = xyes; then ++ enable_tcp_wrapper=yes ++ else ++ enable_tcp_wrapper=no ++ fi ++ ],enable_tcp_wrapper="auto") ++ ++LIBWRAPLIBS="" ++if test "x$enable_tcp_wrapper" = "xauto"; then ++ AC_CHECK_LIB(wrap,main,[ ++ LIBWRAPLIBS="$LIBWRAPLIBS -lwrap" ++ AC_DEFINE(HAVE_LIBWRAP) ++ ]) ++elif test "x$enable_tcp_wrapper" = "xyes"; then ++ AC_CHECK_LIB(wrap,main,LIBWRAPLIBS="$LIBWRAPLIBS -lwrap",[AC_MSG_ERROR([TCP wrapper library not found])]) + AC_DEFINE(HAVE_LIBWRAP) +- ]) ++fi + AC_SUBST(LIBWRAPLIBS) ++ + AC_CHECK_FUNCS(strdup strstr strtoul initgroups closesocket) + + dnl socklen_t check - from curl diff --git a/net-analyzer/nrpe/files/nrpe-nagios3 b/net-analyzer/nrpe/files/nrpe-nagios3 new file mode 100644 index 000000000000..28be2b83377f --- /dev/null +++ b/net-analyzer/nrpe/files/nrpe-nagios3 @@ -0,0 +1,36 @@ +#!/sbin/runscript + +extra_started_commands="reload" + +depend() { + need net +} + +start() { + ebegin "Starting nrpe" + start-stop-daemon --start --quiet --name nrpe \ + --exec /usr/bin/nrpe \ + -c nagios:nagios \ + -- -c /etc/nagios/nrpe.cfg \ + --daemon + eend $? "Failed to Start nrpe" +} + +stop() { + ebegin "Stopping nrpe" + start-stop-daemon --stop --quiet -n nrpe + eend $? "Failed to Stop nrpe" +} + +reload() { + ebegin "Reloading nrpe" + kill -HUP `pgrep nrpe | head -1` + eend $? "Failed to reload nrpe" +} + +restart() { + ebegin "Restarting nrpe" + svc_stop + svc_start + eend $? "Failed to Restart nrpe" +} diff --git a/net-analyzer/nrpe/files/nrpe-nagios3-r1 b/net-analyzer/nrpe/files/nrpe-nagios3-r1 new file mode 100644 index 000000000000..8032a30c47a6 --- /dev/null +++ b/net-analyzer/nrpe/files/nrpe-nagios3-r1 @@ -0,0 +1,22 @@ +#!/sbin/runscript + +extra_started_commands="reload" + +command="/usr/bin/nrpe" +command_args="-c /etc/nagios/nrpe.cfg --daemon" +pidfile="${pidfile:-/var/run/nrpe/nrpe.pid}" +start_stop_daemon_args="--user nagios --group nagios" + +depend() { + need net +} + +start_pre() { + checkpath -d -m 0750 -o nagios:nagios /var/run/nrpe +} + +reload() { + ebegin "Reloading nrpe" + kill -HUP $(head -n1 ${pidfile}) + eend $? "Failed to reload nrpe" +} diff --git a/net-analyzer/nrpe/files/nrpe.init b/net-analyzer/nrpe/files/nrpe.init new file mode 100644 index 000000000000..cf3b2242b2dd --- /dev/null +++ b/net-analyzer/nrpe/files/nrpe.init @@ -0,0 +1,30 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nrpe/files/nrpe.init,v 1.1 2012/08/23 23:07:05 flameeyes Exp $ + +: ${CFGFILE:=/etc/nagios/nrpe.cfg} + +get_config() { + [ -f ${CFGFILE} ] || return 1 + + sed -n -e 's:^[ \t]*'$1'=\([^#]\+\).*:\1:p' \ + ${CFGFILE} +} + +extra_started_commands="reload" + +command=/usr/libexec/${SVCNAME} +command_args="-c ${CFGFILE} --daemon" +pidfile=$(get_config pid_file) + +depend() { + config ${CFGFILE} + need net +} + +reload() { + ebegin "Reloading ${SVCNAME}" + kill -HUP `cat $(get_config pid_file)` + eend $? +} diff --git a/net-analyzer/nrpe/files/nrpe.xinetd b/net-analyzer/nrpe/files/nrpe.xinetd new file mode 100644 index 000000000000..52632880127c --- /dev/null +++ b/net-analyzer/nrpe/files/nrpe.xinetd @@ -0,0 +1,11 @@ +service nrpe { + socket_type = stream + protocol = tcp + wait = no + user = nagios + group = nagios + server = /usr/bin/nrpe + server_args = -c /etc/nagios/nrpe.cfg --inetd +# only_from = 127.0.0.1 + disabled = yes +} diff --git a/net-analyzer/nrpe/files/nrpe.xinetd.2 b/net-analyzer/nrpe/files/nrpe.xinetd.2 new file mode 100644 index 000000000000..d9f226eb2f96 --- /dev/null +++ b/net-analyzer/nrpe/files/nrpe.xinetd.2 @@ -0,0 +1,5 @@ +/nrpe + server_args = -c /etc/nagios/nrpe.cfg --inetd +# only_from = 127.0.0.1 + disabled = yes +} diff --git a/net-analyzer/nrpe/metadata.xml b/net-analyzer/nrpe/metadata.xml new file mode 100644 index 000000000000..505d584563e0 --- /dev/null +++ b/net-analyzer/nrpe/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>sysadmin</herd> + <longdescription> + A daemon for allowing Nagios to connect directly to servers and + execute commands defined in a centralized configuration file. + </longdescription> + <use> + <flag name='command-args'>allow clients to specify command arguments</flag> + </use> +</pkgmetadata> diff --git a/net-analyzer/nrpe/nrpe-2.12-r102.ebuild b/net-analyzer/nrpe/nrpe-2.12-r102.ebuild new file mode 100644 index 000000000000..f1ea10698a75 --- /dev/null +++ b/net-analyzer/nrpe/nrpe-2.12-r102.ebuild @@ -0,0 +1,93 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nrpe/nrpe-2.12-r102.ebuild,v 1.1 2012/08/23 23:07:05 flameeyes Exp $ + +inherit eutils toolchain-funcs user multilib + +DESCRIPTION="Nagios $PV NRPE - Nagios Remote Plugin Executor" +HOMEPAGE="http://www.nagios.org/" +SRC_URI="mirror://sourceforge/nagios/nrpe-${PV}.tar.gz" + +RESTRICT="mirror" +LICENSE="GPL-2" +SLOT="0" + +KEYWORDS="alpha amd64 hppa ppc ppc64 sparc x86" + +IUSE="ssl command-args" +DEPEND=">=net-analyzer/nagios-plugins-1.3.0 + ssl? ( dev-libs/openssl )" +RDEPEND="${DEPEND}" +S="${WORKDIR}/nrpe-${PV}" + +pkg_setup() { + enewgroup nagios + enewuser nagios -1 /bin/bash /dev/null nagios +} + +src_compile() { + local myconf + + myconf="${myconf} $(use_enable ssl) \ + $(use_enable command-args)" + + # Generate the dh.h header file for better security (2005 Mar 20 eldad) + if use ssl ; then + openssl dhparam -C 512 | sed -n '1,/BEGIN DH PARAMETERS/p' | grep -v "BEGIN DH PARAMETERS" > "${S}"/src/dh.h + fi + + econf ${myconf} \ + --host=${CHOST} \ + --prefix=/usr \ + --libexecdir=/usr/$(get_libdir)/nagios/plugins \ + --localstatedir=/var/nagios \ + --sysconfdir=/etc/nagios \ + --with-nrpe-user=nagios \ + --with-nrpe-grp=nagios || die "econf failed" + emake all || die "make failed" + # Add nifty nrpe check tool + cd contrib + $(tc-getCC) ${CFLAGS} -o nrpe_check_control nrpe_check_control.c +} + +src_install() { + dodoc LEGAL Changelog README SECURITY README.SSL \ + contrib/README.nrpe_check_control + + insinto /etc/nagios + newins "${S}"/sample-config/nrpe.cfg nrpe.cfg + fowners root:nagios /etc/nagios/nrpe.cfg + fperms 0640 /etc/nagios/nrpe.cfg + + exeopts -m0750 -o nagios -g nagios + exeinto /usr/bin + doexe src/nrpe + + exeopts -m0750 -o nagios -g nagios + exeinto /usr/$(get_libdir)/nagios/plugins + doexe src/check_nrpe contrib/nrpe_check_control + + newinitd "${FILESDIR}"/nrpe-nagios3 nrpe + + # Create pidfile in /var/run/nrpe, bug #233859 + keepdir /var/run/nrpe + fowners nagios:nagios /var/run/nrpe + sed -i -e \ + "s#pid_file=/var/run/nrpe.pid#pid_file=/var/run/nrpe/nrpe.pid#" \ + "${D}"/etc/nagios/nrpe.cfg || die "sed failed" +} + +pkg_postinst() { + einfo + einfo "If you are using the nrpe daemon, remember to edit" + einfo "the config file /etc/nagios/nrpe.cfg" + einfo + + if use command-args ; then + ewarn "You have enabled command-args for NRPE. This enables" + ewarn "the ability for clients to supply arguments to commands" + ewarn "which should be run. " + ewarn "THIS IS CONSIDERED A SECURITY RISK!" + ewarn "Please read /usr/share/doc/${PF}/SECURITY.bz2 for more info" + fi +} diff --git a/net-analyzer/nrpe/nrpe-2.13-r2.ebuild b/net-analyzer/nrpe/nrpe-2.13-r2.ebuild new file mode 100644 index 000000000000..1fb1fa8cd8e8 --- /dev/null +++ b/net-analyzer/nrpe/nrpe-2.13-r2.ebuild @@ -0,0 +1,121 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nrpe/nrpe-2.13-r2.ebuild,v 1.1 2012/08/23 23:07:05 flameeyes Exp $ + +EAPI=4 + +inherit eutils toolchain-funcs multilib user autotools + +DESCRIPTION="Nagios Remote Plugin Executor" +HOMEPAGE="http://www.nagios.org/" +SRC_URI="mirror://sourceforge/nagios/nrpe-${PV}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 hppa ppc ~ppc64 sparc x86" +IUSE="command-args ssl tcpd xinetd" + +DEPEND=">=net-analyzer/nagios-plugins-1.3.0 + ssl? ( dev-libs/openssl ) + tcpd? ( sys-apps/tcp-wrappers )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/nrpe-${PV}" + +RESTRICT="mirror" + +pkg_setup() { + enewgroup nagios + enewuser nagios -1 /bin/bash /dev/null nagios + + elog "If you plan to use \"nrpe_check_control\" then you may want to specify" + elog "different command and services files. You can override the defaults" + elog "through the \"NAGIOS_COMMAND_FILE\" and \"NAGIOS_SERVICES_FILE\" environment variables." + elog "NAGIOS_COMMAND_FILE=${NAGIOS_COMMAND_FILE:-/var/rw/nagios.cmd}" + elog "NAGIOS_SERVICES_FILE=${NAGIOS_SERVICES_FILE:-/etc/services.cfg}" +} + +src_prepare() { + # Add support for large output, + # http://opsview-blog.opsera.com/dotorg/2008/08/enhancing-nrpe.html + epatch "${FILESDIR}/nagios-nrpe-2.13-multiline.patch" + + # TCP wrappers conditional, bug 326367 + epatch "${FILESDIR}/nagios-nrpe-2.13-tcpd.patch" + # Make command-args really conditional, bug 397603 + epatch "${FILESDIR}/nagios-nrpe-2.13-command-args.patch" + + sed -i -e "s:/usr/local/nagios/var/rw/nagios.cmd:${NAGIOS_COMMAND_FILE:-/var/rw/nagios.cmd}:" contrib/nrpe_check_control.c || die + sed -i -e "s:/usr/local/nagios/etc/services.cfg:${NAGIOS_SERVICES_FILE:-/etc/services.cfg}:" contrib/nrpe_check_control.c || die + + sed -i -e \ + "s#pid_file=/var/run/nrpe.pid#pid_file=/var/run/nrpe/nrpe.pid#" \ + sample-config//nrpe.cfg.in || die "sed failed" + + eautoreconf +} + +src_configure() { + econf \ + --host=${CHOST} \ + --prefix=/usr \ + --libexecdir=/usr/$(get_libdir)/nagios/plugins \ + --localstatedir=/var/nagios \ + --sysconfdir=/etc/nagios \ + --with-nrpe-user=nagios \ + --with-nrpe-group=nagios \ + $(use_enable ssl) \ + $(use_enable tcpd tcp-wrapper) \ + $(use_enable command-args) +} + +src_compile() { + emake all + + # Add nifty nrpe check tool + cd contrib + $(tc-getCC) ${CFLAGS} ${LDFLAGS} -o nrpe_check_control nrpe_check_control.c || die +} + +src_install() { + insinto /etc/nagios + newins sample-config/nrpe.cfg nrpe.cfg + fowners root:nagios /etc/nagios/nrpe.cfg + fperms 0640 /etc/nagios/nrpe.cfg + + exeopts -m 0750 -o nagios -g nagios + exeinto /usr/bin + doexe src/nrpe + + exeopts -m 0750 -o nagios -g nagios + exeinto /usr/$(get_libdir)/nagios/plugins + doexe src/check_nrpe contrib/nrpe_check_control + + exeopts -m 0755 + newinitd "${FILESDIR}"/nrpe-nagios3-r1 nrpe + + dodoc LEGAL Changelog README SECURITY \ + contrib/README.nrpe_check_control + + use ssl && dodoc README.SSL + + if use xinetd; then + insinto /etc/xinetd.d/ + doins "${FILESDIR}/nrpe.xinetd" + fi +} + +pkg_postinst() { + einfo + einfo "If you are using the nrpe daemon, remember to edit" + einfo "the config file /etc/nagios/nrpe.cfg" + einfo + + if use command-args ; then + ewarn "You have enabled command-args for NRPE. This enables" + ewarn "the ability for clients to supply arguments to commands" + ewarn "which should be run. " + ewarn "THIS IS CONSIDERED A SECURITY RISK!" + ewarn "Please read /usr/share/doc/${PF}/SECURITY.bz2 for more info" + fi +} diff --git a/net-analyzer/nrpe/nrpe-2.13-r3.ebuild b/net-analyzer/nrpe/nrpe-2.13-r3.ebuild new file mode 100644 index 000000000000..41987c1a0274 --- /dev/null +++ b/net-analyzer/nrpe/nrpe-2.13-r3.ebuild @@ -0,0 +1,111 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nrpe/nrpe-2.13-r3.ebuild,v 1.1 2012/08/23 23:07:05 flameeyes Exp $ + +EAPI=4 + +inherit eutils toolchain-funcs multilib user autotools + +DESCRIPTION="Nagios Remote Plugin Executor" +HOMEPAGE="http://www.nagios.org/" +SRC_URI="mirror://sourceforge/nagios/nrpe-${PV}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86" +IUSE="command-args ssl tcpd" + +DEPEND=">=net-analyzer/nagios-plugins-1.3.0 + ssl? ( dev-libs/openssl ) + tcpd? ( sys-apps/tcp-wrappers )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/nrpe-${PV}" + +pkg_setup() { + enewgroup nagios + enewuser nagios -1 /bin/bash /dev/null nagios + + elog "If you plan to use \"nrpe_check_control\" then you may want to specify" + elog "different command and services files. You can override the defaults" + elog "through the \"NAGIOS_COMMAND_FILE\" and \"NAGIOS_SERVICES_FILE\" environment variables." + elog "NAGIOS_COMMAND_FILE=${NAGIOS_COMMAND_FILE:-/var/rw/nagios.cmd}" + elog "NAGIOS_SERVICES_FILE=${NAGIOS_SERVICES_FILE:-/etc/services.cfg}" +} + +src_prepare() { + # Add support for large output, + # http://opsview-blog.opsera.com/dotorg/2008/08/enhancing-nrpe.html + epatch "${FILESDIR}/nagios-nrpe-2.13-multiline.patch" + + # TCP wrappers conditional, bug 326367 + epatch "${FILESDIR}/nagios-nrpe-2.13-tcpd.patch" + # Make command-args really conditional, bug 397603 + epatch "${FILESDIR}/nagios-nrpe-2.13-command-args.patch" + + sed -i -e '/define \(COMMAND\|SERVICES\)_FILE/d' contrib/nrpe_check_control.c || die + + sed -i -e \ + "s#pid_file=/var/run/nrpe.pid#pid_file=/var/run/nrpe/nrpe.pid#" \ + sample-config//nrpe.cfg.in || die "sed failed" + + eautoreconf +} + +src_configure() { + econf \ + --libexecdir=/usr/$(get_libdir)/nagios/plugins \ + --localstatedir=/var/nagios \ + --sysconfdir=/etc/nagios \ + --with-nrpe-user=nagios \ + --with-nrpe-group=nagios \ + $(use_enable ssl) \ + $(use_enable tcpd tcp-wrapper) \ + $(use_enable command-args) +} + +src_compile() { + emake all + + # Add nifty nrpe check tool + $(tc-getCC) ${CPPFLAGS} ${CFLAGS} \ + -DCOMMAND_FILE=\"${NAGIOS_COMMAND_FILE:-/var/rw/nagios.cmd}\" \ + -DSERVICES_FILE=\"${NAGIOS_SERVICES_FILE:-/etc/services.cfg}\" \ + ${LDFLAGS} -o nrpe_check_control contrib/nrpe_check_control.c || die +} + +src_install() { + insinto /etc/nagios + newins sample-config/nrpe.cfg nrpe.cfg + fowners root:nagios /etc/nagios/nrpe.cfg + fperms 0640 /etc/nagios/nrpe.cfg + + exeinto /usr/libexec + doexe src/nrpe + + newinitd "${FILESDIR}"/nrpe.init nrpe + + dodoc LEGAL Changelog README SECURITY \ + contrib/README.nrpe_check_control \ + $(usex ssl README.SSL) + + insinto /etc/xinetd.d/ + doins "${FILESDIR}/nrpe.xinetd.2" + + exeinto /usr/$(get_libdir)/nagios/plugins + doexe src/check_nrpe nrpe_check_control +} + +pkg_postinst() { + elog "If you are using the nrpe daemon, remember to edit" + elog "the config file /etc/nagios/nrpe.cfg" + + if use command-args ; then + ewarn "" + ewarn "You have enabled command-args for NRPE. This enables" + ewarn "the ability for clients to supply arguments to commands" + ewarn "which should be run. " + ewarn "THIS IS CONSIDERED A SECURITY RISK!" + ewarn "Please read /usr/share/doc/${PF}/SECURITY.bz2 for more info" + fi +} |