aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/nagios-portaudit
diff options
context:
space:
mode:
authorPhilip M. Gollucci <pgollucci@FreeBSD.org>2008-08-22 16:44:18 +0000
committerPhilip M. Gollucci <pgollucci@FreeBSD.org>2008-08-22 16:44:18 +0000
commitf67a2705e6754a923ef78fe797be386555bc1240 (patch)
tree1393135e93443e74c85a4119871fa1579597e2d4 /net-mgmt/nagios-portaudit
parent1a24ed133681ff26a7e4bce681864beaaf28f931 (diff)
downloadports-f67a2705e6754a923ef78fe797be386555bc1240.tar.gz
ports-f67a2705e6754a923ef78fe797be386555bc1240.zip
Notes
Diffstat (limited to 'net-mgmt/nagios-portaudit')
-rw-r--r--net-mgmt/nagios-portaudit/Makefile52
-rw-r--r--net-mgmt/nagios-portaudit/distinfo3
-rw-r--r--net-mgmt/nagios-portaudit/files/patch-check_portaudit-add_perfdata20
-rw-r--r--net-mgmt/nagios-portaudit/pkg-descr10
-rw-r--r--net-mgmt/nagios-portaudit/pkg-plist2
5 files changed, 87 insertions, 0 deletions
diff --git a/net-mgmt/nagios-portaudit/Makefile b/net-mgmt/nagios-portaudit/Makefile
new file mode 100644
index 000000000000..b20475a4ea91
--- /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 000000000000..ef7d832ddaf5
--- /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 000000000000..d9442f2ad33a
--- /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 000000000000..7e77401b8305
--- /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 000000000000..4253959297eb
--- /dev/null
+++ b/net-mgmt/nagios-portaudit/pkg-plist
@@ -0,0 +1,2 @@
+libexec/nagios/check_portaudit
+@dirrmtry libexec/nagios