Browse Source

check_junos: Added OK message for the 'system_storage' check.

Sebastian Harl 13 years ago
parent
commit
6676d2b6d8
1 changed files with 7 additions and 0 deletions
  1. 7 0
      check_junos.pl

+ 7 - 0
check_junos.pl

@@ -419,6 +419,8 @@ sub check_system_storage
 
 	my $res = $plugin->send_query('get_system_storage');
 
+	my $all_ok = 1;
+
 	foreach my $re ($plugin->get_query_object($res,
 			'multi-routing-engine-item')) {
 		my $re_name = $plugin->get_query_object_value($re, 're-name');
@@ -437,6 +439,7 @@ sub check_system_storage
 
 			my $state = $plugin->check_threshold($used);
 			if ($state != OK) {
+				$all_ok = 0;
 				$plugin->add_message($state, "$re_name $mnt_pt: "
 					. "$used\% used");
 			}
@@ -450,5 +453,9 @@ sub check_system_storage
 			);
 		}
 	}
+
+	if ($all_ok) {
+		$plugin->add_message(OK, "all filesystems within thresholds");
+	}
 }