added a warning if amanda is busy
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Tue, 28 Jan 2014 11:21:36 +0100
changeset 28 55ace296247b
parent 27 4f11b6ecea2c
child 29 a4e7a16b70dd
added a warning if amanda is busy It can happen that the amanda server is busy and can't answer the client requests for checking. We will consider this an an event being worth to warn about. It should go away after some more checks.
debian/control
plugins/check_amanda-client
--- a/debian/control	Sat Jan 25 23:50:20 2014 +0100
+++ b/debian/control	Tue Jan 28 11:21:36 2014 +0100
@@ -1,5 +1,6 @@
 Source: nagios-plugin-amanda-client
 Maintainer: Heiko Schlittermann <hs@schlittermann.de>
+Build-Depends: libtest-exception-perl
 
 Package: nagios-plugin-amanda-client
 Section: misc
--- a/plugins/check_amanda-client	Sat Jan 25 23:50:20 2014 +0100
+++ b/plugins/check_amanda-client	Tue Jan 28 11:21:36 2014 +0100
@@ -74,11 +74,8 @@
 
     eval { amchecks @confs } or CRITICAL $@;
 
-    my @dles = eval {
-        compare_lists
-          confs   => \@confs,
-          exclude => \@opt_exclude,
-    }
+    my @dles =
+      eval { compare_lists confs => \@confs, exclude => \@opt_exclude, }
       or CRITICAL $@;
     OK 'config: ' . join(', ', @confs), @dles;
 
@@ -183,13 +180,18 @@
 
     my $conf = shift;
     my $_    = qx(amdump_client --config '$conf' check 2>&1);
+
+    /^config:\s+
+      (BUSY Amanda is busy, retry later)/smx
+      and WARNING "$1\n";
+
     /^config:\s+$conf\n
 		 CHECKING\n
 		 .*\n
 		 Client.check:.1.host.checked.in.\d+\.\d+.seconds\.\s+0.problems.found\.\n
 		 .*\n
 		 The.check.is.finished$
-	/smx or die "unexpected output from check:\n$_";
+	/smx or UNKNOWN "unexpected output from check:\n$_";
 }
 
 sub amchecks {