summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-analyzer/nagios-plugins/ChangeLog13
-rw-r--r--net-analyzer/nagios-plugins/Manifest5
-rw-r--r--net-analyzer/nagios-plugins/files/nagios-plugins-1.4.10-contrib.patch43
-rw-r--r--net-analyzer/nagios-plugins/files/nagios-plugins-1.4.10-noradius.patch30
-rw-r--r--net-analyzer/nagios-plugins/files/nagios-plugins-1.4.12-pgsqlconfigure.patch69
-rw-r--r--net-analyzer/nagios-plugins/nagios-plugins-9999.ebuild135
6 files changed, 295 insertions, 0 deletions
diff --git a/net-analyzer/nagios-plugins/ChangeLog b/net-analyzer/nagios-plugins/ChangeLog
new file mode 100644
index 0000000..3120f79
--- /dev/null
+++ b/net-analyzer/nagios-plugins/ChangeLog
@@ -0,0 +1,13 @@
+# ChangeLog for net-analyzer/nagios-plugins
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*nagios-plugins-9999 (28 Jun 2009)
+
+ 28 Jun 2009; Tobias Scherbaum <dertobi123@gentoo.org>
+ +files/nagios-plugins-1.4.10-contrib.patch,
+ +files/nagios-plugins-1.4.10-noradius.patch,
+ +files/nagios-plugins-1.4.12-pgsqlconfigure.patch,
+ +nagios-plugins-9999.ebuild:
+ Add live ebuild for nagios-plugins
+
diff --git a/net-analyzer/nagios-plugins/Manifest b/net-analyzer/nagios-plugins/Manifest
new file mode 100644
index 0000000..6a4d358
--- /dev/null
+++ b/net-analyzer/nagios-plugins/Manifest
@@ -0,0 +1,5 @@
+AUX nagios-plugins-1.4.10-contrib.patch 1610 RMD160 928e2ce0a8071b5fd93ca28722512d8996eaa027 SHA1 ff7105763268fc3cc48dced7c17df9ff0bb84899 SHA256 d7aa2d6e420438ae5e5e687bd61bd5ff1ca5aebb763e3b692238db23f24d7278
+AUX nagios-plugins-1.4.10-noradius.patch 1029 RMD160 e1e449d93966d822eca21782968e24fce4547a95 SHA1 e5e6758790cc85db9f028cde3fb3d6611356167e SHA256 bff601e67a413abd84c2b430bfcf10395f68a83f98a628a398ee50f7cb406229
+AUX nagios-plugins-1.4.12-pgsqlconfigure.patch 2981 RMD160 6090168654e888ce9b5bb1c5c6b493f3a019472d SHA1 db41a7f6b57f1119045fb90707a7a8182225d9b8 SHA256 8e57962c484363fa790c6920f1f9fe11f273a061fcc59ac2cb9b1d57634a1455
+EBUILD nagios-plugins-9999.ebuild 4183 RMD160 4a8f68fda765dbccd63ea5a9ec287e2e2b0b78bb SHA1 1bfbfcb52c90cc16be30d5a408b52355452ecce8 SHA256 530e4419e2ffa8661d23dc10046b63ce497fe9e5b9bb936dfb0c160f2dd9441d
+MISC ChangeLog 435 RMD160 d159bb7359b3fa001890d03c920e142350a9db08 SHA1 24e1788d5ca76e0c9781205ff7b934f633f15be3 SHA256 11f8db6ee6bb3797d3f25de7e8fd97e41f8569a03cb35a564f50c2db4879c831
diff --git a/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.10-contrib.patch b/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.10-contrib.patch
new file mode 100644
index 0000000..905f760
--- /dev/null
+++ b/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.10-contrib.patch
@@ -0,0 +1,43 @@
+diff -Naur nagios-plugins-1.4.10.orig/contrib/check_dns_random.pl nagios-plugins-1.4.10/contrib/check_dns_random.pl
+--- nagios-plugins-1.4.10.orig/contrib/check_dns_random.pl 2003-01-29 06:27:20.000000000 +0100
++++ nagios-plugins-1.4.10/contrib/check_dns_random.pl 2007-09-29 10:57:38.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl
++#!/usr/bin/perl -w
+ # ------------------------------------------------------------------------------
+ # File Name: check_dns_random.pl
+ # Author: Richard Mayhew - South Africa
+@@ -33,9 +33,9 @@
+
+ my $host = shift || &usage;
+
+-my $domainfile = "/usr/local/nagios/etc/domains.list";
++my $domainfile = "/etc/nagios/domains.list";
+ my $wc = `/usr/bin/wc -l $domainfile`;
+-my $check = "/usr/local/nagios/libexec/check_dns";
++my $check = "/usr/nagios/libexec/check_dns";
+ my $x = 0;
+ my $srv_file = "";
+ my $z = "";
+@@ -49,8 +49,7 @@
+ my @data = split(/\n/,$srv_file);
+
+ chomp $wc;
+-$wc =~ s/ //g;
+-$wc =~ s/domains//g;
++$wc =~ s/([[:digit:]]+) .*/$1/g;
+
+ $x = rand $wc;
+ ($z,$y) = split(/\./,$x);
+diff -Naur nagios-plugins-1.4.10.orig/contrib/check_linux_raid.pl nagios-plugins-1.4.10/contrib/check_linux_raid.pl
+--- nagios-plugins-1.4.10.orig/contrib/check_linux_raid.pl 2007-08-28 05:19:45.000000000 +0200
++++ nagios-plugins-1.4.10/contrib/check_linux_raid.pl 2007-09-29 10:57:50.000000000 +0200
+@@ -23,7 +23,7 @@
+ # WARNING md0 status=[UUU_U], recovery=46.4%, finish=123.0min
+
+ use strict;
+-use lib "/usr/local/nagios/libexec";
++use lib "/usr/nagios/libexec";
+ use utils qw(%ERRORS);
+
+ # die with an error if we're not on Linux
diff --git a/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.10-noradius.patch b/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.10-noradius.patch
new file mode 100644
index 0000000..6d51d7f
--- /dev/null
+++ b/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.10-noradius.patch
@@ -0,0 +1,30 @@
+diff -Naur nagios-plugins-1.4.10.orig/configure.in nagios-plugins-1.4.10/configure.in
+--- nagios-plugins-1.4.10.orig/configure.in 2007-09-29 02:44:36.000000000 +0200
++++ nagios-plugins-1.4.10/configure.in 2007-09-29 11:20:19.000000000 +0200
+@@ -210,26 +210,6 @@
+ LIBS="$_SAVEDLIBS"
+ CPPFLAGS="$_SAVEDCPPFLAGS"
+
+-dnl Check for radius libraries
+-_SAVEDLIBS="$LIBS"
+-AC_CHECK_LIB(radiusclient,rc_read_config)
+-if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
+- EXTRAS="$EXTRAS check_radius"
+- RADIUSLIBS="-lradiusclient"
+- AC_SUBST(RADIUSLIBS)
+-else
+- AC_CHECK_LIB(radiusclient-ng,rc_read_config)
+- if test "$ac_cv_lib_radiusclient_ng_rc_read_config" = "yes"; then
+- EXTRAS="$EXTRAS check_radius"
+- RADIUSLIBS="-lradiusclient-ng"
+- AC_SUBST(RADIUSLIBS)
+- else
+- AC_MSG_WARN([Skipping radius plugin])
+- AC_MSG_WARN([install radius libs to compile this plugin (see REQUIREMENTS).])
+- fi
+-fi
+-LIBS="$_SAVEDLIBS"
+-
+ dnl Check for LDAP libraries
+ _SAVEDLIBS="$LIBS"
+ AC_CHECK_LIB(ldap,main,,,-llber)
diff --git a/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.12-pgsqlconfigure.patch b/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.12-pgsqlconfigure.patch
new file mode 100644
index 0000000..e5e713d
--- /dev/null
+++ b/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.12-pgsqlconfigure.patch
@@ -0,0 +1,69 @@
+diff -Naur nagios-plugins-1.4.12.orig/configure.in nagios-plugins-1.4.12/configure.in
+--- nagios-plugins-1.4.12.orig/configure.in 2008-05-28 00:01:05.000000000 +0200
++++ nagios-plugins-1.4.12/configure.in 2008-07-20 18:02:42.000000000 +0200
+@@ -182,27 +182,34 @@
+ PGSQL=$withval,)
+ AC_CHECK_LIB(crypt,main)
+ if test "$ac_cv_lib_crypt_main" = "yes" -a "x$PGSQL" != "xno"; then
+- if test -n "$PGSQL"; then
+- LDFLAGS="$LDFLAGS -L$PGSQL/lib"
+- CPPFLAGS="$CPPFLAGS -I$PGSQL/include"
++ if test -x $with_pgsql/bin/pg_config ; then
++ np_pg_config="$with_pgsql/bin/pg_config"
+ fi
+- AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt)
+- if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
+- AC_CHECK_HEADERS(pgsql/libpq-fe.h)
+- AC_CHECK_HEADERS(postgresql/libpq-fe.h)
+- AC_CHECK_HEADERS(libpq-fe.h)
+- if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then
+- PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
+- PGINCLUDE="-I$PGSQL/include"
+- elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
+- PGLIBS="-lpq -lcrypt"
+- PGINCLUDE="-I/usr/include/pgsql"
+- elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
+- PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
+- PGINCLUDE="-I/usr/include/postgresql"
+- elif test "$ac_cv_header_libpq_fe_h" = "yes"; then
+- PGLIBS="-L$PGSQL/lib -lpq -lcrypt"
+- PGINCLUDE="-I$PGSQL/include"
++ if test -z "$np_pg_config"; then
++ with_pgsql="no"
++ else
++ if test -n "$PGSQL"; then
++ LDFLAGS="$LDFLAGS -L`$np_pg_config --libdir`"
++ CPPFLAGS="$CPPFLAGS -I`$np_pg_config --includedir`"
++ fi
++ AC_CHECK_LIB(pq,PQsetdbLogin,,,-lcrypt)
++ if test "$ac_cv_lib_pq_PQsetdbLogin" = "yes"; then
++ AC_CHECK_HEADERS(pgsql/libpq-fe.h)
++ AC_CHECK_HEADERS(postgresql/libpq-fe.h)
++ AC_CHECK_HEADERS(libpq-fe.h)
++ if [[ -n "$PGSQL" -a "$ac_cv_header_libpq_fe_h" = "yes" ]]; then
++ PGLIBS="-L`$np_pg_config --libdir` -lpq -lcrypt"
++ PGINCLUDE="-I`$np_pg_config --includedir`"
++ elif test "$ac_cv_header_pgsql_libpq_fe_h" = "yes"; then
++ PGLIBS="-lpq -lcrypt"
++ PGINCLUDE="-I`$np_pg_config --includedir`"
++ elif test "$ac_cv_header_postgresql_libpq_fe_h" = "yes"; then
++ PGLIBS="-L`$np_pg_config --libdir` -lpq -lcrypt"
++ PGINCLUDE="-I`$np_pg_config --includedir`"
++ elif test "$ac_cv_header_libpq_fe_h" = "yes"; then
++ PGLIBS="-L`$np_pg_config --libdir` -lpq -lcrypt"
++ PGINCLUDE="-I`$np_pg_config --includedir`"
++ fi
+ fi
+ if test -z "$PGINCLUDE"; then
+ AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
+@@ -212,10 +219,6 @@
+ AC_SUBST(PGINCLUDE)
+ EXTRAS="$EXTRAS check_pgsql"
+ fi
+- else
+- AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
+- AC_MSG_WARN([LIBS="$LIBS" CPPFLAGS="$CPPFLAGS"])
+- AC_MSG_WARN([install PostgreSQL libs to compile this plugin (see REQUIREMENTS).])
+ fi
+ else
+ AC_MSG_WARN([Skipping PostgreSQL plugin (check_pgsql)])
diff --git a/net-analyzer/nagios-plugins/nagios-plugins-9999.ebuild b/net-analyzer/nagios-plugins/nagios-plugins-9999.ebuild
new file mode 100644
index 0000000..cfd48e8
--- /dev/null
+++ b/net-analyzer/nagios-plugins/nagios-plugins-9999.ebuild
@@ -0,0 +1,135 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios-plugins/nagios-plugins-1.4.13-r4.ebuild,v 1.2 2009/05/31 08:13:37 dertobi123 Exp $
+
+EAPI=2
+
+inherit eutils autotools git
+
+EGIT_REPO_URI="git://repo.or.cz/nagiosplugins.git"
+DESCRIPTION="Nagios $PV plugins - Pack of plugins to make Nagios work properly"
+HOMEPAGE="http://www.nagios.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="+ssl samba mysql postgres ldap snmp nagios-dns nagios-ntp nagios-ping
+nagios-ssh nagios-game ups ipv6 radius +suid"
+
+DEPEND="ldap? ( >=net-nds/openldap-2.0.25 )
+ mysql? ( virtual/mysql )
+ postgres? ( >=virtual/postgresql-base-7.2 )
+ ssl? ( >=dev-libs/openssl-0.9.6g )
+ radius? ( >=net-dialup/radiusclient-0.3.2 )"
+
+RESTRICT="test"
+
+RDEPEND="${DEPEND}
+ >=dev-lang/perl-5.6.1-r7
+ samba? ( >=net-fs/samba-2.2.5-r1 )
+ snmp? ( >=dev-perl/Net-SNMP-4.0.1-r1
+ >=net-analyzer/net-snmp-5.0.6
+ )
+ mysql? ( dev-perl/DBI
+ dev-perl/DBD-mysql )
+ nagios-dns? ( >=net-dns/bind-tools-9.2.2_rc1 )
+ nagios-ntp? ( >=net-misc/ntp-4.1.1a )
+ nagios-ping? ( >=net-analyzer/fping-2.4_beta2-r1 )
+ nagios-ssh? ( >=net-misc/openssh-3.5_p1 )
+ ups? ( >=sys-power/nut-1.4 )
+ !sparc? ( nagios-game? ( >=games-util/qstat-2.6 ) )"
+
+pkg_setup() {
+ enewgroup nagios
+ enewuser nagios -1 /bin/bash /var/nagios/home nagios
+}
+
+src_prepare() {
+ if ! use radius; then
+ EPATCH_OPTS="-p1 -d ${S}" epatch \
+ "${FILESDIR}"/nagios-plugins-1.4.10-noradius.patch
+ fi
+
+ epatch "${FILESDIR}"/${PN}-1.4.10-contrib.patch
+ epatch "${FILESDIR}"/${PN}-1.4.12-pgsqlconfigure.patch
+
+ eautoreconf
+}
+
+src_configure() {
+
+ local conf
+ if use ssl; then
+ conf="${conf} --with-openssl=/usr"
+ else
+ conf="${conf} --without-openssl"
+ fi
+
+ if use postgres; then
+ conf="${conf} --with-pgsql=/usr"
+ fi
+
+ econf \
+ $(use_with mysql) \
+ $(use_with ipv6) \
+ ${conf} \
+ --host=${CHOST} \
+ --prefix=/usr \
+ --libexecdir=/usr/$(get_libdir)/nagios/plugins \
+ --sysconfdir=/etc/nagios || die "econf failed"
+
+ # fix problem with additional -
+ sed -i -e 's:/bin/ps -axwo:/bin/ps axwo:g' config.h || die "sed failed"
+}
+
+src_install() {
+ mv "${S}"/contrib/check_compaq_insight.pl "${S}"/contrib/check_compaq_insight.pl.msg
+ chmod +x "${S}"/contrib/*.pl
+
+ sed -i -e '1s;#!.*;#!/usr/bin/perl -w;' "${S}"/contrib/*.pl || die "sed failed"
+ sed -i -e s#/usr/nagios/libexec#/usr/$(get_libdir)/nagios/plugins#g "${S}"/contrib/*.pl || die "sed failed"
+ sed -i -e '30s/use lib utils.pm;/use utils;/' \
+ "${S}"/plugins-scripts/check_file_age.pl || die "sed failed"
+
+ dodoc ACKNOWLEDGEMENTS AUTHORS BUGS CODING \
+ ChangeLog FAQ NEWS README REQUIREMENTS SUPPORT THANKS
+
+ emake DESTDIR="${D}" install || die "make install failed"
+
+ if use mysql || use postgres; then
+ dodir /usr/$(get_libdir)/nagios/plugins
+ exeinto /usr/$(get_libdir)/nagios/plugins
+ doexe "${S}"/contrib/check_nagios_db.pl
+ fi
+
+ if ! use snmp; then
+ rm "${D}"/usr/$(get_libdir)/nagios/plugins/check_if{operstatus,status} \
+ || die "Failed to remove SNMP check plugins"
+ fi
+
+ mv "${S}"/contrib "${D}"/usr/$(get_libdir)/nagios/plugins/contrib
+
+ chown -R root:nagios "${D}"/usr/$(get_libdir)/nagios/plugins \
+ || die "Failed chown of ${D}usr/$(get_libdir)/nagios/plugins"
+
+ chmod -R o-rwx "${D}"/usr/$(get_libdir)/nagios/plugins \
+ || die "Failed chmod of ${D}usr/$(get_libdir)/nagios/plugins"
+
+ if use suid ; then
+
+ chmod 04710 "${D}"/usr/$(get_libdir)/nagios/plugins/{check_icmp,check_ide_smart,check_dhcp} \
+ || die "Failed setting the suid bit for various plugins"
+ fi
+
+ dosym /usr/$(get_libdir)/nagios/plugins/utils.sh /usr/$(get_libdir)/nagios/plugins/contrib/utils.sh
+ dosym /usr/$(get_libdir)/nagios/plugins/utils.pm /usr/$(get_libdir)/nagios/plugins/contrib/utils.pm
+}
+
+pkg_postinst() {
+ einfo "This ebuild has a number of USE flags which determines what nagios is able to monitor."
+ einfo "Depending on what you want to monitor with nagios, some or all of these USE"
+ einfo "flags need to be set for nagios to function correctly."
+ echo
+ einfo "contrib plugins are installed into /usr/$(get_libdir)/nagios/plugins/contrib"
+}