From 25d39b821bbb4dc6f268882dc62e06cbf5e5de27 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Mon, 2 Jan 2012 14:20:50 +0100 Subject: [PATCH] check_junos: chassis_environment: Check thresholds against temp of components. --- check_junos.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/check_junos.pl b/check_junos.pl index 7201360..cf26acd 100755 --- a/check_junos.pl +++ b/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(