mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-22 01:18:59 +02:00
Fail gracefully if ipmi-sensors error
This commit is contained in:
parent
16fa2ec329
commit
c286283594
@ -47,8 +47,10 @@ my $pass = get_param("p");
|
|||||||
my $sensor = get_param("s");
|
my $sensor = get_param("s");
|
||||||
my $extraopts = get_param("-");
|
my $extraopts = get_param("-");
|
||||||
|
|
||||||
my $res = `ipmi-sensors -h $host -u $user -p $pass -s $sensor $extraopts --ignore-not-available-sensors --no-header-output --comma-separated-output --output-event-bitmask`;
|
my $cmd = "ipmi-sensors -h $host -u $user -p $pass -s $sensor $extraopts --ignore-not-available-sensors --no-header-output --comma-separated-output --output-event-bitmask";
|
||||||
|
my $res = `$cmd`;
|
||||||
|
|
||||||
|
if (defined $res and "$res" ne "") {
|
||||||
my ($sensor_id, $name, $type, $value, $units, $eventmask) = split(/,/, $res);
|
my ($sensor_id, $name, $type, $value, $units, $eventmask) = split(/,/, $res);
|
||||||
|
|
||||||
#Output the value
|
#Output the value
|
||||||
@ -61,3 +63,6 @@ if ($value eq 'N/A') {
|
|||||||
} else {
|
} else {
|
||||||
print $value;
|
print $value;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
print STDERR "Error processing command: $cmd\n";
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user