From 609609c0ea66ad94ea23a61f819cadf29f344870 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 22 Mar 2022 14:30:47 +0100 Subject: [PATCH] lsb-release to native /etc/*ease --- pandora_agents/pc/pandora_agent | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_server/lib/PandoraFMS/Tools.pm | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_agents/pc/pandora_agent b/pandora_agents/pc/pandora_agent index b105a8c654..c5437d2225 100644 --- a/pandora_agents/pc/pandora_agent +++ b/pandora_agents/pc/pandora_agent @@ -1141,7 +1141,7 @@ sub guess_os_version { # Linux if ($os eq 'linux') { - $os_version = `lsb_release -sd 2>$DevNull`; + $os_version = `cat /etc/*ease|grep PRETTY| cut -f 2 -d= | tr -d '"' 2>$DevNull`; # AIX } elsif ($os eq 'aix') { $os_version = "$2.$1" if (`uname -rv` =~ /\s*(\d)\s+(\d)\s*/); diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 470eb367c9..9752851b2e 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -2736,7 +2736,7 @@ sub guess_os_version ($) { # Linux if ($os eq 'linux') { - $os_version = `lsb_release -sd 2>$DevNull`; + $os_version = `cat /etc/*ease|grep PRETTY| cut -f 2 -d= | tr -d '"' 2>$DevNull`; # AIX } elsif ($os eq 'aix') { $os_version = "$2.$1" if (`uname -rv` =~ /\s*(\d)\s+(\d)\s*/); diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 734170b0ff..8a72170a3b 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -237,7 +237,7 @@ our $OS = $^O; our $OS_VERSION = "unknown"; our $DEVNULL = '/dev/null'; if ($OS eq 'linux') { - $OS_VERSION = `lsb_release -sd 2>/dev/null`; + $OS_VERSION = `cat /etc/*ease|grep PRETTY| cut -f 2 -d= | tr -d '"' 2>/dev/null`; } elsif ($OS eq 'aix') { $OS_VERSION = "$2.$1" if (`uname -rv` =~ /\s*(\d)\s+(\d)\s*/); } elsif ($OS =~ /win/i) {