Browse Source

check_junos: chassis_environment: Add temp values to perf-data.

Sebastian Harl 13 years ago
parent
commit
2614e18db7
1 changed files with 21 additions and 0 deletions
  1. 21 0
      check_junos.pl

+ 21 - 0
check_junos.pl

@@ -331,6 +331,27 @@ foreach my $check (@{$conf{'checks'}}) {
 				$plugin->add_message($state, $class . " $name: status " .
 					$status);
 			}
+
+			my $temp = get_object_value_by_spec($item, 'temperature');
+			if (! $temp) {
+				next;
+			}
+
+			($temp) = $temp =~ m/(\d+) degrees C/;
+			if (! defined($temp)) {
+				next;
+			}
+
+			my $label = "$name-temp";
+			$label =~ s/ /_/g;
+			$plugin->add_perfdata(
+				label     => "'$label'",
+				value     => $temp,
+				min       => undef,
+				max       => undef,
+				uom       => '',
+				threshold => undef,
+			);
 		}
 
 		if (! $items_count) {