diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index dc39cfc24b..776895016f 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.776-240423 +Version: 7.0NG.776-240426 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 f0610328a3..d903d734ff 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.776-240423" +pandora_version="7.0NG.776-240426" 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 4e5cdf4648..11d3fbc342 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1039,7 +1039,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.776'; -use constant AGENT_BUILD => '240423'; +use constant AGENT_BUILD => '240426'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 5e55531ea6..da92e682d5 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240423 +%define release 240426 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index d5265d6628..d3ae159f29 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240423 +%define release 240426 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index 326cc0ce03..a4921ff03a 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240423 +%define release 240426 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 459397699e..9de653ff61 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240423 +%define release 240426 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 3718053ee7..8c2d015bd3 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240423 +%define release 240426 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 6ef156d08e..f534ae2797 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240423" +PI_BUILD="240426" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2707a4c614..df2184c9de 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240423} +{240426} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 097813d952..4a92ac6038 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.776 Build 240423") +#define PANDORA_VERSION ("7.0NG.776 Build 240426") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index e06b44d182..4c6daf186a 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.776(Build 240423))" + VALUE "ProductVersion", "(7.0NG.776(Build 240426))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 0bc9ced292..2764e03eec 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.776-240423 +Version: 7.0NG.776-240426 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 26096d98bd..6aba46a7f2 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.776-240423" +pandora_version="7.0NG.776-240426" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/realtime_graphs/ajax.php b/pandora_console/extensions/realtime_graphs/ajax.php index 1482540f91..4d1d2e816f 100644 --- a/pandora_console/extensions/realtime_graphs/ajax.php +++ b/pandora_console/extensions/realtime_graphs/ajax.php @@ -27,7 +27,7 @@ switch ($graph) { if ($os == 'windows') { $data = exec('wmic cpu get loadpercentage|find /I /V "Loadpercentage" | findstr /r "[0-9]" '); } else { - $data = exec("top -bn 2 -d 0.01 | grep '^Cpu' | tail -n 1 | awk '{ print $2+$4+$6 }'"); + $data = exec("top -bn 2 -d 0.01 | grep 'Cpu' | tail -n 1 | awk '{ print $2+$4+$6 }'"); } break; @@ -55,7 +55,8 @@ switch ($graph) { if ($os == 'windows') { $data = exec('(FOR /F "skip=2 tokens=2 delims=\," %P IN (\'typeperf "\\Process(httpd)\\% processor time" -sc 1\') DO @echo %P)|find /V /I "..."'); } else { - $data = exec("ps aux | grep apache2 | grep -v safe | grep -v grep | awk '{ sum+=$3 } END { print sum }'"); + $apache = exec('ps aux | grep apache2 | grep -v safe | grep -v grep && echo 1 || echo 0') == 1 ? 'apache2' : 'apache'; + $data = exec("ps aux | grep $apache | grep -v safe | grep -v grep | awk '{ sum+=$3 } END { print sum }'"); } break; @@ -63,7 +64,7 @@ switch ($graph) { if ($os == 'windows') { $data = exec('(FOR /F "skip=2 tokens=2 delims=\," %P IN (\'typeperf "\\Process(pandora_server)\\% processor time" -sc 1\') DO @echo %P)|find /V /I "..."'); } else { - $data = exec("ps aux | grep pandora_server | grep -v grep | awk '{ print $3 }'"); + $data = exec("ps aux | grep pandora_server | grep -v grep | awk '{ sum+=$3 } END { print sum }'"); } break; diff --git a/pandora_console/extras/mr/69.sql b/pandora_console/extras/mr/69.sql index ea49c68624..45047f9149 100644 --- a/pandora_console/extras/mr/69.sql +++ b/pandora_console/extras/mr/69.sql @@ -7754,4 +7754,9 @@ ALTER TABLE `tdeployment_hosts` DROP COLUMN `arch`; -- Update all deployment recon tasks port UPDATE `trecon_task` SET `field4` = 41121 WHERE `type` = 9; +-- Update execution in proxmox discovery plugin +SET @short_name = 'pandorafms.proxmox'; +SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; +UPDATE `tdiscovery_apps_executions` SET `execution` = ''_exec1_' --conf '_tempfileProxmox_'' WHERE `id_app` = @id_app; + COMMIT; \ No newline at end of file diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 2d3d95a77e..a396964166 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -52,7 +52,7 @@ echo sprintf('
', $menuTypeClass); } // ======= Servers List =============================================== - if ((bool) check_acl($config['id_user'], 0, 'AW') !== false) { + if ((bool) check_acl($config['id_user'], 0, 'PM') !== false) { $servers = []; $servers_info = servers_get_info(); diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 3440719a89..ad1cf0f380 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -473,6 +473,13 @@ if ($access_console_node === true) { enterprise_hook('translate_string_submenu'); $menu_godmode['gsetup']['sub'] = $sub; + } else if ((bool) check_acl($config['id_user'], 0, 'AW') === true) { + $menu_godmode['gservers']['text'] = __('Servers'); + $menu_godmode['gservers']['sec2'] = 'godmode/servers/modificar_server'; + $menu_godmode['gservers']['id'] = 'god-servers'; + $sub = []; + enterprise_hook('manage_satellite_submenu'); + $menu_godmode['gservers']['sub'] = $sub; } } diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 07499e6162..b9395323b8 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -2426,7 +2426,7 @@ switch ($action) { $values['top_n_value'] = get_parameter('max_items'); $values['server_name'] = get_parameter('combo_server_sql'); - if ($sql !== '') { + if ($sql !== '' && $sql !== null) { // Replaces possible macros to check the validity of the query $macros_sql = $sql; $macros_sql = str_replace('_start_date_', '0', $macros_sql); @@ -3376,7 +3376,7 @@ switch ($action) { $values['server_name'] = get_parameter('combo_server_sql'); - if ($sql !== '') { + if ($sql !== '' && $sql !== null) { // Replaces possible macros to check the validity of the query $macros_sql = $sql; $macros_sql = str_replace('_start_date_', '0', $macros_sql); diff --git a/pandora_console/godmode/servers/modificar_server.php b/pandora_console/godmode/servers/modificar_server.php index 1c3e90c84e..43ab316364 100644 --- a/pandora_console/godmode/servers/modificar_server.php +++ b/pandora_console/godmode/servers/modificar_server.php @@ -34,7 +34,7 @@ require_once $config['homedir'].'/include/functions_graph.php'; check_login(); -if (! check_acl($config['id_user'], 0, 'PM')) { +if (! check_acl($config['id_user'], 0, 'PM') && ((bool) check_acl($config['id_user'], 0, 'AW') === true && $_GET['server_remote'] === null)) { db_pandora_audit( AUDIT_LOG_ACL_VIOLATION, 'Trying to access Server Management' @@ -286,19 +286,21 @@ if (isset($_GET['server']) === true) { $id_server ); - $buttons = ''; + $buttons = []; // Buttons. - $buttons = [ - 'standard_editor' => [ - 'active' => false, - 'text' => ''.html_print_image('images/list.png', true, ['title' => __('Standard editor')]).'', - ], - 'advanced_editor' => [ - 'active' => false, - 'text' => ''.html_print_image('images/pen.png', true, ['title' => __('Advanced editor')]).'', - ], - ]; + if ((bool) check_acl($config['id_user'], 0, 'PM') === true) { + $buttons = [ + 'standard_editor' => [ + 'active' => false, + 'text' => ''.html_print_image('images/list.png', true, ['title' => __('Standard editor')]).'', + ], + 'advanced_editor' => [ + 'active' => false, + 'text' => ''.html_print_image('images/pen.png', true, ['title' => __('Advanced editor')]).'', + ], + ]; + } if ($server_type === SERVER_TYPE_ENTERPRISE_SATELLITE) { $buttons['agent_editor'] = [ diff --git a/pandora_console/godmode/servers/servers.build_table.php b/pandora_console/godmode/servers/servers.build_table.php index bbd77f7b14..1ce497131f 100644 --- a/pandora_console/godmode/servers/servers.build_table.php +++ b/pandora_console/godmode/servers/servers.build_table.php @@ -28,7 +28,9 @@ // Begin. require_once 'include/functions_clippy.php'; -require_once 'pending_alerts_list.php'; +if ((bool) check_acl($config['id_user'], 0, 'LM') === true) { + include 'pending_alerts_list.php'; +} global $config; diff --git a/pandora_console/include/class/ExtensionsDiscovery.class.php b/pandora_console/include/class/ExtensionsDiscovery.class.php index 9c9affaf77..c38fc95b06 100644 --- a/pandora_console/include/class/ExtensionsDiscovery.class.php +++ b/pandora_console/include/class/ExtensionsDiscovery.class.php @@ -234,18 +234,18 @@ class ExtensionsDiscovery extends Wizard url_str = `'.__('here').'`; } - var markup = "