mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-20 08:27:15 +00:00
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 PR: ports/126711 Submitted by: Eygene Ryabinkin <rea-fbsd@codelabs.ru> Approved by: gabor (mentor)
This commit is contained in:
parent
09ece96a0f
commit
1a24ed1336
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=218998
@ -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
|
||||
|
26
net-mgmt/nagios-geom/Makefile
Normal file
26
net-mgmt/nagios-geom/Makefile
Normal file
@ -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>
|
3
net-mgmt/nagios-geom/distinfo
Normal file
3
net-mgmt/nagios-geom/distinfo
Normal file
@ -0,0 +1,3 @@
|
||||
SIZE (check_geom.tar.gz) = 1545
|
||||
MD5 (check_geom.tar.gz) = ec6aa5d69b0693a71cf0129016507d0f
|
||||
SHA256 (check_geom.tar.gz) = ba787de1ac1df400151f8bde5b3db15af4ca2f3a3e8ec4f48c30052091f30444
|
38
net-mgmt/nagios-geom/files/patch-check_geom
Normal file
38
net-mgmt/nagios-geom/files/patch-check_geom
Normal file
@ -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});
|
5
net-mgmt/nagios-geom/pkg-descr
Normal file
5
net-mgmt/nagios-geom/pkg-descr
Normal file
@ -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
|
2
net-mgmt/nagios-geom/pkg-plist
Normal file
2
net-mgmt/nagios-geom/pkg-plist
Normal file
@ -0,0 +1,2 @@
|
||||
libexec/nagios/check_geom
|
||||
@dirrmtry libexec/nagios
|
Loading…
Reference in New Issue
Block a user