diff --git a/zabbix_scripts/check_stor_dev_sudo b/zabbix_scripts/check_stor_dev_sudo index 8cd4148..138fa04 100644 --- a/zabbix_scripts/check_stor_dev_sudo +++ b/zabbix_scripts/check_stor_dev_sudo @@ -98,6 +98,9 @@ if ($pending = get_smart_attr($data, 'Current_Pending_Sector')){ if ($realloc = get_smart_attr($data, 'Reallocated_Sector_Ct') || get_smart_attr($data, 'Reallocated_Event_Count')){ $json->{reallocated_sector_count} = $realloc->{raw}->{value}; +} elsif (defined $data->{nvme_smart_health_information_log}->{media_errors}){ + # NMVe can report media error, so report it as reallocated sectors + $json->{reallocated_sector_count} = $data->{nvme_smart_health_information_log}->{media_errors}; } if ($offline = get_smart_attr($data, 'Offline_Uncorrectable')){ @@ -108,5 +111,8 @@ if ($remain = get_smart_attr($data, 'Percent_Lifetime_Remain')){ $json->{percent_lifetime_remain} = $remain->{value}; } elsif ($remain = get_smart_attr($data, 'Wear_Leveling_Count')) { $json->{percent_lifetime_remain} = $remain->{value}; +} elsif (defined $data->{nvme_smart_health_information_log}->{percentage_used}){ + # NMVe sometime report the estimated life used, instead of the remaining + $json->{percent_lifetime_remain} = 100 - $data->{nvme_smart_health_information_log}->{percentage_used}; } print_out();