Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Aug 2008 13:22:38 +0400 (MSD)
From:      Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/126711: New port: net-mgmt/nagios-geom
Message-ID:  <20080821092238.2CC741AF41C@void.codelabs.ru>
Resent-Message-ID: <200808210930.m7L9U4i3091215@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         126711
>Category:       ports
>Synopsis:       New port: net-mgmt/nagios-geom
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 21 09:30:04 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Eygene Ryabinkin
>Release:        FreeBSD 7.0-STABLE i386
>Organization:
Code Labs
>Environment:

System: FreeBSD XXX 7.0-STABLE FreeBSD 7.0-STABLE #18: Wed Aug 13 11:50:11 MSD 2008 root@XXX:/usr/obj/usr/src/sys/XXX i386

>Description:

Nagios plugin to monitor status of geom(8) devices.

>How-To-Repeat:

$ cut -f 1 -d '|' /usr/ports/INDEX-7 | grep geom
tclgeomap-2.11.4
tkgeomap-2.11.4
geomorph-0.40_1
geomview-1.8.1_3
geomgui-0.12_1

>Fix:

--- nagios-geom.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	nagios-geom
#	nagios-geom/Makefile
#	nagios-geom/distinfo
#	nagios-geom/pkg-plist
#	nagios-geom/pkg-descr
#	nagios-geom/files
#	nagios-geom/files/patch-check_geom
#
echo c - nagios-geom
mkdir -p nagios-geom > /dev/null 2>&1
echo x - nagios-geom/Makefile
sed 's/^X//' >nagios-geom/Makefile << 'fe5de4edbd13fef03a104e6dffd94f5d'
X# New ports collection makefile for:	nagios-geom
X# Date created:				20 August 2008
X# Whom:					rea-fbsd@codelabs.ru
X#
X# $FreeBSD$
X#
X
XPORTNAME=	geom
XPORTVERSION=	1.0
XCATEGORIES=	net-mgmt
XMASTER_SITES=	http://www.geocities.com/ntb4real/proj/
XPKGNAMEPREFIX=	nagios-
XDISTNAME=	check_geom
X
XMAINTAINER=	rea-fbsd@codelabs.ru
XCOMMENT=	Nagios plug-in to get geom(8) components status
X
XUSE_PERL5=	yes
XNO_WRKSUBDIR=	yes
XNO_BUILD=	yes
X
Xdo-install:
X	@${TEST} -d ${PREFIX}/libexec/nagios || \
X	    ${INSTALL} -d ${PREFIX}/libexec/nagios
X	${INSTALL_SCRIPT} ${WRKSRC}/check_geom ${PREFIX}/libexec/nagios
X
X.include <bsd.port.mk>
fe5de4edbd13fef03a104e6dffd94f5d
echo x - nagios-geom/distinfo
sed 's/^X//' >nagios-geom/distinfo << '260a672e0dd622a204d230df706116ed'
XSIZE (check_geom.tar.gz) = 1545
XMD5 (check_geom.tar.gz) = ec6aa5d69b0693a71cf0129016507d0f
XSHA256 (check_geom.tar.gz) = ba787de1ac1df400151f8bde5b3db15af4ca2f3a3e8ec4f48c30052091f30444
260a672e0dd622a204d230df706116ed
echo x - nagios-geom/pkg-plist
sed 's/^X//' >nagios-geom/pkg-plist << 'f5a4e272d0c02ace6261041c2c6ce97a'
Xlibexec/nagios/check_geom
X@dirrmtry libexec/nagios
f5a4e272d0c02ace6261041c2c6ce97a
echo x - nagios-geom/pkg-descr
sed 's/^X//' >nagios-geom/pkg-descr << '43f9ae7db6cf54cc4fc0ca7a8e12d455'
XThis is a small Nagios plugin written in PERL and designed to monitor
Xthe state of FreeBSD GEOM devices (specifically mirrors and striped
Xvolumes) from Nagios.
X
XWWW: http://www.geocities.com/ntb4real/proj/geom.htm
43f9ae7db6cf54cc4fc0ca7a8e12d455
echo c - nagios-geom/files
mkdir -p nagios-geom/files > /dev/null 2>&1
echo x - nagios-geom/files/patch-check_geom
sed 's/^X//' >nagios-geom/files/patch-check_geom << 'f1610e79461a0715d9aaea5fe749a93c'
X--- check_geom.orig	2007-07-03 15:55:27.000000000 +0400
X+++ check_geom	2008-08-20 15:30:57.000000000 +0400
X@@ -33,6 +33,7 @@
X my %ERRORS=('DEPENDENT'=>4,'UNKNOWN'=>3,'OK'=>0,'WARNING'=>1,'CRITICAL'=>2);
X my $state="UNKNOWN";
X my $msg="FAILURE";
X+my $perfdata="";
X 
X if ($#ARGV < 1) {
X 	print "Not enough arguments!\nUsage: $0 <class> <device>\n";
X@@ -63,7 +64,7 @@
X 
X 	chomp;
X 	if ($found) {
X-		if (/^$class\//) {
X+		if (/^\s*$class\//) {
X 			last;
X 		} else {
X 			my ($vgh) = /\s+(.*)/;
X@@ -72,7 +73,7 @@
X 		}
X 	}
X 
X-	if (/$class\/$volume/) {
X+	if (/^\s*$class\/$volume/) {
X 		($name, $status, $compo) = /(\S+)\s+(\S+)\s+(.*)$/;
X 		$found=1;
X 	}
X@@ -127,6 +128,7 @@
X }
X 
X #goats away!
X-$msg = sprintf "%s/%s %s { %s }\n", $class, $volume, $status, $compo;
X-print $state, " ", $msg;
X+$msg = sprintf "%s/%s %s { %s }", $class, $volume, $status, $compo;
X+$perfdata = sprintf "%s=%d;;;0;", "geom_" . $class, $found;
X+print $state, " ", $msg, "|", $perfdata, "\n";
X exit ($ERRORS{$state});
f1610e79461a0715d9aaea5fe749a93c
exit
--- nagios-geom.shar ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080821092238.2CC741AF41C>