Browse Source

check_junos: chassis_environment: Check thresholds against temp of components.

Sebastian Harl 13 years ago
parent
commit
25d39b821b
1 changed files with 8 additions and 1 deletions
  1. 8 1
      check_junos.pl

+ 8 - 1
check_junos.pl

@@ -83,7 +83,8 @@ The following checks are available:
     be checked as well.
 
   * chassis_environment: Check the status of verious system components
-    (as provided by 'show chassis environment').
+    (as provided by 'show chassis environment'). If specified, the thresholds
+    will be checked against the temperature of the components.
 
 Warning and critical thresholds may be specified in the format documented at
 http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT.",
@@ -342,6 +343,12 @@ foreach my $check (@{$conf{'checks'}}) {
 				next;
 			}
 
+			$state = $plugin->check_threshold($temp);
+			if ($state != OK) {
+				$plugin->add_message($state, $class
+					. " $name: ${temp} degrees C");
+			}
+
 			my $label = "$name-temp";
 			$label =~ s/ /_/g;
 			$plugin->add_perfdata(