From e953ed782466e0518ca589e6aa22df448cf6b049 Mon Sep 17 00:00:00 2001 From: Andreas Bachlechner <62039342+bachandi@users.noreply.github.com> Date: Sun, 20 Mar 2022 11:24:31 +0100 Subject: [PATCH] Coarser check for missing return values of nvidia-smi. N/A and [N/A] are already discovered. Maybe we encounter more versions in the future. --- lib/nvidiagpu.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nvidiagpu.pm b/lib/nvidiagpu.pm index 8f852fa..1766358 100644 --- a/lib/nvidiagpu.pm +++ b/lib/nvidiagpu.pm @@ -191,7 +191,7 @@ sub nvidiagpu_update { if(scalar(@tmp) > 1) { # To catch missing devices for(my $n_sensor = 0; $n_sensor < scalar(@tmp); $n_sensor += 1) { my $val = trim($tmp[$n_sensor]); - if($val ne "N/A") { + if($val !~ /N\/A/) { if(substr($val, 0, 1) eq "P") { $val = substr($val, 1); }