From aafd6d56ca8ddbfd3ec88f5d54a4907c8aafefc5 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Wed, 2 Sep 2015 16:20:51 +0200 Subject: [PATCH 1/4] Encrypt hidden plug-in module macros. --- pandora_console/godmode/agentes/configurar_agente.php | 6 +++++- .../godmode/agentes/module_manager_editor_plugin.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index dba941323c..3b74ef3529 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -886,7 +886,11 @@ if ($update_module || $create_module) { $macros = json_decode(base64_decode($macros), true); foreach($macros as $k => $m) { - $macros[$k]['value'] = get_parameter($m['macro'], ''); + if ($m['hide'] == "1") { + $macros[$k]['value'] = io_input_password(get_parameter($m['macro'], '')); + } else { + $macros[$k]['value'] = get_parameter($m['macro'], ''); + } } $macros = io_json_mb_encode($macros); diff --git a/pandora_console/godmode/agentes/module_manager_editor_plugin.php b/pandora_console/godmode/agentes/module_manager_editor_plugin.php index d603a5c9c5..f2326baa42 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_plugin.php +++ b/pandora_console/godmode/agentes/module_manager_editor_plugin.php @@ -90,7 +90,7 @@ if (!empty($macros)) { $m_hide = $m['hide']; if ($m_hide) { - $data[1] = html_print_input_password($m['macro'], $m['value'], '', 100, 255, true); + $data[1] = html_print_input_password($m['macro'], io_output_password($m['value']), '', 100, 255, true); } else { $data[1] = html_print_input_text($m['macro'], $m['value'], '', 100, 255, true); From 285aba895f2c29251b4ba50a72d80e5c6e5cc24f Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 3 Sep 2015 00:01:11 +0200 Subject: [PATCH 2/4] Auto-updated build strings. --- 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/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_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index d644e781c4..52b5f59380 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0RC1-150902 +Version: 6.0RC1-150903 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 edf032f3bc..3519670f0c 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="6.0RC1-150902" +pandora_version="6.0RC1-150903" 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 b5be95fb73..dca8a1abf3 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0RC1'; -use constant AGENT_BUILD => '150902'; +use constant AGENT_BUILD => '150903'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index ad455a78df..b0adec52c7 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 6.0RC1 -%define release 150902 +%define release 150903 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 a1e5e6b959..98fa2dfdda 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 6.0RC1 -%define release 150902 +%define release 150903 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 299353f0fb..3dc9395332 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150902} +{150903} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index a984647375..0137eff186 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 ("6.0RC1(Build 150902)") +#define PANDORA_VERSION ("6.0RC1(Build 150903)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index e9f3c23574..fd8f27c58b 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", "(6.0RC1(Build 150902))" + VALUE "ProductVersion", "(6.0RC1(Build 150903))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 9049ac6563..4c78699cd8 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0RC1-150902 +Version: 6.0RC1-150903 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 120ccd56c1..f7745c5b8c 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="6.0RC1-150902" +pandora_version="6.0RC1-150903" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 7cd9b2c040..a976f55350 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150902'; +$build_version = 'PC150903'; $pandora_version = 'v6.0RC1'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 69e0d73447..b7505ccfc2 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@
Date: Thu, 3 Sep 2015 12:31:53 +0200 Subject: [PATCH 3/4] Solved timeout problem in plugin modules --- .../win32/modules/pandora_module_factory.cc | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/pandora_agents/win32/modules/pandora_module_factory.cc b/pandora_agents/win32/modules/pandora_module_factory.cc index 338b7505d5..049bf6f152 100644 --- a/pandora_agents/win32/modules/pandora_module_factory.cc +++ b/pandora_agents/win32/modules/pandora_module_factory.cc @@ -36,7 +36,7 @@ #include "pandora_module_tcpcheck.h" #include "pandora_module_regexp.h" #include "pandora_module_plugin.h" -#include "pandora_module_ping.h" +#include "pandora_module_ping.h" #include "pandora_module_snmpget.h" #include "../pandora_strutils.h" #include @@ -97,14 +97,14 @@ using namespace Pandora_Strutils; #define TOKEN_PING ("module_ping ") #define TOKEN_PING_COUNT ("module_ping_count ") #define TOKEN_PING_TIMEOUT ("module_ping_timeout ") -#define TOKEN_SNMPGET ("module_snmpget") -#define TOKEN_SNMPVERSION ("module_snmp_version ") -#define TOKEN_SNMPCOMMUNITY ("module_snmp_community ") -#define TOKEN_SNMPAGENT ("module_snmp_agent ") +#define TOKEN_SNMPGET ("module_snmpget") +#define TOKEN_SNMPVERSION ("module_snmp_version ") +#define TOKEN_SNMPCOMMUNITY ("module_snmp_community ") +#define TOKEN_SNMPAGENT ("module_snmp_agent ") #define TOKEN_SNMPOID ("module_snmp_oid ") #define TOKEN_ADVANCEDOPTIONS ("module_advanced_options ") #define TOKEN_INTENSIVECONDITION ("module_intensive_condition ") -#define TOKEN_UNIT ("module_unit ") +#define TOKEN_UNIT ("module_unit ") #define TOKEN_MODULE_GROUP ("module_group ") #define TOKEN_CUSTOM_ID ("module_custom_id ") #define TOKEN_STR_WARNING ("module_str_warning ") @@ -164,13 +164,13 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) { string module_crontab, module_cron_interval, module_post_process; string module_min_critical, module_max_critical, module_min_warning, module_max_warning; string module_disabled, module_min_ff_event, module_noseekeof; - string module_ping, module_ping_count, module_ping_timeout; + string module_ping, module_ping_count, module_ping_timeout; string module_snmpget, module_snmp_version, module_snmp_community, module_snmp_agent, module_snmp_oid; string module_advanced_options, module_cooked, module_intensive_condition; string module_unit, module_group, module_custom_id, module_str_warning, module_str_critical; string module_critical_instructions, module_warning_instructions, module_unknown_instructions, module_tags; string module_critical_inverse, module_warning_inverse, module_quiet, module_ff_interval; - string macro; + string macro; Pandora_Module *module; bool numeric; Module_Type type; @@ -226,11 +226,11 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) { module_ping = ""; module_ping_count = ""; module_ping_timeout = ""; - module_snmpget = ""; - module_snmp_version = ""; - module_snmp_community = ""; - module_snmp_agent = ""; - module_snmp_oid = ""; + module_snmpget = ""; + module_snmp_version = ""; + module_snmp_community = ""; + module_snmp_agent = ""; + module_snmp_oid = ""; module_advanced_options = ""; module_cooked = ""; module_intensive_condition = ""; @@ -428,7 +428,7 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) { } if (module_snmp_version == "") { module_snmp_version = parseLine (line, TOKEN_SNMPVERSION); - } + } if (module_snmp_community == "") { module_snmp_community = parseLine (line, TOKEN_SNMPCOMMUNITY); } @@ -1143,6 +1143,9 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) { module = new Pandora_Module_Regexp (module_name, module_regexp, module_pattern, (unsigned char) atoi (module_noseekeof.c_str ())); } else if (module_plugin != "") { module = new Pandora_Module_Plugin (module_name, module_plugin); + if (module_timeout != ""){ + module->setTimeout(atoi(module_timeout.c_str())); + } } else if (module_ping != "") { if (module_ping_count == "") { module_ping_count = "1"; @@ -1154,17 +1157,17 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) { module = new Pandora_Module_Ping (module_name, module_ping, module_ping_count, module_ping_timeout, module_advanced_options); if (module_timeout != "") { module->setTimeout (atoi (module_timeout.c_str ())); - } - } else if (module_snmpget != "") { + } + } else if (module_snmpget != "") { if (module_snmp_version == "") { module_snmp_version = "1"; - } + } if (module_snmp_community == "") { module_snmp_community = "public"; - } + } if (module_snmp_agent == "") { module_snmp_agent = "localhost"; - } + } module = new Pandora_Module_SNMPGet (module_name, module_snmp_version, module_snmp_community, module_snmp_agent, module_snmp_oid, module_advanced_options); if (module_timeout != "") { From f9048fe0ab03e899e5d84df81666d836a7c768ae Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 4 Sep 2015 00:01:10 +0200 Subject: [PATCH 4/4] Auto-updated build strings. --- 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/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_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 52b5f59380..2a3854d84c 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 6.0RC1-150903 +Version: 6.0RC1-150904 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 3519670f0c..6145f57a2c 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="6.0RC1-150903" +pandora_version="6.0RC1-150904" 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 dca8a1abf3..84c35712ca 100644 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '6.0RC1'; -use constant AGENT_BUILD => '150903'; +use constant AGENT_BUILD => '150904'; # Commands to retrieve total memory information in kB use constant TOTALMEMORY_CMDS => { diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index b0adec52c7..96ec80c419 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 6.0RC1 -%define release 150903 +%define release 150904 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 98fa2dfdda..c5efab8c78 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 6.0RC1 -%define release 150903 +%define release 150904 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 3dc9395332..fba0adc5b0 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{150903} +{150904} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 0137eff186..27f6034572 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 ("6.0RC1(Build 150903)") +#define PANDORA_VERSION ("6.0RC1(Build 150904)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index fd8f27c58b..934ed955b1 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", "(6.0RC1(Build 150903))" + VALUE "ProductVersion", "(6.0RC1(Build 150904))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 4c78699cd8..bff4c8a9ab 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 6.0RC1-150903 +Version: 6.0RC1-150904 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 f7745c5b8c..a86e07df31 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="6.0RC1-150903" +pandora_version="6.0RC1-150904" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a976f55350..1a65303f1d 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ /** * Pandora build version and version */ -$build_version = 'PC150903'; +$build_version = 'PC150904'; $pandora_version = 'v6.0RC1'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index b7505ccfc2..46bdc45fb1 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -63,7 +63,7 @@