parent
15fedef013
commit
8e34ef8d10
|
@ -40,6 +40,7 @@ sub check {
|
|||
|
||||
foreach my $array (@{$self->{results}->{shelve}->{data}}) {
|
||||
my $array_name = $array->{array_name};
|
||||
$array_name .= ':' . $array->{serial} if ($self->use_serial());
|
||||
|
||||
foreach my $ctrl (@{$array->{ctrlrs}}) {
|
||||
foreach my $sensor (@{$ctrl->{ctrlr_sensors}}) {
|
||||
|
|
|
@ -40,6 +40,7 @@ sub check {
|
|||
|
||||
foreach my $array (@{$self->{results}->{shelve}->{data}}) {
|
||||
my $array_name = $array->{array_name};
|
||||
$array_name .= ':' . $array->{serial} if ($self->use_serial());
|
||||
|
||||
foreach my $sensor (@{$array->{chassis_sensors}}) {
|
||||
next if ($sensor->{type} ne 'power supply');
|
||||
|
|
|
@ -40,6 +40,7 @@ sub check {
|
|||
|
||||
foreach my $array (@{$self->{results}->{shelve}->{data}}) {
|
||||
my $array_name = $array->{array_name};
|
||||
$array_name .= ':' . $array->{serial} if ($self->use_serial());
|
||||
|
||||
foreach my $ctrl (@{$array->{ctrlrs}}) {
|
||||
foreach my $sensor (@{$ctrl->{ctrlr_sensors}}) {
|
||||
|
|
|
@ -73,6 +73,24 @@ sub new {
|
|||
return $self;
|
||||
}
|
||||
|
||||
sub use_serial {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
return $self->{use_serial} if (defined($self->{use_serial}));
|
||||
|
||||
$self->{use_serial} = 0;
|
||||
my $array_names = {};
|
||||
foreach (@{$self->{results}->{shelve}->{data}}) {
|
||||
if (defined($array_names->{ $_->{array_name} })) {
|
||||
$self->{use_serial} = 1;
|
||||
last;
|
||||
}
|
||||
$array_names->{ $_->{array_name} } = 1;
|
||||
}
|
||||
|
||||
return $self->{use_serial};
|
||||
}
|
||||
|
||||
sub execute_custom {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
|
|
Loading…
Reference in New Issue