diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index f07894445b..ecac3c50b2 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -4371,7 +4371,7 @@ sub pandora_self_monitoring ($$) { my $xml_output = ""; - $xml_output = ""; + $xml_output = ""; $xml_output .=" "; $xml_output .=" Status"; $xml_output .=" generic_proc"; diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 92f5f43d0f..c8610ee893 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -59,6 +59,8 @@ our @EXPORT = qw( SATELLITESERVER METACONSOLE_LICENSE $DEVNULL + $OS + $OS_VERSION RECOVERED_ALERT FIRED_ALERT STATUS_NORMAL @@ -132,8 +134,20 @@ use constant METACONSOLE_LICENSE => 0x01; use constant RECOVERED_ALERT => 0; use constant FIRED_ALERT => 1; -# /dev/null -our $DEVNULL = ($^O eq 'MSWin32') ? '/Nul' : '/dev/null'; +# Set OS, OS version and /dev/null +our $OS = $^O; +our $OS_VERSION; +our $DEVNULL = '/dev/null'; +if ($OS eq 'linux') { + $OS_VERSION = `lsb_release -sd 2>/dev/null`; +} elsif ($OS eq 'aix') { + $OS_VERSION = "$2.$1" if (`uname -rv` =~ /\s*(\d)\s+(\d)\s*/); +} elsif ($OS =~ /win/i) { + $OS = "windows"; + $OS_VERSION = `ver`; + $DEVNULL = '/Nul'; +} +chomp($OS_VERSION); ######################################################################## ## SUB pandora_trash_ascii