From 35366f0905dcce164d7b287d34e8a48ec448a0ba Mon Sep 17 00:00:00 2001 From: qgarnier Date: Wed, 29 Mar 2023 11:44:17 +0200 Subject: [PATCH] (plugin) storage::netapp::ontap::restapi - mode hardware missing disk state (#4298) --- src/storage/netapp/ontap/restapi/mode/components/disk.pm | 3 +++ src/storage/netapp/ontap/restapi/mode/hardware.pm | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/storage/netapp/ontap/restapi/mode/components/disk.pm b/src/storage/netapp/ontap/restapi/mode/components/disk.pm index 3e25c575a..dcaa6481a 100644 --- a/src/storage/netapp/ontap/restapi/mode/components/disk.pm +++ b/src/storage/netapp/ontap/restapi/mode/components/disk.pm @@ -39,6 +39,9 @@ sub check { foreach my $disk (@{$disks->{records}}) { next if ($self->check_filter(section => 'disk', instance => $disk->{name})); + # state can be missing + $disk->{state} = defined($disk->{state}) ? $disk->{state} : 'n/a'; + $self->{components}->{disk}->{total}++; $self->{output}->output_add( long_msg => sprintf( diff --git a/src/storage/netapp/ontap/restapi/mode/hardware.pm b/src/storage/netapp/ontap/restapi/mode/hardware.pm index 1ee7589e0..b0ef1d260 100644 --- a/src/storage/netapp/ontap/restapi/mode/hardware.pm +++ b/src/storage/netapp/ontap/restapi/mode/hardware.pm @@ -46,7 +46,8 @@ sub set_system { ['removed', 'OK'], ['spare', 'OK'], ['unfail', 'OK'], - ['zeroing', 'OK'] + ['zeroing', 'OK'], + ['n/a', 'OK'] ] };