diff options
author | pgollucci <pgollucci@FreeBSD.org> | 2008-08-23 00:44:18 +0800 |
---|---|---|
committer | pgollucci <pgollucci@FreeBSD.org> | 2008-08-23 00:44:18 +0800 |
commit | 4f5d6735eae3a7f6f1a35eb339b5ef6ab9b0fd87 (patch) | |
tree | 88d4c2c9bf82d26f9d636d338b1885b7ea065a8f /net-mgmt | |
parent | 56b3869883cc7be0a486543a8a7937f6d2423836 (diff) | |
download | freebsd-ports-graphics-4f5d6735eae3a7f6f1a35eb339b5ef6ab9b0fd87.tar.gz freebsd-ports-graphics-4f5d6735eae3a7f6f1a35eb339b5ef6ab9b0fd87.tar.zst freebsd-ports-graphics-4f5d6735eae3a7f6f1a35eb339b5ef6ab9b0fd87.zip |
This is a small Nagios plugin. This plugin relies on portaudit
and/or portupgrade packages to be installed on your FreeBSD system.
With these packages installed, the plugin will scan your system for
either vulnerable packages, or obsolete packages - and display
appropriate warnings to Nagios.
Portaudit can also be successfully run remotely from nrpe, and does
not require superuser privileges to operate.
WWW: http://www.geocities.com/ntb4real/proj/portaudit.htm
PR: ports/126710
Submitted by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Approved by: gabor (mentor)
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/Makefile | 1 | ||||
-rw-r--r-- | net-mgmt/nagios-portaudit/Makefile | 52 | ||||
-rw-r--r-- | net-mgmt/nagios-portaudit/distinfo | 3 | ||||
-rw-r--r-- | net-mgmt/nagios-portaudit/files/patch-check_portaudit-add_perfdata | 20 | ||||
-rw-r--r-- | net-mgmt/nagios-portaudit/pkg-descr | 10 | ||||
-rw-r--r-- | net-mgmt/nagios-portaudit/pkg-plist | 2 |
6 files changed, 88 insertions, 0 deletions
diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index c4f4bcda4ba..ca289246e61 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -111,6 +111,7 @@ SUBDIR += nagios-geom SUBDIR += nagios-pf-plugin SUBDIR += nagios-plugins + SUBDIR += nagios-portaudit SUBDIR += nagios-radauth-plugin SUBDIR += nagios-silfreed-plugins SUBDIR += nagios-snmp-plugins diff --git a/net-mgmt/nagios-portaudit/Makefile b/net-mgmt/nagios-portaudit/Makefile new file mode 100644 index 00000000000..b20475a4ea9 --- /dev/null +++ b/net-mgmt/nagios-portaudit/Makefile @@ -0,0 +1,52 @@ +# New ports collection makefile for: nagios-portaudit +# Date created: 19 August 2008 +# Whom: rea-fbsd@codelabs.ru +# +# $FreeBSD$ +# + +PORTNAME= portaudit +PORTVERSION= 1.0 +CATEGORIES= net-mgmt +MASTER_SITES= http://www.geocities.com/ntb4real/proj/ +PKGNAMEPREFIX= nagios- +DISTNAME= check_portaudit + +MAINTAINER= rea-fbsd@codelabs.ru +COMMENT= Nagios plug-in to get portaudit/portupgrade status + +OPTIONS= PORTAUDIT "Enable portaudit check" ON \ + PORTUPGRADE "Enable portupgrade check" ON \ + PORTUPGRADE_DEVEL "Use portupgrade-devel" OFF + +USE_PERL5= yes +NO_WRKSUBDIR= yes +NO_BUILD= yes + +.include <bsd.port.pre.mk> + +.if !defined(WITH_PORTUPGRADE) && !defined(WITH_PORTAUDIT) && !defined(WITH_PORTAUDIT_DEVEL) +IGNORE= unusable without portupgrade and portaudit +.endif + +.if defined(WITH_PORTUPGRADE) && defined(WITH_PORTUPGRADE_DEVEL) +IGNORE= choose either portupgrade or portupgrade-devel, not both +.endif + +.if defined(WITH_PORTAUDIT) +RUN_DEPENDS+= portaudit:${PORTSDIR}/ports-mgmt/portaudit +.endif + +.if defined(WITH_PORTUPGRADE) +RUN_DEPENDS+= portupgrade:${PORTSDIR}/ports-mgmt/portupgrade +.endif + +.if defined(WITH_PORTUPGRADE_DEVEL) +RUN_DEPENDS+= portupgrade:${PORTSDIR}/ports-mgmt/portupgrade-devel +.endif + +do-install: + @${MKDIR} ${PREFIX}/libexec/nagios + ${INSTALL_SCRIPT} ${WRKSRC}/check_portaudit ${PREFIX}/libexec/nagios + +.include <bsd.port.post.mk> diff --git a/net-mgmt/nagios-portaudit/distinfo b/net-mgmt/nagios-portaudit/distinfo new file mode 100644 index 00000000000..ef7d832ddaf --- /dev/null +++ b/net-mgmt/nagios-portaudit/distinfo @@ -0,0 +1,3 @@ +SIZE (check_portaudit.tar.gz) = 2483 +MD5 (check_portaudit.tar.gz) = 4080abff3089dbce2f1b1080705b8b6f +SHA256 (check_portaudit.tar.gz) = d23d67f0be5d535cce35e3ff7cd4bb00277ec5821982b6843fbcbc573bcffec7 diff --git a/net-mgmt/nagios-portaudit/files/patch-check_portaudit-add_perfdata b/net-mgmt/nagios-portaudit/files/patch-check_portaudit-add_perfdata new file mode 100644 index 00000000000..d9442f2ad33 --- /dev/null +++ b/net-mgmt/nagios-portaudit/files/patch-check_portaudit-add_perfdata @@ -0,0 +1,20 @@ +--- check_portaudit.orig 2007-06-07 11:54:21.000000000 +0400 ++++ check_portaudit 2008-08-19 21:23:03.000000000 +0400 +@@ -56,6 +56,7 @@ + my %ERRORS=('DEPENDENT'=>4,'UNKNOWN'=>3,'OK'=>0,'WARNING'=>1,'CRITICAL'=>2); + my $state="UNKNOWN"; + my $msg="FAILURE"; ++my $perfdata=""; + + #################LOCATION OF IMPORTANT FILES####################### + my $portauditloc="/usr/local/sbin/portaudit"; +@@ -192,6 +193,7 @@ + } + + ### take this message to Nagios +-$msg = sprintf "%s : %s %s %s\n", $command, $packcount, $pkgtype, $msglist; +-print $state, " ", $msg; ++$msg = sprintf "%s : %s %s %s", $command, $packcount, $pkgtype, $msglist; ++$perfdata = sprintf "%s=%d;1;;0;", $pkgtype, $packcount; ++print $state, " ", $msg, "|", $perfdata,"\n"; + exit ($ERRORS{$state}); diff --git a/net-mgmt/nagios-portaudit/pkg-descr b/net-mgmt/nagios-portaudit/pkg-descr new file mode 100644 index 00000000000..7e77401b830 --- /dev/null +++ b/net-mgmt/nagios-portaudit/pkg-descr @@ -0,0 +1,10 @@ +This is a small Nagios plugin. This plugin relies on portaudit +and/or portupgrade packages to be installed on your FreeBSD system. +With these packages installed, the plugin will scan your system for +either vulnerable packages, or obsolete packages - and display +appropriate warnings to Nagios. + +Portaudit can also be successfully run remotely from nrpe, and does +not require superuser privileges to operate. + +WWW: http://www.geocities.com/ntb4real/proj/portaudit.htm diff --git a/net-mgmt/nagios-portaudit/pkg-plist b/net-mgmt/nagios-portaudit/pkg-plist new file mode 100644 index 00000000000..4253959297e --- /dev/null +++ b/net-mgmt/nagios-portaudit/pkg-plist @@ -0,0 +1,2 @@ +libexec/nagios/check_portaudit +@dirrmtry libexec/nagios |