From c1aaacbc07fced4a454515e58837caab7bd3425c Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 26 Feb 2019 18:16:10 +0100 Subject: [PATCH 01/16] minor updates in plugintools Former-commit-id: 85d3d6a099d4b08b1d79d996157e1725e3414809 --- pandora_server/lib/PandoraFMS/PluginTools.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 41cb56f39b..3acc32eb1e 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -2018,6 +2018,12 @@ sub snmp_walk { $timeout = $snmp->{timeout}; } + if ($^O =~ /lin/i && "`which snmpwalk`" eq "") { + return { + 'error' => 'snmpwalk not found' + }; + } + $snmp->{extra} = '' unless defined $snmp->{extra}; if ( defined ($snmp->{version} ) @@ -2131,6 +2137,12 @@ sub snmp_get { $timeout = $snmp->{timeout}; } + if ($^O =~ /lin/i && "`which snmpwalk`" eq "") { + return { + 'error' => 'snmpwalk not found' + }; + } + $snmp->{extra} = '' unless defined $snmp->{extra}; if ( defined ($snmp->{version} ) From 96d6e12546ff4150536c1d648cf826a93fab7ec3 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 12 Mar 2019 16:12:58 +0100 Subject: [PATCH 02/16] disable cache for events_comment Former-commit-id: 4a3477e1911d7d5cc02ac5207ccc30cb43e7f220 --- pandora_console/include/functions_events.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index e320f235ae..dc69af7baf 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -701,19 +701,20 @@ function events_comment( $first_event = reset($id_event); } - $event_comments = db_get_value( - 'user_comment', - $event_table, - 'id_evento', - $first_event + $event_comments = mysql_db_process_sql( + 'SELECT user_comment FROM '.$event_table.' WHERE id_evento = '.$first_event, + 'affected_rows', + '', + false ); + $event_comments_array = []; - if ($event_comments == '') { + if ($event_comments[0]['user_comment'] == '') { $comments_format = 'new'; } else { // If comments are not stored in json, the format is old. - $event_comments_array = json_decode($event_comments); + $event_comments_array = json_decode($event_comments[0]['user_comment']); if (empty($event_comments_array)) { $comments_format = 'old'; From a8af2f89d1519d514e9a604bea5e724324c252a5 Mon Sep 17 00:00:00 2001 From: samucarc Date: Tue, 12 Mar 2019 17:59:52 +0100 Subject: [PATCH 03/16] Fixed data type to remote_snmp_proc in modules IfOperSttus Former-commit-id: 40a9c5ec26449c13d01f232504c4e9a02b2e366b --- .../godmode/agentes/agent_wizard.snmp_interfaces_explorer.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php index f4c432cb7a..af9ee09294 100644 --- a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php +++ b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php @@ -321,6 +321,8 @@ if ($create_modules) { $module_type = 2; } else if (preg_match('/ifAdminStatus/', $name_array[1])) { $module_type = 2; + } else if (preg_match('/ifOperStatus/', $name_array[1])) { + $module_type = 18; } else { $module_type = 4; } From 1276eb3ecf50ca279b67dd5c7e498e36ce7ac698 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Wed, 13 Mar 2019 11:57:37 +0100 Subject: [PATCH 04/16] Add module version line to config module configuration data Former-commit-id: 1a60f3a75f986f65cc8a4e40daf6311ce0148066 --- .../godmode/agentes/agent_wizard.snmp_interfaces_explorer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php index f4c432cb7a..2eb1454f72 100644 --- a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php +++ b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php @@ -367,7 +367,7 @@ if ($create_modules) { if ($row['server_type'] == 13) { $module_type_name = db_get_value_filter('nombre', 'ttipo_modulo', ['id_tipo' => $values['id_tipo_modulo']]); - $new_module_configuration_data = "module_begin\nmodule_name ".io_safe_input($name)."\nmodule_description ".io_safe_output($values['descripcion'])."\nmodule_type ".$module_type_name."\nmodule_snmp\nmodule_oid ".$conf_oid."\nmodule_community ".$values['snmp_community']."\nmodule_end"; + $new_module_configuration_data = "module_begin\nmodule_name ".io_safe_input($name)."\nmodule_description ".io_safe_output($values['descripcion'])."\nmodule_type ".$module_type_name."\nmodule_snmp\nmodule_version ".$snmp_version."\nmodule_oid ".$conf_oid."\nmodule_community ".$values['snmp_community']."\nmodule_end"; config_agents_add_module_in_conf($id_agent, $new_module_configuration_data); } From 0ccbb1198adf86f5c842937e75fc062cbc33fb5e Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 14 Mar 2019 00:01:25 +0100 Subject: [PATCH 05/16] Auto-updated build strings. Former-commit-id: 9f80809f181718d9c5fe97439b4d23c856bf9c93 --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index b4a1487f25..ec327aabc0 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.732-190313 +Version: 7.0NG.732-190314 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 0481649acd..5286cd16ab 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.732-190313" +pandora_version="7.0NG.732-190314" 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 025c7ff0ef..fdf147172d 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -42,7 +42,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.732'; -use constant AGENT_BUILD => '190313'; +use constant AGENT_BUILD => '190314'; # 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 e066d9b3b6..b6d75b3c2a 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.732 -%define release 190313 +%define release 190314 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 b9017687a1..bf481fa04a 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.732 -%define release 190313 +%define release 190314 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 4f0011c733..10e2097b16 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.732" -PI_BUILD="190313" +PI_BUILD="190314" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 09defbca4a..421ec7f25a 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{190313} +{190314} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index f566961adb..9a3fddd184 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.732(Build 190313)") +#define PANDORA_VERSION ("7.0NG.732(Build 190314)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 472d9723ce..cbdf566325 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.732(Build 190313))" + VALUE "ProductVersion", "(7.0NG.732(Build 190314))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index b28bde0506..e8bfac8695 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.732-190313 +Version: 7.0NG.732-190314 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 a000b443a0..c4042c2f79 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.732-190313" +pandora_version="7.0NG.732-190314" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a3a2f4662e..27dd2bba37 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -20,7 +20,7 @@ /** * Pandora build version and version */ -$build_version = 'PC190313'; +$build_version = 'PC190314'; $pandora_version = 'v7.0NG.732'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index c83ac86528..fe900f3a55 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -129,7 +129,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index b72c6fba9c..5184e20b58 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.732 -%define release 190313 +%define release 190314 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index ef34f29d11..b1ca95fbf3 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.732 -%define release 190313 +%define release 190314 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 85d5e4023c..575bd0421f 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.732" -PI_BUILD="190313" +PI_BUILD="190314" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 3db44fae7b..b6f271f955 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.732 PS190313"; +my $version = "7.0NG.732 PS190314"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 61817bc6e9..aa5df25643 100644 --- 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.732 PS190313"; +my $version = "7.0NG.732 PS190314"; # save program name for logging my $progname = basename($0); From a1aa480421822540aa81aef4262105732b2038d8 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Thu, 14 Mar 2019 18:04:28 +0100 Subject: [PATCH 06/16] add delete files in update manager Former-commit-id: 880dfc8079e7e85fa1fcba4746927caf1a2d2c06 --- .../update_manager/update_manager.offline.php | 47 +++-- .../include/ajax/update_manager.ajax.php | 183 ++++++++++++++++-- .../include/functions_update_manager.php | 104 ++++++++-- .../include/javascript/update_manager.js | 122 +++++++++++- pandora_console/include/styles/pandora.css | 12 ++ 5 files changed, 419 insertions(+), 49 deletions(-) diff --git a/pandora_console/godmode/update_manager/update_manager.offline.php b/pandora_console/godmode/update_manager/update_manager.offline.php index 79f9a72d2e..24da1a341f 100644 --- a/pandora_console/godmode/update_manager/update_manager.offline.php +++ b/pandora_console/godmode/update_manager/update_manager.offline.php @@ -1,23 +1,39 @@ - +