mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-28 08:04:36 +02:00
Fix #5389
This commit is contained in:
parent
991f56a36c
commit
d88789c78e
@ -89,10 +89,21 @@ sub manage_selection {
|
|||||||
|
|
||||||
#|/dev/sda|SD280813AS|35|C|#|/dev/sdb|ST2000CD005-1CH134|35|C|
|
#|/dev/sda|SD280813AS|35|C|#|/dev/sdb|ST2000CD005-1CH134|35|C|
|
||||||
|
|
||||||
my $_ = <$oSocketConn>;
|
my $line;
|
||||||
$oSocketConn->shutdown(2);
|
|
||||||
|
|
||||||
while (m/\|([^|]+)\|([^|]+)\|([^|]+)\|(C|F)\|/g) {
|
eval {
|
||||||
|
local $SIG{ALRM} = sub { die "Timeout by signal ALARM\n"; };
|
||||||
|
alarm(10);
|
||||||
|
$line = <$oSocketConn>;
|
||||||
|
alarm(0);
|
||||||
|
};
|
||||||
|
$oSocketConn->shutdown(2);
|
||||||
|
if ($@) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Cannot get informations.");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
while ($line =~ /\|([^|]+)\|([^|]+)\|([^|]+)\|(C|F)\|/g) {
|
||||||
my ($drive, $serial, $temperature, $unit) = ($1, $2, $3, $4);
|
my ($drive, $serial, $temperature, $unit) = ($1, $2, $3, $4);
|
||||||
|
|
||||||
next if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
|
next if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
|
||||||
|
@ -99,10 +99,21 @@ sub manage_selection {
|
|||||||
|
|
||||||
#|/dev/sda|SD280813AS|35|C|#|/dev/sdb|ST2000CD005-1CH134|35|C|
|
#|/dev/sda|SD280813AS|35|C|#|/dev/sdb|ST2000CD005-1CH134|35|C|
|
||||||
|
|
||||||
my $_ = <$oSocketConn>;
|
my $line;
|
||||||
$oSocketConn->shutdown(2);
|
|
||||||
|
|
||||||
while (m/\|([^|]+)\|([^|]+)\|([^|]+)\|(C|F)\|/g) {
|
eval {
|
||||||
|
local $SIG{ALRM} = sub { die "Timeout by signal ALARM\n"; };
|
||||||
|
alarm(10);
|
||||||
|
$line = <$oSocketConn>;
|
||||||
|
alarm(0);
|
||||||
|
};
|
||||||
|
$oSocketConn->shutdown(2);
|
||||||
|
if ($@) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Cannot get informations.");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
while ($line =~ /\|([^|]+)\|([^|]+)\|([^|]+)\|(C|F)\|/g) {
|
||||||
my ($drive, $serial, $temperature, $unit) = ($1, $2, $3, $4);
|
my ($drive, $serial, $temperature, $unit) = ($1, $2, $3, $4);
|
||||||
|
|
||||||
next if (defined($self->{option_results}->{name}) && defined($self->{option_results}->{use_regexp}) && defined($self->{option_results}->{use_regexpi})
|
next if (defined($self->{option_results}->{name}) && defined($self->{option_results}->{use_regexp}) && defined($self->{option_results}->{use_regexpi})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user