diff --git a/extras/deploy-scripts/pandora_deploy_community.sh b/extras/deploy-scripts/pandora_deploy_community.sh index f06b52567a..aa858eec3a 100644 --- a/extras/deploy-scripts/pandora_deploy_community.sh +++ b/extras/deploy-scripts/pandora_deploy_community.sh @@ -71,7 +71,7 @@ check_pre_pandora () { check_repo_connection () { execute_cmd "ping -c 2 8.8.8.8" "Checking internet connection" execute_cmd "ping -c 2 firefly.artica.es" "Checking Community repo" - execute_cmd "ping -c 2 support.artica.es" "Checking Enterprise repo" + execute_cmd "ping -c 2 support.pandorafms.com" "Checking Enterprise repo" } check_root_permissions () { @@ -120,7 +120,7 @@ check_repo_connection execute_cmd "systemctl status" "Cheking SystemD" 'This is not a SystemD enable system, if tryng to use in a docker env plese check: https://github.com/pandorafms/pandorafms/tree/develop/extras/docker/centos8' # Check memomry greather or equal to 2G -execute_cmd "[ $(grep MemTotal /proc/meminfo | awk '{print $2}') -le 2000000 ]" 'Checking memory (required: 2 GB)' +execute_cmd "[ $(grep MemTotal /proc/meminfo | awk '{print $2}') -ge 1700000 ]" 'Checking memory (required: 2 GB)' # Check disk size at least 10 Gb free space execute_cmd "[ $(df -BM / | tail -1 | awk '{print $4}' | tr -d M) -gt 10000 ]" 'Checking Disk (required: 10 GB free min)' diff --git a/pandora_agents/Dockerfile b/pandora_agents/Dockerfile index 0ee2515a75..79257b955c 100644 --- a/pandora_agents/Dockerfile +++ b/pandora_agents/Dockerfile @@ -1,15 +1,15 @@ -FROM centos:centos8 -MAINTAINER Pandora FMS Team +FROM centos:7 +LABEL maintainer="Pandora FMS Team " # Add Pandora FMS agent installer ADD unix /opt/pandora/pandora_agent/unix RUN export LC_ALL=C -RUN dnf install -y dnf-plugins-core; dnf config-manager --set-enabled PowerTools +RUN yum -y update # Install dependencies -RUN dnf -y install \ +RUN yum -y install \ epel-release \ unzip \ perl \ @@ -17,7 +17,7 @@ RUN dnf -y install \ sed \ perl-YAML-Tiny \ "perl(Sys::Syslog)" \ - && dnf clean all + && yum clean all # Install Pandora FMS agent diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 2b9b27c895..74e958a2b9 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.752-210201 +Version: 7.0NG.752-210326 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index dcedaad18f..f5f595c814 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.752-210201" +pandora_version="7.0NG.752-210326" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 13769807ec..49b99da877 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1016,7 +1016,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.752'; -use constant AGENT_BUILD => '210201'; +use constant AGENT_BUILD => '210326'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; @@ -4143,7 +4143,7 @@ while (1) { @address_list = `ip addr show 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/\\/.*//'`; } else { - @address_list = `ifconfig -a 2>$DevNull | sed -e '/127.0.0/d' -e '/\\([0-9][0-9]*\\.\\)\\{3\\}[0-9][0-9]*/!d' -e 's/^[ \\t]*\\([^ \\t]*\\)[ \\t]*\\([^ \\t]*\\)[ \\t].*/\\2/' -e 's/.*://'`; + @address_list = `ifconfig -a 2>$DevNull | grep -i inet | grep -v 'inet6' | grep -v '0.0.0.0' | grep -v '::/0' | awk '{print \$2}' | grep -v '127.0.0.1'`; } for (my $i = 0; $i <= $#address_list; $i++) { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index ee40f6b009..bccc67d858 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.752 -%define release 210201 +%define release 210326 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index a145a90f75..e559d828a4 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -3,7 +3,7 @@ # %define name pandorafms_agent_unix %define version 7.0NG.752 -%define release 210201 +%define release 210326 Summary: Pandora FMS Linux agent, PERL version Name: %{name} @@ -62,8 +62,9 @@ cp -aRf $RPM_BUILD_ROOT%{prefix}/pandora_agent/Linux/pandora_agent.conf $RPM_BUI rm -Rf $RPM_BUILD_ROOT %pre -if [ "`id pandora | grep uid | wc -l`" = 0 ] +if [ "`id pandora 2>/dev/null | grep uid | wc -l`" = 0 ] then + echo "User pandora does not exist. Creating it..." /usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora fi @@ -105,10 +106,15 @@ then echo "Copying new version of pandora_agent_daemon service" cp -f /usr/share/pandora_agent/pandora_agent_daemon.service /usr/lib/systemd/system/ chmod -x /usr/lib/systemd/system/pandora_agent_daemon.service -# Enable the services on SystemD - systemctl enable pandora_agent_daemon.service -else - chkconfig pandora_agent_daemon on + # Enable the services on SystemD + systemctl enable pandora_agent_daemon.service || chkconfig pandora_agent_daemon on +else + chkconfig pandora_agent_daemon on +fi + +if [ "$?" -gt 0 ] +then + echo "There was a problem configuring pandora_agent_daemon service to run on boot. Please enable it manually." fi if [ "$1" -gt 1 ] diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index eff88cee08..368d010da6 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.752" -PI_BUILD="210201" +PI_BUILD="210326" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 1ad6e20642..b095e3f68c 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{210201} +{210326} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 3eda05b2a0..fc197541cf 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.752(Build 210201)") +#define PANDORA_VERSION ("7.0NG.752(Build 210326)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index ebac6998e3..a237f273a3 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Artica ST" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.752(Build 210201))" + VALUE "ProductVersion", "(7.0NG.752(Build 210326))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 703ee24ae5..ecefe2996f 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.752-210201 +Version: 7.0NG.752-210326 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 0db3318bd5..c0d782e0f7 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.752-210201" +pandora_version="7.0NG.752-210326" package_pear=0 package_pandora=1 diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index d954e64804..b653fbd5c5 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -64,6 +64,16 @@ if (isset($config['console_log_enabled']) === true ini_set('error_log', 0); } +// Sometimes input is badly retrieved from caller... +if (empty($_REQUEST) === true) { + $data = explode('&', urldecode(file_get_contents('php://input'))); + foreach ($data as $d) { + $r = explode('=', $d, 2); + $_POST[$r[0]] = $r[1]; + $_GET[$r[0]] = $r[1]; + } +} + // Hash login process. if (isset($_GET['loginhash']) === true) { $loginhash_data = get_parameter('loginhash_data', ''); @@ -80,9 +90,8 @@ if (isset($_GET['loginhash']) === true) { } else { include_once 'general/login_page.php'; db_pandora_audit('Logon Failed (loginhash', '', 'system'); - while (@ob_end_flush()) { - // Dumping... - continue; + while (ob_get_length() > 0) { + ob_end_flush(); } exit(''); @@ -149,7 +158,9 @@ if (__PAN_XHPROF__ === 1) { } -if ($config['force_instant_logout'] === true) { +if (isset($config['force_instant_logout']) === true + && $config['force_instant_logout'] === true +) { // Force user logout. if (session_status() !== PHP_SESSION_ACTIVE) { session_start(); @@ -169,7 +180,6 @@ if ($config['force_instant_logout'] === true) { } -while (@ob_end_flush()) { - // Dumping... - continue; +while (ob_get_length() > 0) { + ob_end_flush(); } diff --git a/pandora_console/extensions/agents_modules.php b/pandora_console/extensions/agents_modules.php index 72b9ddb2f9..0abde09010 100644 --- a/pandora_console/extensions/agents_modules.php +++ b/pandora_console/extensions/agents_modules.php @@ -360,14 +360,14 @@ function mainAgentsModules() $fullscreen['text'] = ''.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).''; + &full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).''; } else if ($full_modules_selected[0] && $full_agents_id[0]) { $full_modules = urlencode(implode(';', $full_modules_selected)); $full_agents = urlencode(implode(';', $full_agents_id)); $fullscreen['text'] = ''.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).''; + &full_agents_id='.$full_agents.'&selection_agent_module='.$selection_a_m.'">'.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode'), 'class' => 'invert_filter']).''; } else { $fullscreen['text'] = ''.html_print_image('images/full_screen.png', true, ['title' => __('Full screen mode')]).''; @@ -437,15 +437,15 @@ function mainAgentsModules() // Header. ui_print_page_header( __('Agents/Modules'), - 'images/module_mc.png', + 'images/module.png', false, '', false, $updated_time ); - echo ''; + echo '
'; echo ''; - echo "'; + echo "'; echo ''; echo '
".$fullscreen['text'].' ".$fullscreen['text'].'
'; } else { @@ -461,7 +461,7 @@ function mainAgentsModules() } // Floating menu - Start. - echo '
'; + echo '
'; echo '