diff --git a/extras/deploy-scripts/pandora_deploy_community.sh b/extras/deploy-scripts/pandora_deploy_community.sh
index a49cc294bf..6433324056 100644
--- a/extras/deploy-scripts/pandora_deploy_community.sh
+++ b/extras/deploy-scripts/pandora_deploy_community.sh
@@ -528,23 +528,6 @@ ServerTokens Prod
EO_CONFIG_F
-# Add ws proxy options to apache.
-cat >> /etc/httpd/conf.modules.d/00-proxy.conf << 'EO_HTTPD_MOD'
-LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
-
-EO_HTTPD_MOD
-
-cat >> /etc/httpd/conf.d/wstunnel.conf << 'EO_HTTPD_WSTUNNEL'
-ProxyRequests Off
-
- Require all granted
-
-
-ProxyPass /ws ws://127.0.0.1:8080
-ProxyPassReverse /ws ws://127.0.0.1:8080
-
-EO_HTTPD_WSTUNNEL
-
# Temporal quitar htaccess
sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/images/.htaccess
sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/attachment/.htaccess
@@ -691,16 +674,6 @@ EO_LRA
chmod 0644 /etc/logrotate.d/pandora_server
chmod 0644 /etc/logrotate.d/pandora_agent
-# Add websocket engine start script.
-mv /var/www/html/pandora_console/pandora_websocket_engine /etc/init.d/
-chmod +x /etc/init.d/pandora_websocket_engine
-
-# Start Websocket engine
-/etc/init.d/pandora_websocket_engine start &>> $LOGFILE
-
-# Configure websocket to be started at start.
-systemctl enable pandora_websocket_engine &>> $LOGFILE
-
# Enable pandora ha service
systemctl enable pandora_server --now &>> $LOGFILE
execute_cmd "systemctl start pandora_server" "Starting Pandora FMS Server"
diff --git a/extras/deploy-scripts/pandora_deploy_community_el8.sh b/extras/deploy-scripts/pandora_deploy_community_el8.sh
index 72ee496fa0..e6af38ecde 100644
--- a/extras/deploy-scripts/pandora_deploy_community_el8.sh
+++ b/extras/deploy-scripts/pandora_deploy_community_el8.sh
@@ -394,8 +394,8 @@ console_dependencies=" \
mod_ssl \
libzstd \
openldap-clients \
- https://firefly.pandorafms.com/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \
- https://firefly.pandorafms.com/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \
+ https://firefly.pandorafms.com/centos8/chromium-122.0.6261.128-1.el8.x86_64.rpm \
+ https://firefly.pandorafms.com/centos8/chromium-common-122.0.6261.128-1.el8.x86_64.rpm \
https://firefly.pandorafms.com/centos8/perl-Net-Telnet-3.04-1.el8.noarch.rpm \
https://firefly.pandorafms.com/centos8/pandora_gotty-1.0-1.el8.x86_64.rpm \
https://firefly.pandorafms.com/centos8/pandorafms_made-0.1.0-1.el8.x86_64.rpm \
@@ -639,23 +639,6 @@ ServerTokens Prod
EO_CONFIG_F
-# Add ws proxy options to apache.
-cat >> /etc/httpd/conf.modules.d/00-proxy.conf << 'EO_HTTPD_MOD'
-LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
-
-EO_HTTPD_MOD
-
-cat >> /etc/httpd/conf.d/wstunnel.conf << 'EO_HTTPD_WSTUNNEL'
-ProxyRequests Off
-
- Require all granted
-
-
-ProxyPass /ws ws://127.0.0.1:8080
-ProxyPassReverse /ws ws://127.0.0.1:8080
-
-EO_HTTPD_WSTUNNEL
-
# Temporal quitar htaccess
sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/images/.htaccess
sed -i -e "s/php_flag engine off//g" $PANDORA_CONSOLE/attachment/.htaccess
@@ -813,16 +796,6 @@ EO_LRA
chmod 0644 /etc/logrotate.d/pandora_server
chmod 0644 /etc/logrotate.d/pandora_agent
-# Add websocket engine start script.
-mv /var/www/html/pandora_console/pandora_websocket_engine /etc/init.d/ &>> "$LOGFILE"
-chmod +x /etc/init.d/pandora_websocket_engine &>> "$LOGFILE"
-
-# Start Websocket engine
-/etc/init.d/pandora_websocket_engine start &>> "$LOGFILE"
-
-# Configure websocket to be started at start.
-systemctl enable pandora_websocket_engine &>> "$LOGFILE"
-
# Enable pandora ha service
systemctl enable pandora_server --now &>> "$LOGFILE"
execute_cmd "/etc/init.d/pandora_server start" "Starting Pandora FMS Server"
diff --git a/extras/deploy-scripts/pandora_deploy_community_el9.sh b/extras/deploy-scripts/pandora_deploy_community_el9.sh
index 70b473b49b..738833d774 100644
--- a/extras/deploy-scripts/pandora_deploy_community_el9.sh
+++ b/extras/deploy-scripts/pandora_deploy_community_el9.sh
@@ -386,8 +386,8 @@ console_dependencies=" \
mod_ssl \
libzstd \
openldap-clients \
- https://firefly.pandorafms.com/centos8/chromium-110.0.5481.177-1.el7.x86_64.rpm \
- https://firefly.pandorafms.com/centos8/chromium-common-110.0.5481.177-1.el7.x86_64.rpm \
+ https://firefly.pandorafms.com/centos8/chromium-122.0.6261.128-1.el8.x86_64.rpm \
+ https://firefly.pandorafms.com/centos8/chromium-common-122.0.6261.128-1.el8.x86_64.rpm \
https://firefly.pandorafms.com/centos8/pandora_gotty-1.0-1.el8.x86_64.rpm \
https://firefly.pandorafms.com/centos8/pandorafms_made-0.1.0-1.el8.x86_64.rpm "
execute_cmd "dnf install -y $console_dependencies" "Installing Pandora FMS Console dependencies"
diff --git a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh
index 6d0bb69d06..64beb74eb2 100644
--- a/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh
+++ b/extras/deploy-scripts/pandora_deploy_community_ubuntu_2204.sh
@@ -371,7 +371,7 @@ ln -s /usr/bin/fping /usr/sbin/fping &>> "$LOGFILE"
# Chrome
rm -f /usr/bin/chromium-browser &>> "$LOGFILE"
-CHROME_VERSION=google-chrome-stable_110.0.5481.177-1_amd64.deb
+CHROME_VERSION=google-chrome-stable_122.0.6261.128-1_amd64.deb
execute_cmd "wget https://dl.google.com/linux/deb/pool/main/g/google-chrome-stable/${CHROME_VERSION}" "Downloading google chrome"
execute_cmd "apt install -y ./${CHROME_VERSION}" "Intalling google chrome"
execute_cmd "ln -s /usr/bin/google-chrome /usr/bin/chromium-browser" "Creating /usr/bin/chromium-browser Symlink"
@@ -601,6 +601,7 @@ EOF_PARAM
a2enmod ssl &>> "$LOGFILE"
a2enmod headers &>> "$LOGFILE"
+a2enmod rewrite &>> "$LOGFILE"
a2enconf ssl-params &>> "$LOGFILE"
a2ensite default-ssl &>> "$LOGFILE"
a2enconf ssl-params &>> "$LOGFILE"
@@ -648,17 +649,6 @@ ServerTokens Prod
EO_CONFIG_F
-#Enable quickshell proxy
-cat >> /etc/apache2/mods-enabled/00-proxy.conf << 'EO_HTTPD_WSTUNNEL'
-ProxyRequests Off
-
- Require all granted
-
-
-ProxyPass /ws ws://127.0.0.1:8080
-ProxyPassReverse /ws ws://127.0.0.1:8080
-EO_HTTPD_WSTUNNEL
-
# Fixing console permissions
chmod 600 $PANDORA_CONSOLE/include/config.php &>> "$LOGFILE"
chown -R www-data:www-data $PANDORA_CONSOLE &>> "$LOGFILE"
@@ -813,16 +803,6 @@ EO_LRA
chmod 0644 /etc/logrotate.d/pandora_server
chmod 0644 /etc/logrotate.d/pandora_agent
-# Add websocket engine start script.
-mv /var/www/html/pandora_console/pandora_websocket_engine /etc/init.d/ &>> "$LOGFILE"
-chmod +x /etc/init.d/pandora_websocket_engine &>> "$LOGFILE"
-
-# Start Websocket engine
-/etc/init.d/pandora_websocket_engine start &>> "$LOGFILE"
-
-# Configure websocket to be started at start.
-systemctl enable pandora_websocket_engine &>> "$LOGFILE"
-
# Enable pandora ha service
execute_cmd "/etc/init.d/pandora_server start" "Starting Pandora FMS Server"
systemctl enable pandora_server &>> "$LOGFILE"
diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf
index 4f49fb8cf5..8cb980cff1 100644
--- a/pandora_agents/pc/Linux/pandora_agent.conf
+++ b/pandora_agents/pc/Linux/pandora_agent.conf
@@ -310,10 +310,6 @@ module_plugin pandora_df
#module_description Postcondition test module
#module_end
-# This plugin runs several security checks in a Linux system
-
-#module_plugin pandora_security_check
-
# Extraction module example
#module_begin
#module_name Collector
diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control
index 1a93e1bda0..f2fc81555f 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-240402
+Version: 7.0NG.776-240408
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 dd97783482..500d41858f 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-240402"
+pandora_version="7.0NG.776-240408"
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/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf
index 882be1bda8..20714a13b7 100644
--- a/pandora_agents/unix/Linux/pandora_agent.conf
+++ b/pandora_agents/unix/Linux/pandora_agent.conf
@@ -270,6 +270,9 @@ module_plugin pandora_netusage
# Service autodiscovery plugin
module_plugin autodiscover --default
+# This plugin runs several security checks in a Linux system
+# module_plugin perl /usr/share/pandora_agent/plugins/pandora_security_check --conf /usr/share/pandora_agent/plugins/pandora_security_check.conf
+
# Plugin for inventory on the agent.
# module_plugin inventory 1 cpu ram video nic hd cdrom software init_services filesystem users route
diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent
index f8917912c2..6a1e830b5f 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 => '240402';
+use constant AGENT_BUILD => '240408';
# 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 87257d94e7..3446c15200 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 240402
+%define release 240408
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 b10f85df8d..498f1430ed 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 240402
+%define release 240408
%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 9c6a6060ee..64da22869f 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 240402
+%define release 240408
%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 75e053f16e..9152dfa7c7 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 240402
+%define release 240408
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 95cdfb9cb1..1478e1c157 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 240402
+%define release 240408
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 8b89c4b715..adbea36a25 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="240402"
+PI_BUILD="240408"
OS_NAME=`uname -s`
FORCE=0
diff --git a/pandora_agents/unix/plugins/pandora_security_check b/pandora_agents/unix/plugins/pandora_security_check
index 0ad845639b..53022feba7 100644
--- a/pandora_agents/unix/plugins/pandora_security_check
+++ b/pandora_agents/unix/plugins/pandora_security_check
@@ -297,6 +297,10 @@ sub parse_configuration {
$line =~ s/^\s+//;
$line =~ s/\s+$//;
+ if($line =~ /^$/) {
+ next;
+ }
+
if ($line =~ /^\[($b_ports|$b_files|$b_passwords)\]$/) {
$configuration_block = $1;
}
@@ -537,7 +541,6 @@ if ($check_files) {
if ($can_check_files) {
# Check each file integrity
- my @errored_files;
my @no_integrity_files;
# Create unique check files list
@@ -556,8 +559,6 @@ if ($check_files) {
push @no_integrity_files, $file;
}
$integrity{$file_key} = $file_md5;
- } else {
- push @errored_files, $file;
}
}
@@ -571,11 +572,6 @@ if ($check_files) {
$value = 0;
$desc = "Changed files found:\n" . join("\n", @no_integrity_files);
}
-
- if (@errored_files) {
- $value = 0;
- $desc .= "\nUnable to check integrity of some files:\n" . join("\n", @errored_files);
- }
}
print_xml_module('Files check status', 'generic_proc', $desc, $value);
@@ -596,10 +592,15 @@ if ($check_passwords) {
open my $shadow_fh, '<', $shadow_file;
while (my $line = <$shadow_fh>) {
chomp $line;
+
+ if($line =~ /^$/) {
+ next;
+ }
+
my ($username, $password_hash, @rest) = split /:/, $line;
# Skip users with no password hash
- if ($password_hash ne "*" && $password_hash ne "!!" && $password_hash ne "!locked") {
+ if ($password_hash ne "*" && $password_hash ne "!!" && $password_hash ne "!locked" && $password_hash ne "!*") {
my $salt = substr($password_hash, 0, rindex($password_hash, '$') + 1);
my $user_hash = crypt($username, $salt);
if ($user_hash eq $password_hash) {
diff --git a/pandora_agents/unix/plugins/pandora_security_check.conf b/pandora_agents/unix/plugins/pandora_security_check.conf
new file mode 100644
index 0000000000..c48d94af4d
--- /dev/null
+++ b/pandora_agents/unix/plugins/pandora_security_check.conf
@@ -0,0 +1,22 @@
+[PORTS]
+22
+80
+443
+41121
+8080
+
+[FILES]
+/etc/httpd/httpd.conf
+/etc/my.cnf
+/etc/sudoers
+/etc/passwd
+/etc/hosts
+
+[PASSWORDS]
+pandora
+PANDORA
+P4nd0r4
+password
+root
+linux
+admin
diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi
index 38490f2f6d..03adfba75e 100644
--- a/pandora_agents/win32/installer/pandora.mpi
+++ b/pandora_agents/win32/installer/pandora.mpi
@@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
-{240402}
+{240408}
ViewReadme
{Yes}
diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc
index 33b0ea0cdf..4524724159 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 240402")
+#define PANDORA_VERSION ("7.0NG.776 Build 240408")
string pandora_path;
string pandora_dir;
@@ -53,6 +53,9 @@ Key_Value::parseLine (string str) {
string trimmedstr;
trimmedstr = trim (str);
+ if (trimmedstr == "") {
+ return;
+ }
/* Check if the string has " */
pos = trimmedstr.find ("\"");
diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc
index c7fc47bd7b..b11833f024 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 240402))"
+ VALUE "ProductVersion", "(7.0NG.776(Build 240408))"
VALUE "FileVersion", "1.0.0.0"
END
END
diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control
index b1fe76adcb..7969f1621d 100644
--- a/pandora_console/DEBIAN/control
+++ b/pandora_console/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-console
-Version: 7.0NG.776-240402
+Version: 7.0NG.776-240408
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 debdb72758..88ff098d15 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-240402"
+pandora_version="7.0NG.776-240408"
package_pear=0
package_pandora=1
diff --git a/pandora_console/extras/mr/69.sql b/pandora_console/extras/mr/69.sql
index 19dfe33d6d..63e3a21b32 100644
--- a/pandora_console/extras/mr/69.sql
+++ b/pandora_console/extras/mr/69.sql
@@ -2,6 +2,10 @@ START TRANSACTION;
DROP TABLE tskin;
+ALTER TABLE tfavmenu_user CONVERT TO CHARACTER SET UTF8MB4;
+ALTER TABLE tfiles_repo CONVERT TO CHARACTER SET UTF8MB4;
+ALTER TABLE tfiles_repo_group CONVERT TO CHARACTER SET UTF8MB4;
+
ALTER TABLE `tusuario`
ADD COLUMN `stop_lts_modal` TINYINT NOT NULL DEFAULT 0 AFTER `session_max_time_expire`;
@@ -7708,4 +7712,38 @@ UPDATE `twelcome_tip` SET url = 'https://pandorafms.com/manual/!current/start?id
DELETE FROM tconfig WHERE `token` = 'legacy_database_ha';
+-- Add new columns in tdeployment_hosts
+ALTER TABLE `tdeployment_hosts` ADD COLUMN `deploy_method` ENUM('SSH', 'HTTP', 'HTTPS') DEFAULT 'SSH';
+ALTER TABLE `tdeployment_hosts` ADD COLUMN `deploy_port` INT UNSIGNED NOT NULL DEFAULT 22;
+ALTER TABLE `tdeployment_hosts` ADD COLUMN `server_port` INT UNSIGNED NOT NULL DEFAULT 41121;
+ALTER TABLE `tdeployment_hosts` ADD COLUMN `temp_folder` VARCHAR(500) DEFAULT '/tmp';
+
+UPDATE
+ `tdeployment_hosts`, `tconfig_os`
+SET
+ `tdeployment_hosts`.`deploy_method` = 'HTTP',
+ `tdeployment_hosts`.`deploy_port` = 5985,
+ `tdeployment_hosts`.`temp_folder` = 'C:\Widnows\Temp'
+WHERE
+ `tdeployment_hosts`.`id_os` = `tconfig_os`.`id_os` AND `tconfig_os`.`name` = 'Windows' AND `tdeployment_hosts`.`deployed` = 0;
+
+-- Find the name of the foreign key constraint
+SELECT @constraint_name := `constraint_name`
+FROM `information_schema`.`key_column_usage`
+WHERE `table_name` = 'tdeployment_hosts' AND `column_name` = 'id_os';
+
+-- Drop the foreign key constraint using dynamic SQL
+SET @drop_fk_query = CONCAT('ALTER TABLE `tdeployment_hosts` DROP FOREIGN KEY ', @constraint_name);
+PREPARE stmt FROM @drop_fk_query;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+-- Drop unused columns in tdeployment_hosts
+ALTER TABLE `tdeployment_hosts` DROP COLUMN `id_os`;
+ALTER TABLE `tdeployment_hosts` DROP COLUMN `os_version`;
+ALTER TABLE `tdeployment_hosts` DROP COLUMN `arch`;
+
+-- Update all deployment recon tasks port
+UPDATE `trecon_task` SET `field4` = 41121 WHERE `type` = 9;
+
COMMIT;
\ No newline at end of file
diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php
index c1c9159134..f4aefb957a 100644
--- a/pandora_console/godmode/agentes/agent_manager.php
+++ b/pandora_console/godmode/agentes/agent_manager.php
@@ -936,7 +936,7 @@ $switchButtons[] = html_print_radio_button_extended(
);
$tableAdvancedAgent->data['module_definition'][] = html_print_label_input_block(
- __('Module definition').ui_print_help_tip(__('Three working modes can be selected for module definition. Learning mode: Default mode, if an XML arrives with new modules, they will be created automatically; it is a learning behavior. Normal mode: If an XML arrives with new modules, they will only be created if they are previously declared in the Console. Autodisable mode: It is the same as learning mode, but if all modules go into unknown, the agent will be disabled until information arrives again.'), true),
+ __('Module definition').ui_print_help_tip(__('Three working modes can be selected for module definition. Learning mode: Default mode, if an XML arrives with new modules, they will be created automatically; it is a learning behavior. Normal mode: If an XML arrives with new modules, they will only be created if they are previously declared in the Console. Autodisable mode: It is the same as learning mode, but if all modules go into unknown, the agent will be disabled until information arrives again.'), true).clippy_context_help('modules_not_learning_mode'),
html_print_div(
[
'class' => 'switch_radio_button',
@@ -1297,7 +1297,6 @@ if ($modo == 0) {
echo "";
}
-echo clippy_context_help('modules_not_learning_mode');
echo '';
if ($new_agent === false) {
@@ -1434,15 +1433,15 @@ ui_require_jquery_file('bgiframe');
function show_modules_not_learning_mode_context_help() {
if ($("input[name='modo'][value=0]").is(':checked')) {
- $("#modules_not_learning_mode_context_help").show().css('padding-right','8px');
- }
- else {
- $("#modules_not_learning_mode_context_help").hide();
+ $(".div-modules_not_learning_mode").show();
+ } else {
+ $(".div-modules_not_learning_mode").hide();
}
}
$(document).ready (function() {
+ show_modules_not_learning_mode_context_help();
var $id_agent = '';
var previous_primary_group_select;
diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php
index aec6b98f4a..f98567d948 100644
--- a/pandora_console/godmode/agentes/configurar_agente.php
+++ b/pandora_console/godmode/agentes/configurar_agente.php
@@ -1292,10 +1292,18 @@ if ($update_agent) {
// Get all plugins (BASIC OPTIONS).
$agent = new PandoraFMS\Agent($id_agente);
$plugins = $agent->getPlugins();
+ $pluginsToWrite = [
+ 'security_hardening' => [
+ 'write' => $security_hardening,
+ 'raw' => "module_begin \nmodule_plugin /usr/share/pandora_agent/plugins/pandora_hardening -t 150 \nmodule_absoluteinterval 7d \nmodule_end",
+ ],
+ ];
+
foreach ($plugins as $key => $row) {
// Only check plugins when agent package is bigger than 774.
if ($options_package === '1') {
if (preg_match('/pandora_hardening/', $row['raw']) === 1) {
+ $pluginsToWrite['security_hardening']['write'] = 0;
if ($security_hardening === 1) {
if ($row['disabled'] === 1) {
$agent->enablePlugins($row['raw']);
@@ -1347,6 +1355,12 @@ if ($update_agent) {
}
}
+ foreach ($pluginsToWrite as $name => $val) {
+ if ($val['write'] === 1) {
+ $result = $agent->addPlugins(io_safe_output($val['raw']), true);
+ }
+ }
+
$modules = $agent->getModules();
foreach ($modules as $key => $row) {
diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php
index eb3b49c055..51607427fa 100644
--- a/pandora_console/godmode/agentes/module_manager.php
+++ b/pandora_console/godmode/agentes/module_manager.php
@@ -912,23 +912,30 @@ if ($modules !== false) {
if ((bool) $linked !== false) {
if ((bool) $adopt === true) {
- $img = 'images/policies_brick.png';
+ $img = 'images/policies_brick.svg';
$title = '('.__('Adopted').') '.$policyInfo['name_policy'];
} else {
- $img = 'images/policies_mc.png';
+ $img = 'images/policy@svg.svg';
$title = $policyInfo['name_policy'];
}
} else {
if ((bool) $adopt === true) {
- $img = 'images/policies_not_brick.png';
+ $img = 'images/policies_not_brick.svg';
$title = '('.__('Unlinked').') ('.__('Adopted').') '.$policyInfo['name_policy'];
} else {
- $img = 'images/unlinkpolicy.png';
+ $img = 'images/unlinkpolicy.svg';
$title = '('.__('Unlinked').') '.$policyInfo['name_policy'];
}
}
- $data[1] = ''.html_print_image($img, true, ['title' => $title]).'';
+ $data[1] = ''.html_print_image(
+ $img,
+ true,
+ [
+ 'title' => $title,
+ 'class' => 'main_menu_icon',
+ ]
+ ).'';
}
}
diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php
index fe0790f71b..0df61ee1c2 100644
--- a/pandora_console/godmode/alerts/alert_list.list.php
+++ b/pandora_console/godmode/alerts/alert_list.list.php
@@ -712,9 +712,9 @@ foreach ($simple_alerts as $alert) {
WHERE id = '.$alert['id_alert_template']
);
if ($default_action != '') {
- $data[3] .= "
- ";
+ $data[3] .= "
";
$data[3] .= db_get_sql("SELECT name FROM talert_actions WHERE id = $default_action").' ('.__('Default').')';
- $data[3] .= ' | ';
+ $data[3] .= '';
$data[3] .= ' ';
}
@@ -722,7 +722,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '';
$data[3] .= '';
$data[3] .= '';
- $data[3] .= '- ';
+ $data[3] .= '
- ';
if ($alert['disabled']) {
$data[3] .= '';
} else {
@@ -758,7 +758,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= '
| ';
- $data[3] .= '';
+ $data[3] .= ' | ';
$data[3] .= ui_print_help_tip(__('The default actions will be executed every time that the alert is fired and no other action is executed'), true);
// Is possible manage actions if have LW permissions in the agent group of the alert module
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW')) {
@@ -786,7 +786,7 @@ foreach ($simple_alerts as $alert) {
true,
[
'title' => __('Update action'),
- 'class' => 'main_menu_icon invert_filter',
+ 'class' => 'main_menu_icon invert_filter action_button_hidden',
'onclick' => 'show_display_update_action(\''.$action['id'].'\',\''.$alert['id'].'\',\''.$alert['id_agent_module'].'\',\''.$action_id.'\',\''.$alert['id_agent_module'].'\')',
]
);
@@ -997,7 +997,7 @@ foreach ($simple_alerts as $alert) {
} else {
$module_linked = policies_is_module_linked($alert['id_agent_module']);
if ($module_linked === '0') {
- $img = 'images/unlinkpolicy.png';
+ $img = 'images/unlinkpolicy.svg';
} else {
$img = 'images/policy@svg.svg';
}
@@ -1333,10 +1333,9 @@ function show_display_update_action(id_module_action, alert_id, alert_id_agent_m
},
open: function() {
$(`#update_action-div-${alert_id}`).css('overflow', 'hidden');
- //$(`#action_select_ajax-${alert_id}`).select2({
- // tags: true,
- // dropdownParent: $(`#update_action-div-${alert_id}`)
- //});
+ $(`#update_action-div-${alert_id} select`).select2({
+ dropdownParent: $(this).parent()
+ });
},
width: 600,
height: 350
diff --git a/pandora_console/godmode/alerts/alert_view.php b/pandora_console/godmode/alerts/alert_view.php
index 499bbded5e..13ae972233 100644
--- a/pandora_console/godmode/alerts/alert_view.php
+++ b/pandora_console/godmode/alerts/alert_view.php
@@ -140,13 +140,16 @@ if (enterprise_installed() && $alert['id_policy_alerts'] != 0) {
if ($policyInfo === false) {
$policy = __('N/A');
} else {
- $img = 'images/policies_mc.png';
+ $img = 'images/policy@svg.svg';
$policy = '';
$policy .= html_print_image(
$img,
true,
- ['title' => $policyInfo['name']]
+ [
+ 'title' => $policyInfo['name'],
+ 'class' => 'main_menu_icon',
+ ]
);
$policy .= '';
}
diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php
index 7365339191..33ed7b6dca 100644
--- a/pandora_console/godmode/alerts/configure_alert_template.php
+++ b/pandora_console/godmode/alerts/configure_alert_template.php
@@ -350,7 +350,8 @@ function update_template($step)
'previous_name' => $previous_name,
];
- if ($name_check === false) {
+ $original_name = db_get_value('name', 'talert_templates', 'id', $id);
+ if ($name_check === false || $original_name === $name_check) {
$result = alerts_update_alert_template($id, $values);
} else {
ui_print_warning_message(__('Another template with the same name already exists'));
@@ -1821,5 +1822,11 @@ if ($step == 2) {
}
?>
})
+
+$(document).ready(function () {
+ $("#default_action").select2({
+ closeOnSelect: true
+ });
+});
/* ]]> */
diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php
index ef1b66a731..269d92f984 100644
--- a/pandora_console/godmode/groups/group_list.php
+++ b/pandora_console/godmode/groups/group_list.php
@@ -723,6 +723,11 @@ if ($is_management_allowed === true
['id_grupo' => $id_group]
);
+ $result_user_profile = db_process_sql_delete(
+ 'tusuario_perfil',
+ ['id_grupo' => $id_group]
+ );
+
if ($result && (!$usedGroup['return'])) {
db_process_sql_delete(
'tfavmenu_user',
@@ -1128,7 +1133,7 @@ if ($tab == 'tree') {
$confirm_message = __('The child groups will be updated to use the parent id of the deleted group').'. '.$confirm_message;
}
- $table->data[$key][6] .= ''.html_print_image(
+ $table->data[$key][6] .= ''.html_print_image(
'images/delete.svg',
true,
[
@@ -1214,7 +1219,6 @@ $tab = 'group_edition';
});
$('#button-filter').on('click', function(event) {
- console.log('here');
event.preventDefault();
load_tree(show_full_hirearchy, show_not_init_agents, show_not_init_modules);
@@ -1314,5 +1318,39 @@ $tab = 'group_edition';
});
}
+ function preprocessDeletion(group_id, delete_URL, confirm_text) {
+ var parameters = {};
+ parameters['page'] = 'include/ajax/group';
+ parameters['method'] = 'checkGroupIsLinkedToElement';
+ parameters['group_id'] = group_id;
+ parameters['table_name'] = 'tusuario_perfil';
+ parameters['field_name'] = 'id_grupo';
+
+ $.ajax({
+ type: "POST",
+ url: "",
+ data: parameters,
+ success: function(data) {
+ if (data.result == '1') {
+ confirmDialog({
+ title: '',
+ message: '',
+ onAccept: function() {
+ window.location.assign(delete_URL);
+ }
+ });
+ } else {
+ if (!confirm(confirm_text)) {
+ return false;
+ } else {
+ window.location.assign(delete_URL);
+ }
+ }
+ },
+ dataType: "json"
+ });
+
+ return true;
+ }
diff --git a/pandora_console/godmode/massive/massive_operations.php b/pandora_console/godmode/massive/massive_operations.php
index 3480b66a92..b34df861d5 100755
--- a/pandora_console/godmode/massive/massive_operations.php
+++ b/pandora_console/godmode/massive/massive_operations.php
@@ -252,7 +252,7 @@ $alertstab = [
$policiesalertstab = [
'text' => ''.html_print_image(
- 'images/policies_mc.png',
+ 'images/policy@svg.svg',
true,
[
'title' => __('Policies alerts'),
diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php
index 38206b060c..9681d79102 100755
--- a/pandora_console/godmode/reporting/reporting_builder.php
+++ b/pandora_console/godmode/reporting/reporting_builder.php
@@ -911,7 +911,7 @@ switch ($action) {
// Admin options only for RM flag.
- if (check_acl($config['id_user'], 0, 'RM')) {
+ if (check_acl($config['id_user'], 0, 'RR')) {
$table->head[$next] = __('Private');
$table->headstyle[$next] = 'min-width: 40px;text-align: left;';
$table->size[$next] = '2%';
@@ -929,7 +929,7 @@ switch ($action) {
$next++;
$op_column = false;
- if (is_metaconsole() === false) {
+ if (is_metaconsole() === false && check_acl($config['id_user'], 0, 'RM')) {
$op_column = true;
$table->head[$next] = ''.__('Op.').''.html_print_checkbox(
'all_delete',
@@ -1082,7 +1082,7 @@ switch ($action) {
}
// Admin options only for RM flag.
- if (check_acl($config['id_user'], 0, 'RM')) {
+ if (check_acl($config['id_user'], 0, 'RR')) {
if ($report['private'] == 1) {
$data[$next] = __('Yes');
} else {
@@ -2408,10 +2408,15 @@ switch ($action) {
$values['server_name'] = get_parameter('combo_server_sql');
if ($sql !== '') {
+ // Replaces possible macros to check the validity of the query
+ $macros_sql = $sql;
+ $macros_sql = str_replace('_start_date_', '0', $macros_sql);
+ $macros_sql = str_replace('_end_date_', 'NOW()', $macros_sql);
+
if ($values['server_name'] === 'all') {
$servers_connection = metaconsole_get_connections();
foreach ($servers_connection as $key => $s) {
- $good_format = db_validate_sql($sql, $s['server_name']);
+ $good_format = db_validate_sql($macros_sql, $s['server_name']);
}
// Reconnected in nodo if exist.
@@ -2423,9 +2428,9 @@ switch ($action) {
}
} else if ($server_id === 0) {
// Connect with node if not exist conexion.
- $good_format = db_validate_sql($sql, (is_metaconsole() === true) ? $values['server_name'] : false);
+ $good_format = db_validate_sql($macros_sql, (is_metaconsole() === true) ? $values['server_name'] : false);
} else {
- $good_format = db_validate_sql($sql);
+ $good_format = db_validate_sql($macros_sql);
}
}
} else if ($values['type'] == 'url') {
@@ -3353,10 +3358,15 @@ switch ($action) {
if ($sql !== '') {
+ // Replaces possible macros to check the validity of the query
+ $macros_sql = $sql;
+ $macros_sql = str_replace('_start_date_', '0', $macros_sql);
+ $macros_sql = str_replace('_end_date_', 'NOW()', $macros_sql);
+
if ($values['server_name'] === 'all') {
$servers_connection = metaconsole_get_connections();
foreach ($servers_connection as $key => $s) {
- $good_format = db_validate_sql($sql, $s['server_name']);
+ $good_format = db_validate_sql($macros_sql, $s['server_name']);
}
// Reconnected in nodo if exist.
@@ -3368,9 +3378,9 @@ switch ($action) {
}
} else if ($server_id === 0) {
// Connect with node if not exist conexion.
- $good_format = db_validate_sql($sql, (is_metaconsole() === true) ? $values['server_name'] : false);
+ $good_format = db_validate_sql($macros_sql, (is_metaconsole() === true) ? $values['server_name'] : false);
} else {
- $good_format = db_validate_sql($sql);
+ $good_format = db_validate_sql($macros_sql);
}
}
} else if ($values['type'] == 'url') {
diff --git a/pandora_console/godmode/reporting/visual_console_builder.wizard.php b/pandora_console/godmode/reporting/visual_console_builder.wizard.php
index 24b0c3f9bf..55c2cd329d 100644
--- a/pandora_console/godmode/reporting/visual_console_builder.wizard.php
+++ b/pandora_console/godmode/reporting/visual_console_builder.wizard.php
@@ -630,6 +630,8 @@ echo '';
echo ''.__('None').'';
echo ''.__('None').'';
echo ''.__('Loading...').'';
+
+echo '';
?>
+';
$output .= html_print_image(
'images/control_prev.png',
true,
- ['title' => __('Previous')]
+ [
+ 'title' => __('Previous'),
+ 'class' => 'invert_filter',
+ ]
);
$output .= '';
$output .= '';
@@ -215,7 +218,10 @@ $output .= '';
$output .= html_print_image(
'images/control_stop.png',
true,
- ['title' => __('Stop')]
+ [
+ 'title' => __('Stop'),
+ 'class' => 'invert_filter',
+ ]
);
$output .= '';
$output .= '';
@@ -226,7 +232,10 @@ $output .= '';
$output .= html_print_image(
'images/control_pause.png',
true,
- ['title' => __('Pause')]
+ [
+ 'title' => __('Pause'),
+ 'class' => 'invert_filter',
+ ]
);
$output .= '';
$output .= '';
@@ -237,7 +246,10 @@ $output .= '';
$output .= html_print_image(
'images/control_next.png',
true,
- ['title' => __('Next')]
+ [
+ 'title' => __('Next'),
+ 'class' => 'invert_filter',
+ ]
);
$output .= '';
$output .= '';
@@ -249,14 +261,20 @@ if ($cellModeSlides === 0) {
$output .= html_print_image(
'images/visual_console.png',
true,
- ['title' => __('Boxed mode')]
+ [
+ 'title' => __('Boxed mode'),
+ 'class' => 'invert_filter',
+ ]
);
$msg_tooltip = __('This mode will show the dashboard with all the widgets in the screen. Click to change to single screen mode.');
} else {
$output .= html_print_image(
'images/dashboard.png',
true,
- ['title' => __('Single screen')]
+ [
+ 'title' => __('Single screen'),
+ 'class' => 'invert_filter',
+ ]
);
$msg_tooltip = __('This mode will show each widget in a screen, rotating between elements in each dashboard. Click to change to boxed mode.');
}
@@ -275,5 +293,11 @@ $output .= ' '.$name.' ';
$output .= '';
$output .= '';
+$output .= '
+
+';
echo $output;
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index dcf13b1670..7a37aa3aa8 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-server
-Version: 7.0NG.776-240402
+Version: 7.0NG.776-240408
Architecture: all
Priority: optional
Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index 1b1fbc2299..0d0623b13d 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/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-240402"
+pandora_version="7.0NG.776-240408"
package_cpan=0
package_pandora=1
diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new
index 8dcb2ee0f4..eded19d4db 100644
--- a/pandora_server/conf/pandora_server.conf.new
+++ b/pandora_server/conf/pandora_server.conf.new
@@ -711,6 +711,9 @@ ncmserver_threads 1
# NCM utility to avoid Net::SSH::Expect issues in multi-threaded environments.
ncm_ssh_utility /usr/share/pandora_server/util/ncm_ssh_extension
+# Utility to deploy software agents via SSH or WinRM.
+agent_deployer_utility /usr/share/pandora_server/util/pandora_agent_deployer
+
# Pandora FMS Daemon Watchdog execution interval in seconds (PANDORA FMS ENTERPRISE ONLY).
ha_interval 30
diff --git a/pandora_server/conf/tentacle_server.conf.new b/pandora_server/conf/tentacle_server.conf.new
index a7cec8fd2c..9f0452d82b 100644
--- a/pandora_server/conf/tentacle_server.conf.new
+++ b/pandora_server/conf/tentacle_server.conf.new
@@ -21,7 +21,7 @@ daemon 1
#insecure 0
# [-i] Filters (regexp:dir;regexp:dir...).
-filters .*\.conf:conf;.*\.md5:md5;.*\.zip:collections;.*\.lock:trans;.*\.rcmd:commands
+filters .*\.conf:conf;.*\.md5:md5;.*\.zip:collections;.*\.lock:trans;.*\.rcmd:commands;.*\.agent_setup\.exe:agent;.*\.agent_setup\.tar\.gz:agent
# [-m] Maximum file size allowed by the server in bytes
# max_size 2000000
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index bd51803af4..988f2f5f59 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.776";
-my $pandora_build = "240402";
+my $pandora_build = "240408";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash
@@ -556,6 +556,8 @@ sub pandora_load_config {
$pa_config->{'ncmserver_threads'} = 1; # 7.0.758
$pa_config->{'ncm_ssh_utility'} = '/usr/share/pandora_server/util/ncm_ssh_extension'; # 7.0.758
+ $pa_config->{'agent_deployer_utility'} = '/usr/share/pandora_server/util/pandora_agent_deployer'; # 7.0.777
+
$pa_config->{"pandora_service_cmd"} = 'service pandora_server'; # 7.0.761
$pa_config->{"tentacle_service_cmd"} = 'service tentacle_serverd'; # 7.0.761
$pa_config->{"tentacle_service_watchdog"} = 1; # 7.0.761
@@ -1337,6 +1339,9 @@ sub pandora_load_config {
elsif ($parametro =~ m/^ncm_ssh_utility\s+(.*)/i) {
$pa_config->{'ncm_ssh_utility'}= clean_blank($1);
}
+ elsif ($parametro =~ m/^agent_deployer_utility\s+(.*)/i) {
+ $pa_config->{'agent_deployer_utility'}= clean_blank($1);
+ }
elsif ($parametro =~ m/^ha_file\s(.*)/i) {
$pa_config->{'ha_file'} = clean_blank($1);
}
diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm
index 2fe0572a3a..5221e7a699 100644
--- a/pandora_server/lib/PandoraFMS/Core.pm
+++ b/pandora_server/lib/PandoraFMS/Core.pm
@@ -3775,9 +3775,6 @@ sub pandora_delete_module {
# Delete templates asociated to the module
db_do ($dbh, 'DELETE FROM talert_template_modules WHERE id_agent_module = ?', $module_id);
- # Delete events asociated to the module
- db_do ($dbh, 'DELETE FROM tevento WHERE id_agentmodule = ?', $module_id);
-
# Delete tags asociated to the module
db_do ($dbh, 'DELETE FROM ttag_module WHERE id_agente_modulo = ?', $module_id);
@@ -4067,8 +4064,16 @@ sub pandora_check_type_custom_field_for_itsm ($) {
##########################################################################
sub pandora_update_agent_custom_field ($$$$) {
my ($dbh, $token, $field, $id_agent) = @_;
+ my $exist_field = get_db_value($dbh, 'SELECT count(*) FROM tagent_custom_data WHERE id_field = ? AND id_agent = ?', $field, $id_agent);
my $result = undef;
- $result = db_update ($dbh, 'UPDATE tagent_custom_data SET description = ? WHERE id_field = ? AND id_agent = ?', safe_input($token), $field, $id_agent);
+
+ $token = safe_input($token);
+
+ if (!$exist_field) {
+ $result = defined(db_insert ($dbh, 'id_field', 'INSERT INTO tagent_custom_data (`description`, `id_field`, `id_agent`) VALUES (?, ?, ?)', $token, $field, $id_agent)) ? 1 : 0;
+ } else {
+ $result = db_update ($dbh, 'UPDATE tagent_custom_data SET description = ? WHERE id_field = ? AND id_agent = ?', $token, $field, $id_agent);
+ }
return $result;
}
diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
index 918d331215..3dc3d44f17 100644
--- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
+++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm
@@ -148,21 +148,23 @@ sub data_producer ($) {
WHERE id_recon_server = ?
AND disabled = 0
AND ((utimestamp = 0 AND interval_sweep != 0 OR status = 1)
- OR (status < 0 AND interval_sweep > 0 AND (utimestamp + interval_sweep) < UNIX_TIMESTAMP()))', $server_id);
+ OR (status < 0 AND interval_sweep > 0 AND (utimestamp + interval_sweep) < UNIX_TIMESTAMP())
+ OR (status < 0 AND utimestamp = 0 AND interval_sweep = 0))', $server_id);
} else {
@rows = get_db_rows ($dbh, 'SELECT * FROM trecon_task
WHERE (id_recon_server = ? OR id_recon_server NOT IN (SELECT id_server FROM tserver WHERE status = 1 AND server_type = ?))
AND disabled = 0
AND ((utimestamp = 0 AND interval_sweep != 0 OR status = 1)
- OR (status < 0 AND interval_sweep > 0 AND (utimestamp + interval_sweep) < UNIX_TIMESTAMP()))', $server_id, DISCOVERYSERVER);
+ OR (status < 0 AND interval_sweep > 0 AND (utimestamp + interval_sweep) < UNIX_TIMESTAMP())
+ OR (status < 0 AND utimestamp = 0 AND interval_sweep = 0))', $server_id, DISCOVERYSERVER);
}
foreach my $row (@rows) {
- # Discovery apps must be fully set up.
+ # Discovery apps must be fully set up.
if ($row->{'type'} == DISCOVERY_APP && $row->{'setup_complete'} != 1) {
logger($pa_config, 'Setup for recon app task ' . $row->{'id_app'} . ' not complete.', 10);
- next;
+ next;
}
# Update task status
@@ -313,13 +315,7 @@ sub data_consumer ($$) {
# Clean tmp file.
if (defined($cnf_extra{'creds_file'})
&& -f $cnf_extra{'creds_file'}) {
- unlink($cnf_extra{'creds_file'});
- }
-
-
- # Clean one shot tasks
- if ($task->{'type'} eq DISCOVERY_DEPLOY_AGENTS) {
- db_delete_limit($dbh, ' trecon_task ', ' id_rt = ? ', 1, $task->{'id_rt'});
+ unlink($cnf_extra{'creds_file'});
}
};
if ($@) {
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index 16d5e3d966..7bf9eb7d0d 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.776";
-my $pandora_build = "240402";
+my $pandora_build = "240408";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm
index 43b7db611b..fb57e2137f 100755
--- a/pandora_server/lib/PandoraFMS/Tools.pm
+++ b/pandora_server/lib/PandoraFMS/Tools.pm
@@ -612,6 +612,7 @@ sub set_file_permissions($$;$) {
my $uid = getpwnam($pa_config->{'user'});
my $gid = getgrnam($pa_config->{'group'});
my $perm = $grants & (~oct($pa_config->{'umask'}));
+ $gid = getgrnam("www-data") if (!defined($gid));
chown $uid, $gid, $file;
chmod ( $perm, $file );
@@ -647,6 +648,7 @@ sub safe_input($) {
return "" unless defined($value);
+ $value =~ s/<\/?script(.*?)>//gs;
$value =~ s/(.)/$CHR2ENT{$1}||$1/ge;
return $value;
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index e4706b79a2..1d8dffa2ec 100644
--- a/pandora_server/pandora_server.redhat.spec
+++ b/pandora_server/pandora_server.redhat.spec
@@ -7,7 +7,7 @@
%define debug_package %{nil}
%define name pandorafms_server
%define version 7.0NG.776
-%define release 240402
+%define release 240408
Summary: Pandora FMS Server
Name: %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index c3eb14aa5f..44741bb791 100644
--- a/pandora_server/pandora_server.spec
+++ b/pandora_server/pandora_server.spec
@@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.776
-%define release 240402
+%define release 240408
Summary: Pandora FMS Server
Name: %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index 88a6c7a715..acf5670d08 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.776"
-PI_BUILD="240402"
+PI_BUILD="240408"
MODE=$1
if [ $# -gt 1 ]; then
@@ -344,6 +344,8 @@ install () {
chmod 2770 $DESTDIR$PANDORA_SPOOL/data_in/commands
mkdir $DESTDIR$PANDORA_SPOOL/data_in/discovery 2> /dev/null
chmod 2770 $DESTDIR$PANDORA_SPOOL/data_in/discovery
+ mkdir $DESTDIR$PANDORA_SPOOL/data_in/agent 2> /dev/null
+ chmod 2770 $DESTDIR$PANDORA_SPOOL/data_in/agent
mkdir -p $DESTDIR$PANDORA_LOG 2> /dev/null
chown -R pandora:apache $DESTDIR$PANDORA_LOG 2> /dev/null
chmod 2774 $DESTDIR$PANDORA_LOG 2> /dev/null
@@ -435,6 +437,28 @@ install () {
then
echo cp $TENTACLE_CFG_FILE_DIST $DESTDIR$TENTACLE_CFG_DIR
cp $TENTACLE_CFG_FILE_DIST $DESTDIR$TENTACLE_CFG_DIR
+
+ # Add agents deployment filters if not added yet
+ filter_changed=0
+ tentacle_filters=$(grep -E '^\s*filters\s*.*$' "$DESTDIR$TENTACLE_CFG_FILE" | sed 's/\\/\\\\/g')
+ if ! [[ $tentacle_filters =~ \.\*\\\\\.agent_setup\\\\\.exe:agent ]]
+ then
+ sed -i -e "s/$tentacle_filters/$tentacle_filters;.*\\\\.agent_setup\\\\.exe:agent/" "$DESTDIR$TENTACLE_CFG_FILE"
+ filter_changed=1
+ fi
+ tentacle_filters=$(grep -E '^\s*filters\s*.*$' "$DESTDIR$TENTACLE_CFG_FILE" | sed 's/\\/\\\\/g')
+ if ! [[ $tentacle_filters =~ \.\*\\\\\.agent_setup\\\\\.tar\\\\\.gz:agent ]]
+ then
+ sed -i -e "s/$tentacle_filters/$tentacle_filters;.*\\\\.agent_setup\\\\.tar\\\\.gz:agent/" "$DESTDIR$TENTACLE_CFG_FILE"
+ filter_changed=1
+ fi
+
+ if [ $filter_changed -eq 1 ]
+ then
+ echo "Tentacle filter updated for agent deployment feature."
+ echo "Please restart 'tentacle_serverd' service."
+ fi
+
else
echo cp $TENTACLE_CFG_FILE_DIST $DESTDIR$TENTACLE_CFG_FILE
cp $TENTACLE_CFG_FILE_DIST $DESTDIR$TENTACLE_CFG_FILE
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index 4c8f5ca258..fb5fee841f 100755
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -38,7 +38,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
-my $version = "7.0NG.776 Build 240402";
+my $version = "7.0NG.776 Build 240408";
# Pandora server configuration
my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index 55ff28c0c5..3b43602010 100755
--- a/pandora_server/util/pandora_manage.pl
+++ b/pandora_server/util/pandora_manage.pl
@@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
-my $version = "7.0NG.776 Build 240402";
+my $version = "7.0NG.776 Build 240408";
# save program name for logging
my $progname = basename($0);
@@ -3404,9 +3404,14 @@ sub cli_agent_update_custom_fields() {
}
}
+ if(!defined($new_value)) {
+ print_log "[ERROR] Error updating field '$field' no new value has been provided\n\n";
+ exit;
+ }
+
print_log "\n[INFO] Updating field '$field' in agent with ID '$id_agent'\n\n";
- my $result = pandora_agent_update_custom_field ($dbh, $new_value, $custom_field, $id_agent);
+ my $result = pandora_update_agent_custom_field ($dbh, $new_value, $custom_field, $id_agent);
if($result == "0E0"){
print_log "[ERROR] Error updating field '$field'\n\n";
@@ -3429,6 +3434,8 @@ sub cli_agent_update() {
my @id_agents;
my $id_agent;
+ $new_value = safe_input($new_value);
+
if (defined $use_alias and $use_alias eq 'use_alias') {
@id_agents = get_agent_ids_from_alias($dbh,$agent_name);
foreach my $id (@id_agents) {
@@ -7914,7 +7921,7 @@ sub pandora_manage_main ($$$) {
'values' => [
'unknown','alert_fired','alert_recovered','alert_ceased',
'alert_manual_validation','recon_host_detected','system',
- 'error','new_agent','going_up_warning','going_up_critical','going_down_warning',
+ 'error','new_agent','going_up_warning','going_up_critical','going_down_warning','going_unknown',
'going_down_normal','going_down_critical','going_up_normal','configuration_change'
]
},
|
|