Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 433080 - net-analyzer/nagios-plugins: add check_rbl support or ebuild for net-analyzer/nagios-check_rbl
Summary: net-analyzer/nagios-plugins: add check_rbl support or ebuild for net-analyzer...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Sysadmin Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-28 18:03 UTC by Michael Orlitzky
Modified: 2012-12-18 21:50 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Ebuild for net-analyzer/nagios-check_rbl-1.3.0 (nagios-check_rbl-1.3.0.ebuild,882 bytes, text/plain)
2012-08-28 18:03 UTC, Michael Orlitzky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Orlitzky gentoo-dev 2012-08-28 18:03:57 UTC
Created attachment 322462 [details]
Ebuild for net-analyzer/nagios-check_rbl-1.3.0

I'd like to monitor some of our clients for blacklisting so that we can tell when they've been infected with a virus. We'd like to do this *without* blocking their mail submissions, which come encrypted on port 587.

The net-analyzer/nagios-plugins package already comes with a C program, called check_rbl.c that is not compiled. If we could compile this as part of the build (and it works), it would solve my problem.

Another potential solution is to add a new package, net-analyzer/nagios-check_rbl based on,

  https://svn.id.ethz.ch/projects/nagios_plugins/wiki/check_rbl

The latter seems more up-to-date, but obviously requires a new package. I've included an ebuild for it that WORKSFORME.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2012-08-28 20:33:36 UTC
Comment on attachment 322462 [details]
Ebuild for net-analyzer/nagios-check_rbl-1.3.0

--- nagios-3.3.1.ebuild 2011-08-31 00:34:26.000000000 +0200
+++ -   2012-08-28 22:33:27.574132287 +0200
@@ -1,53 +1,36 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/nagios/nagios-3.3.1.ebuild,v 1.5 2011/08/27 17:39:37 armin76 Exp $
+# $Header: $
+
+EAPI=4
 
 inherit multilib

-DESCRIPTION="The Nagios metapackage - merge this to pull install all of the nagios packages"
-HOMEPAGE="http://www.nagios.org"
+DESCRIPTION="check_rbl is a Nagios plugin that fails if a host is blacklisted"
+HOMEPAGE="https://svn.id.ethz.ch/projects/nagios_plugins/wiki/check_rbl"
+
+MY_P="${P/nagios-/}"

+SRC_URI="https://svn.id.ethz.ch/projects/nagios_plugins/downloads/${MY_P}.tar.gz"
 LICENSE="GPL-2"
 SLOT="0"
-KEYWORDS="alpha amd64 ~hppa ppc ppc64 sparc x86"
-IUSE=""

-RDEPEND="~net-analyzer/nagios-core-${PV}
-       >=net-analyzer/nagios-plugins-1.4.13-r1
-       !net-analyzer/nagios-imagepack"
-
-pkg_setup() {
-       # Avoid upgrading from Nagios <3 as the directory structure has changed
-       if has_version '<net-analyzer/nagios-3.0' ; then
-               if [[ "${FORCE_UPGRADE}" ]] ; then
-                       echo
-                       ewarn "you are upgrading from an incompatible version and have"
-                       ewarn "FORCE_UPGRADE set, will build this package while Nagios is running."
-                       echo
-               else
-                       echo
-                       eerror "You are upgrading from an incompatible version."
-                       eerror "Please be advised that installation paths have changed to a more FHS"
-                       eerror "compliant structure and you won't be able to easily upgrade to"
-                       eerror "Nagios 3 therefore. You will have to change your configuration"
-                       eerror "to reflect this change, for example Nagios plugins are now installed"
-                       eerror "into /usr/$(get_libdir)/nagios/plugins/ instead of /usr/nagios/libexec."
-                       echo
-                       eerror "If you want to upgrade now, emerge nagios with:"
-                       eerror "    FORCE_UPGRADE=1 emerge nagios"
-                       die "Upgrading from an incompatible version!"
-                       echo
-               fi
-       fi
-}
+KEYWORDS="~x86 ~amd64"
+IUSE=""

-pkg_postrm() {
-       elog "Note: this is a META ebuild for ${P}."
-       elog "to remove it completely or before re-emerging"
-       elog "either use 'depclean', or remove/re-emerge these packages:"
-       elog
-       for dep in ${RDEPEND}; do
-               elog "     ${dep}"
-       done
-       echo
+# The Makefile.PL looks for Nagios::Plugin::Getopt and
+# Nagios::Plugin::Threshold, but I believe these are provided by
+# dev-perl/Nagios-Plugins.
+RDEPEND="dev-lang/perl
+       dev-perl/Nagios-Plugin
+       dev-perl/Net-DNS
+       dev-perl/Readonly"
+DEPEND="${RDEPEND}
+       virtual/perl-ExtUtils-MakeMaker"
+
+S="${WORKDIR}/${MY_P}"
+
+src_configure() {
+       local dest="/usr/$(get_libdir)/nagios/plugins"
+       perl Makefile.PL INSTALLSCRIPT="${dest}"
 }
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2012-08-28 21:12:15 UTC
(That's not a patch to any current ebuild.)

I'll check check_rbl.c — is that part of contrib? The only thing don't expect this too soon for me as I'll soon be leaving for Paris and I'll be back at the office by September 12th or so.

I think I'd rather add the Perl version than the C version, tbh.
Comment 3 Michael Orlitzky gentoo-dev 2012-08-28 22:49:53 UTC
(In reply to comment #2)
> (That's not a patch to any current ebuild.)

I probably gave this a bad prefix. I went with "nagios:" because I wasn't sure which package it'd end up affecting.

> I'll check check_rbl.c — is that part of contrib? The only thing don't
> expect this too soon for me as I'll soon be leaving for Paris and I'll be
> back at the office by September 12th or so.
> 
> I think I'd rather add the Perl version than the C version, tbh.

Yep:

  # equery f nagios-plugins | grep check_rbl.c
  /usr/lib64/nagios/plugins/contrib/check_rbl.c

I think the Perl one looks better too.
Comment 4 Michael Orlitzky gentoo-dev 2012-12-18 21:50:17 UTC
Oh, this is fixed in the tree already. Thanks!