From 2614e18db7217e3cf11caddd9e92ac3b557ccc0f Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Mon, 2 Jan 2012 14:15:24 +0100 Subject: [PATCH] check_junos: chassis_environment: Add temp values to perf-data. --- check_junos.pl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/check_junos.pl b/check_junos.pl index 20642af..7201360 100755 --- a/check_junos.pl +++ b/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) {