diff --git a/lib/FusionInventory/Agent/Task/Inventory/Linux/Distro/NonLSB.pm b/lib/FusionInventory/Agent/Task/Inventory/Linux/Distro/NonLSB.pm index 96968f5838..626bede7e7 100644 --- a/lib/FusionInventory/Agent/Task/Inventory/Linux/Distro/NonLSB.pm +++ b/lib/FusionInventory/Agent/Task/Inventory/Linux/Distro/NonLSB.pm @@ -119,10 +119,19 @@ sub _getDistroData { }; if ($name eq 'SuSE') { - $data->{SERVICE_PACK} = getFirstMatch( - file => '/etc/SuSE-release', - pattern => qr/^PATCHLEVEL = ([0-9]+)/ - ); + # SLES15 doesn't have /etc/SuSE-release + if (-e '/etc/SuSE-release') { + $data->{SERVICE_PACK} = getFirstMatch( + file => '/etc/SuSE-release', + pattern => qr/^PATCHLEVEL = ([0-9]+)/ + ); + } else { + # fall back by checking if there's a -SP in the current version + # if so, split by -SP + if ($version =~ m/\-SP.+/) { + ($data->{VERSION}, $data->{SERVICE_PACK}) = $version =~ m/(.*)-SP(.*)/; + } + } } return $data;