aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/nagios-geom/files/patch-check_geom
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/nagios-geom/files/patch-check_geom')
-rw-r--r--net-mgmt/nagios-geom/files/patch-check_geom38
1 files changed, 38 insertions, 0 deletions
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});