From a81de8b9f41634702ed6e7bb4fdfe32219fff365 Mon Sep 17 00:00:00 2001 From: Sims24 Date: Thu, 4 Feb 2016 18:23:33 +0100 Subject: [PATCH] + Enhance code portability - fix mistypes #226 --- hardware/sensors/temperhum/local/mode/environment.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hardware/sensors/temperhum/local/mode/environment.pm b/hardware/sensors/temperhum/local/mode/environment.pm index 8147f0d1a..e07e88bf6 100644 --- a/hardware/sensors/temperhum/local/mode/environment.pm +++ b/hardware/sensors/temperhum/local/mode/environment.pm @@ -104,7 +104,7 @@ sub prefix_device_output { sub manage_selection { my ($self, %options) = @_; - $self->{device} = {}; + $self->{drive} = {}; my $stdout = centreon::plugins::misc::execute(output => $self->{output}, options => $self->{option_results}, sudo => $self->{option_results}->{sudo}, @@ -115,8 +115,8 @@ sub manage_selection { foreach (split(/\n/, $stdout)) { next if !/(\/dev\/[a-z0-9]+).*temperature\s(\d*\.?\d+).*relative\shumidity\s(\d*\.?\d+).*dew\spoint\s(\d*\.?\d+)/; my ($drive, $temp, $hum, $dew) = ($1, $2, $3, $4); - next if $drive !~ /$self->{option_results}->{filter_drive}/; - $self->{drive}{$drive} = { humidity => $hum, temperature => $temp, dewpoint => $dew, delta => ($temp - $dew), display => $drive }; + next if ($drive !~ /$self->{option_results}->{filter_drive}/); + $self->{drive}->{$drive} = { humidity => $hum, temperature => $temp, dewpoint => $dew, delta => ($temp - $dew), display => $drive }; } if (scalar(keys %{$self->{drive}}) <= 0) {