Update Nagios check to work with ctdb versions past 30 Aug 2011
authorMathieu Parent <math.parent@gmail.com>
Fri, 7 Jun 2013 17:01:06 +0000 (19:01 +0200)
committerAmitay Isaacs <amitay@gmail.com>
Thu, 11 Jul 2013 05:18:06 +0000 (15:18 +1000)
Because of commit a779d83a6213e2ba

Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit a4afe7af9c9391048d6f80135bbd5e15367770c7)

ctdb/utils/nagios/check_ctdb

index 943033378c1c46b863cfbb88f2142d8457113539..cc0c222ffefe19b0d89c2e23afe02d474e6d4912 100644 (file)
@@ -178,7 +178,11 @@ if ($info eq "scriptstatus") {
             next if $. == 1; # Header
             $script_count++;
             chop;
-            my ($type, $name, $code, $status, $start, $end, @error) = split(":");
+            my ($col0, $type, $name, $code, $status, $start, $end, @error) = split(":");
+            if ($col0 ne '') {
+              # Old version, before 30 Aug 2011 and commit a779d83a6213
+              ($type, $name, $code, $status, $start, $end, @error) = ($col0, $type, $name, $code, $status, $start, $end, @error);
+            }
             my $error = join(':', @error);
             if ($error ne "") {
                 $output = "$output ;; " if $output;