diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 8068ea3303..a8a8514d20 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.711-170905 +Version: 7.0NG.711-170906 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 0987a7a923..5e859fa3c2 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.711-170905" +pandora_version="7.0NG.711-170906" 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 e67a8c1774..b36de769fc 100755 --- 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 => '7.0NG.711'; -use constant AGENT_BUILD => '170905'; +use constant AGENT_BUILD => '170906'; # 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 d6fdf45121..0a5964607b 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.711 -%define release 170905 +%define release 170906 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 442bd48403..a24c6a455e 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.711 -%define release 170905 +%define release 170906 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 24612a3848..c68f503fee 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.711" -PI_BUILD="170905" +PI_BUILD="170906" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index d11fdacd17..60f02faf4c 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{170905} +{170906} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 4e00aaa0f2..4b155a0ee4 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.711(Build 170905)") +#define PANDORA_VERSION ("7.0NG.711(Build 170906)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index df6b7601b1..87c636d4fa 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.711(Build 170905))" + VALUE "ProductVersion", "(7.0NG.711(Build 170906))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 2dc9603a7d..c627b98034 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.711-170905 +Version: 7.0NG.711-170906 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 b1f321fa1d..6a172b1dc2 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.711-170905" +pandora_version="7.0NG.711-170906" package_pear=0 package_pandora=1 diff --git a/pandora_console/extras/mr/6.sql b/pandora_console/extras/mr/6.sql index 30b99f7b30..7ccf0793b4 100644 --- a/pandora_console/extras/mr/6.sql +++ b/pandora_console/extras/mr/6.sql @@ -14,7 +14,7 @@ ALTER TABLE tserver ADD COLUMN exec_proxy tinyint(1) UNSIGNED NOT NULL default 0 ALTER TABLE tevent_response ADD COLUMN server_to_exec int(10) unsigned NOT NULL DEFAULT 0; -INSERT INTO tmodule VALUES (8, 'Wux module'); +INSERT INTO tmodule VALUES (8, 'Wux module'); INSERT INTO ttipo_modulo VALUES (25,'web_analysis', 8, 'Web analysis data', 'module-wux.png'); diff --git a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql index e27c1433d3..c5012eac00 100644 --- a/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql +++ b/pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql @@ -1431,7 +1431,7 @@ ALTER TABLE tevent_response ADD COLUMN server_to_exec int(10) unsigned NOT NULL -- Table `tmodule` -- --------------------------------------------------------------------- -INSERT INTO tmodule VALUES (8, 'Wux module'); +INSERT INTO tmodule VALUES (8, 'Wux module'); -- --------------------------------------------------------------------- -- Table `ttipo_modulo` diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index f3b8a76773..fd8c4492e8 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -263,6 +263,7 @@ $params['hidden_input_idagent_value'] = $id_parent; $params['value'] = db_get_value ("alias","tagente","id_agente",$id_parent); $params['selectbox_id'] = 'cascade_protection_module'; $params['javascript_is_function_select'] = true; +$params['cascade_protection'] = true; $table->data[3][1] = ui_print_agent_autocomplete_input($params); 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 ed3334e5dd..f422f1ea40 100644 --- a/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php +++ b/pandora_console/godmode/agentes/agent_wizard.snmp_interfaces_explorer.php @@ -204,6 +204,7 @@ if ($create_modules) { $ifPhysAddress = $interfaces[$id]['ifPhysAddress']['value']; $ifPhysAddress = strtoupper($ifPhysAddress); } + foreach ($modules as $module) { $oid_array = explode('.', $module); $oid_array[count($oid_array) - 1] = $id; @@ -212,7 +213,7 @@ if ($create_modules) { // Get the name $name_array = explode('::', $oid_array[0]); $name = $ifname . "_" . $name_array[1]; - + // Clean the name $name = str_replace ( "\"" , "" , $name); @@ -262,18 +263,50 @@ if ($create_modules) { $row = db_get_row_sql ($sql); if ($row['server_type'] == 13) { - if (preg_match ("/Status/", $name_array[1])) { + if (preg_match ("/ifPhysAddress/", $name_array[1])) { + $module_type = 3; + } + elseif (preg_match ("/ifSpecific/", $name_array[1])) { + $module_type = 3; + } + elseif (preg_match("/ifType/", $name_array[1])) { + $module_type = 1; + } + elseif (preg_match("/ifSpeed/", $name_array[1])) { + $module_type = 1; + } + elseif (preg_match("/ifPromiscuousMode/", $name_array[1])) { $module_type = 2; } - elseif (preg_match ("/Present/", $name_array[1])) { + elseif (preg_match("/ifOutQLen/", $name_array[1])) { + $module_type = 1; + } + elseif (preg_match("/ifName/", $name_array[1])) { + $module_type = 3; + } + elseif (preg_match("/ifMtu/", $name_array[1])) { + $module_type = 1; + } + elseif (preg_match("/ifLinkUpDownTrapEnable/", $name_array[1])) { + $module_type = 1; + } + elseif (preg_match("/ifLastChange/", $name_array[1])) { + $module_type = 1; + } + elseif (preg_match("/ifIndex/", $name_array[1])) { + $module_type = 1; + } + elseif (preg_match("/ifDescr/", $name_array[1])) { + $module_type = 3; + } + elseif (preg_match("/ifCounterDiscontinuityTime/", $name_array[1])) { + $module_type = 1; + } + elseif (preg_match("/ifConnectorPresent/", $name_array[1])) { $module_type = 2; } - elseif (preg_match("/PromiscuousMode/", $name_array[1])) { + elseif (preg_match("/ifAdminStatus/", $name_array[1])) { $module_type = 2; - } - // Specific counters (ends in s) - elseif (preg_match("/s$/", $name_array[1])) { - $module_type = 4; } else { $module_type = 4; @@ -281,10 +314,12 @@ if ($create_modules) { $module_server = 1; + $output_oid = ""; + exec("ssh pandora_exec_proxy@" . $row['ip_address'] . " snmptranslate -On " . $oid, $output_oid, $rc); - $conf_iod = $output_oid[0]; - $oid = $conf_iod; + $conf_oid = $output_oid[0]; + $oid = $conf_oid; } } @@ -322,7 +357,7 @@ if ($create_modules) { if ($row['server_type'] == 13) { $module_type_name = db_get_value_filter("nombre", "ttipo_modulo", array("id_tipo" => $values['id_tipo_modulo'])); - $new_module_configuration_data = "module_begin\nmodule_name " . io_safe_input($name) . "\nmodule_description " . $values['descripcion'] . "\nmodule_type " . $module_type_name . "\nmodule_snmp\nmodule_oid " . $conf_iod . "\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_oid " . $conf_oid . "\nmodule_community " . $values['snmp_community'] . "\nmodule_end"; config_agents_add_module_in_conf($id_agent, $new_module_configuration_data); } diff --git a/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php b/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php index 4fdfa9e071..296530c5c2 100644 --- a/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php +++ b/pandora_console/godmode/agentes/agent_wizard.wmi_explorer.php @@ -196,6 +196,15 @@ if ($create_modules) { 'plugin_pass' => $plugin_pass, 'id_modulo' => MODULE_WMI); + if ($server_to_exec != 0) { + $sql = sprintf("SELECT server_type FROM tserver WHERE id_server = %d", $server_to_exec); + $row = db_get_row_sql ($sql); + + if ($row['server_type'] == 13) { + $values['id_modulo'] = 1; + } + } + // Create Service modules $services_values = $values; diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 1490b65dc7..89bbd3659b 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 = 'PC170905'; +$build_version = 'PC170906'; $pandora_version = 'v7.0NG.711'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 055cdaa351..de10fcaf91 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -2951,6 +2951,11 @@ function ui_print_agent_autocomplete_input($parameters) { if (isset($parameters['from_wux'])) { $from_wux_transaction = $parameters['from_wux']; } + + $cascade_protection = false; //Default value + if (isset($parameters['cascade_protection'])) { + $cascade_protection = $parameters['cascade_protection']; + } $metaconsole_enabled = false; //Default value if (isset($parameters['metaconsole_enabled'])) { @@ -3149,7 +3154,9 @@ function ui_print_agent_autocomplete_input($parameters) { .append ($("") .attr("value", val["id_agente_modulo"]).text (s)); }); - + if('. (int)$cascade_protection .' == 0){ + $("#' . $selectbox_id . '").enable(); + } $("#' . $selectbox_id . '").fadeIn ("normal"); } }); diff --git a/pandora_console/include/functions_wmi.php b/pandora_console/include/functions_wmi.php index b694bf03cb..7930116b83 100644 --- a/pandora_console/include/functions_wmi.php +++ b/pandora_console/include/functions_wmi.php @@ -75,6 +75,9 @@ function wmi_create_wizard_modules($id_agent, $names, $wizard_mode, $values, $id $values['snmp_oid'] = io_safe_input($wmi_query); if($id_police != 0){ + $new_module_configuration_data = "module_begin\nmodule_name " . $name . "\nmodule_type generic_data_string\nmodule_wmi " . $values['ip_target'] . "\nmodule_wmiquery " . $wmi_query . "\nmodule_wmiauth " . $values['plugin_user'] . "%" . $values['plugin_pass'] . "\nmodule_end"; + $values['configuration_data'] = $new_module_configuration_data; + $return = policies_create_module ($name, $id_police, $module_id, $values); } else{ @@ -161,6 +164,9 @@ function wmi_create_module_from_components($components, $values, $id_police=0, $ $id_agente_modulo = modules_create_agent_module($nc["id_agente"], $nc["nombre"], $nc); } else{ + $new_module_configuration_data = "module_begin\nmodule_name " . $nc['nombre'] . "\nmodule_type generic_data_string\nmodule_wmi " . $values['ip_target'] . "\nmodule_wmiquery " . io_safe_output($nc['snmp_oid']) . "\nmodule_wmiauth " . $values['plugin_user'] . "%" . $values['plugin_pass'] . "\nmodule_end"; + $nc['configuration_data'] = $new_module_configuration_data; + $id_agente_modulo = policies_create_module ($nc["name"], $id_police, $module_id, $nc); } diff --git a/pandora_console/install.php b/pandora_console/install.php index 005885c59c..c43cecf134 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@