|
|
@ -259,14 +259,15 @@ if ($upsc && -x $upsc){ |
|
|
|
next if ($? != 0); |
|
|
|
next if ($? != 0); |
|
|
|
foreach my $l (@lines){ |
|
|
|
foreach my $l (@lines){ |
|
|
|
if ($l =~ m/^ups\.temperature:\s+(\d+(\.\d+)?)/){ |
|
|
|
if ($l =~ m/^ups\.temperature:\s+(\d+(\.\d+)?)/){ |
|
|
|
my $sensor = { |
|
|
|
$sensors->{'ups_' . lc $ups} = { |
|
|
|
description => "ups temperature", |
|
|
|
description => "ups temperature for $ups", |
|
|
|
type => 'temp', |
|
|
|
type => 'temp', |
|
|
|
threshold_high => $def_temp_thres_high, |
|
|
|
threshold_high => $def_temp_thres_high, |
|
|
|
threshold_low => $def_temp_thres_high-$temp_ups_hyst, |
|
|
|
threshold_low => $def_temp_thres_high-$temp_ups_hyst, |
|
|
|
unit => '°C', |
|
|
|
unit => '°C', |
|
|
|
cmd => "$upsc $ups ups.temperature" |
|
|
|
cmd => "$upsc $ups ups.temperature" |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
print "Foudn a temperature sensor for ups $ups"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|