diff options
-rw-r--r-- | net-mgmt/Makefile | 1 | ||||
-rw-r--r-- | net-mgmt/nagios-geom/Makefile | 26 | ||||
-rw-r--r-- | net-mgmt/nagios-geom/distinfo | 3 | ||||
-rw-r--r-- | net-mgmt/nagios-geom/files/patch-check_geom | 38 | ||||
-rw-r--r-- | net-mgmt/nagios-geom/pkg-descr | 5 | ||||
-rw-r--r-- | net-mgmt/nagios-geom/pkg-plist | 2 |
6 files changed, 75 insertions, 0 deletions
diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index 0763b4429db4..c4f4bcda4bab 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -108,6 +108,7 @@ SUBDIR += nagios-check_bacula SUBDIR += nagios-check_ports SUBDIR += nagios-devel + SUBDIR += nagios-geom SUBDIR += nagios-pf-plugin SUBDIR += nagios-plugins SUBDIR += nagios-radauth-plugin diff --git a/net-mgmt/nagios-geom/Makefile b/net-mgmt/nagios-geom/Makefile new file mode 100644 index 000000000000..92e6795790a7 --- /dev/null +++ b/net-mgmt/nagios-geom/Makefile @@ -0,0 +1,26 @@ +# New ports collection makefile for: nagios-geom +# Date created: 20 August 2008 +# Whom: rea-fbsd@codelabs.ru +# +# $FreeBSD$ +# + +PORTNAME= geom +PORTVERSION= 1.0 +CATEGORIES= net-mgmt +MASTER_SITES= http://www.geocities.com/ntb4real/proj/ +PKGNAMEPREFIX= nagios- +DISTNAME= check_geom + +MAINTAINER= rea-fbsd@codelabs.ru +COMMENT= Nagios plug-in to get geom(8) components status + +USE_PERL5= yes +NO_WRKSUBDIR= yes +NO_BUILD= yes + +do-install: + @${MKDIR} ${PREFIX}/libexec/nagios + ${INSTALL_SCRIPT} ${WRKSRC}/check_geom ${PREFIX}/libexec/nagios + +.include <bsd.port.mk> diff --git a/net-mgmt/nagios-geom/distinfo b/net-mgmt/nagios-geom/distinfo new file mode 100644 index 000000000000..e78bca18c650 --- /dev/null +++ b/net-mgmt/nagios-geom/distinfo @@ -0,0 +1,3 @@ +SIZE (check_geom.tar.gz) = 1545 +MD5 (check_geom.tar.gz) = ec6aa5d69b0693a71cf0129016507d0f +SHA256 (check_geom.tar.gz) = ba787de1ac1df400151f8bde5b3db15af4ca2f3a3e8ec4f48c30052091f30444 diff --git a/net-mgmt/nagios-geom/files/patch-check_geom b/net-mgmt/nagios-geom/files/patch-check_geom new file mode 100644 index 000000000000..39d54aaa129b --- /dev/null +++ b/net-mgmt/nagios-geom/files/patch-check_geom @@ -0,0 +1,38 @@ +--- check_geom.orig 2007-07-03 15:55:27.000000000 +0400 ++++ check_geom 2008-08-20 15:30:57.000000000 +0400 +@@ -33,6 +33,7 @@ + my %ERRORS=('DEPENDENT'=>4,'UNKNOWN'=>3,'OK'=>0,'WARNING'=>1,'CRITICAL'=>2); + my $state="UNKNOWN"; + my $msg="FAILURE"; ++my $perfdata=""; + + if ($#ARGV < 1) { + print "Not enough arguments!\nUsage: $0 <class> <device>\n"; +@@ -63,7 +64,7 @@ + + chomp; + if ($found) { +- if (/^$class\//) { ++ if (/^\s*$class\//) { + last; + } else { + my ($vgh) = /\s+(.*)/; +@@ -72,7 +73,7 @@ + } + } + +- if (/$class\/$volume/) { ++ if (/^\s*$class\/$volume/) { + ($name, $status, $compo) = /(\S+)\s+(\S+)\s+(.*)$/; + $found=1; + } +@@ -127,6 +128,7 @@ + } + + #goats away! +-$msg = sprintf "%s/%s %s { %s }\n", $class, $volume, $status, $compo; +-print $state, " ", $msg; ++$msg = sprintf "%s/%s %s { %s }", $class, $volume, $status, $compo; ++$perfdata = sprintf "%s=%d;;;0;", "geom_" . $class, $found; ++print $state, " ", $msg, "|", $perfdata, "\n"; + exit ($ERRORS{$state}); diff --git a/net-mgmt/nagios-geom/pkg-descr b/net-mgmt/nagios-geom/pkg-descr new file mode 100644 index 000000000000..359b9cb3508f --- /dev/null +++ b/net-mgmt/nagios-geom/pkg-descr @@ -0,0 +1,5 @@ +This is a small Nagios plugin written in PERL and designed to monitor +the state of FreeBSD GEOM devices (specifically mirrors and striped +volumes) from Nagios. + +WWW: http://www.geocities.com/ntb4real/proj/geom.htm diff --git a/net-mgmt/nagios-geom/pkg-plist b/net-mgmt/nagios-geom/pkg-plist new file mode 100644 index 000000000000..674fbba4de2c --- /dev/null +++ b/net-mgmt/nagios-geom/pkg-plist @@ -0,0 +1,2 @@ +libexec/nagios/check_geom +@dirrmtry libexec/nagios |