diff --git a/extras/pandora_update_version.sh b/extras/pandora_update_version.sh index 1953c7c834..6716f06701 100755 --- a/extras/pandora_update_version.sh +++ b/extras/pandora_update_version.sh @@ -54,22 +54,25 @@ AGENT_WIN_FILE="$CODEHOME/pandora_agents/win32/pandora.cc" AGENT_WIN_MPI_FILE="$CODEHOME/pandora_agents/win32/installer/pandora.mpi" AGENT_WIN_RC_FILE="$CODEHOME/pandora_agents/win32/versioninfo.rc" SATELLITE_FILE="$PANDHOME_ENT/satellite_server/satellite_server.pl" -PERL_PLUGIN_FILES="$PANDHOME_ENT/pandora_plugins/NGINX/nginx_requests_queued.pl \ +PERL_PLUGIN_FILES="$PANDHOME_ENT/pandora_server/util/plugin/vmware-plugin.pl \ +$PANDHOME_ENT/pandora_plugins/NGINX/nginx_requests_queued.pl \ $PANDHOME_ENT/pandora_plugins/Sybase/sybase_plugin.pl \ -$PANDHOME_ENT/pandora_plugins/JMX/pandora_plugin_jmx.pl \ +$PANDHOME_ENT/pandora_plugins/SNMP/dynamic_snmp.pl \ +$PANDHOME_ENT/pandora_plugins/SNMP/snmp_bandwith.pl \ +$PANDHOME_ENT/pandora_plugins/laboratory/cacti/cacti2pandora.pl \ $PANDHOME_ENT/pandora_plugins/MarkLogic/pandora_marklogic.pl \ +$PANDHOME_ENT/pandora_plugins/MySQL/pandora_mysql.pl \ +$PANDHOME_ENT/pandora_plugins/JMX/pandora_plugin_jmx.pl \ $PANDHOME_ENT/pandora_plugins/Apache/pandora_apache.pl \ +$PANDHOME_ENT/pandora_plugins/UX/pandora_ux.pl \ $PANDHOME_ENT/pandora_plugins/Oracle/Database/pandora_oracle.pl \ $PANDHOME_ENT/pandora_plugins/OpenNebula/pandora_opennebula.pl \ $PANDHOME_ENT/pandora_plugins/Nutanix/pandora_nutanix.pl \ $PANDHOME_ENT/pandora_plugins/MTL/pandora_mtl.pl \ $PANDHOME_ENT/pandora_plugins/Informix/informix.pl \ -$PANDHOME_ENT/pandora_plugins/Ruckus/ruckus.pl \ -$PANDHOME_ENT/pandora_plugins/UX/pandora_ux.pl \ -$PANDHOME_ENT/pandora_plugins/JMX/pandora_plugin_jmx.pl \ -$PANDHOME_ENT/pandora_plugins/SNMP/dynamic_snmp.pl \ -$PANDHOME_ENT/pandora_plugins/MySQL/pandora_mysql.pl \ -$PANDHOME_ENT/pandora_server/util/plugin/vmware-plugin.pl " +$PANDHOME_ENT/pandora_plugins/Docker/docker_services.pl \ +$PANDHOME_ENT/pandora_plugins/Docker/docker_stats.pl \ +$PANDHOME_ENT/pandora_plugins/Ruckus/ruckus.pl " PLUGIN_LIB_FILE="$CODEHOME/pandora_server/lib/PandoraFMS/PluginTools.pm" # Update version in spec files diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index d9109f2074..e58836055a 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.724-180625 +Version: 7.0NG.724-180628 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 e655825fe2..5f515ecba6 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.724-180625" +pandora_version="7.0NG.724-180628" 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 93901f8435..984b9f9d69 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.724'; -use constant AGENT_BUILD => '180625'; +use constant AGENT_BUILD => '180628'; # 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 53d6134266..a50cf44c05 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.724 -%define release 180625 +%define release 180628 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 c792749104..f1a0d5328e 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.724 -%define release 180625 +%define release 180628 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 092c52e329..4470de6b1c 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.724" -PI_BUILD="180625" +PI_BUILD="180628" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 95688a4420..3a077eee4d 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180625} +{180628} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 2893256bd9..cc9f79dc3a 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.724(Build 180625)") +#define PANDORA_VERSION ("7.0NG.724(Build 180628)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index f6c2ea0adf..b8946a07ab 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.724(Build 180625))" + VALUE "ProductVersion", "(7.0NG.724(Build 180628))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 8a6a5e18d9..9bf28c3d24 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.724-180625 +Version: 7.0NG.724-180628 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 39b88f3a65..53cd8083a8 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.724-180625" +pandora_version="7.0NG.724-180628" package_pear=0 package_pandora=1 diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php index a723844d40..1a8e17965d 100644 --- a/pandora_console/extensions/realtime_graphs.php +++ b/pandora_console/extensions/realtime_graphs.php @@ -110,8 +110,8 @@ function pandora_realtime_graphs () { $refresh_fields[30000] = human_time_description_raw(30, true, 'large'); if ($graph == 'snmp_module') { - $agent_alias = get_parameter('agent_alias', ''); - $module_name = get_parameter('module_name', ''); + $agent_alias = io_safe_output(get_parameter('agent_alias', '')) ; + $module_name = io_safe_output(get_parameter('module_name', '')) ; $module_incremental = get_parameter ('incremental', 0); $data['module_info'] = "$agent_alias: $module_name"; diff --git a/pandora_console/extras/mr/18.sql b/pandora_console/extras/mr/18.sql new file mode 100644 index 0000000000..b7e4be33e0 --- /dev/null +++ b/pandora_console/extras/mr/18.sql @@ -0,0 +1,13 @@ +START TRANSACTION; + +ALTER TABLE `tservice` ADD COLUMN `quiet` tinyint(1) NOT NULL DEFAULT '0'; +ALTER TABLE `tservice` ADD COLUMN `cps` int NOT NULL DEFAULT '0'; +ALTER TABLE `tservice` ADD COLUMN `cascade_protection` tinyint(1) NOT NULL DEFAULT '0'; + +ALTER TABLE `tagente` ADD COLUMN `cps` int NOT NULL DEFAULT '0'; + +ALTER TABLE `tmetaconsole_agent` ADD COLUMN `cps` int NOT NULL DEFAULT '0'; + +ALTER TABLE `tagente_modulo` ADD COLUMN `cps` int NOT NULL DEFAULT '0'; + +COMMIT; \ No newline at end of file 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 91e0dc5e65..6752754a5c 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 @@ -395,7 +395,7 @@ CREATE TABLE IF NOT EXISTS `tservice` ( `id_template_alert_warning` int(10) unsigned NOT NULL default 0, `id_template_alert_critical` int(10) unsigned NOT NULL default 0, `id_template_alert_unknown` int(10) unsigned NOT NULL default 0, - `id_template_alert_critical_sla` int(10) unsigned NOT NULL default 0, + `id_template_alert_critical_sla` int(10) unsigned NOT NULL default 0 PRIMARY KEY (`id`) ) ENGINE=InnoDB COMMENT = 'Table to define services to monitor' @@ -1175,7 +1175,7 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned; INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); -INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 17); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 18); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); @@ -1229,6 +1229,7 @@ ALTER TABLE tusuario ADD COLUMN `time_autorefresh` int(5) unsigned NOT NULL defa ALTER TABLE tagente_modulo ADD COLUMN `dynamic_next` bigint(20) NOT NULL default '0'; ALTER TABLE tagente_modulo ADD COLUMN `dynamic_two_tailed` tinyint(1) unsigned default '0'; ALTER TABLE tagente_modulo ADD COLUMN `parent_module_id` int(10) unsigned NOT NULL; +ALTER TABLE `tagente_modulo` ADD COLUMN `cps` int NOT NULL default 0; -- --------------------------------------------------------------------- -- Table `tagente_datos` @@ -1258,8 +1259,17 @@ ALTER TABLE tagente ADD COLUMN `cascade_protection_module` int(10) unsigned NOT ALTER TABLE tagente ADD COLUMN (alias varchar(600) not null default ''); ALTER TABLE tagente ADD `alias_as_name` int(2) unsigned default '0'; ALTER TABLE tagente ADD COLUMN `safe_mode_module` int(10) unsigned NOT NULL default '0'; +ALTER TABLE `tagente` ADD COLUMN `cps` int NOT NULL default 0; UPDATE tagente SET tagente.alias = tagente.nombre; + +-- --------------------------------------------------------------------- +-- Table `tservice` +-- --------------------------------------------------------------------- +ALTER TABLE `tservice` ADD COLUMN `quiet` tinyint(1) NOT NULL default 0; +ALTER TABLE `tservice` ADD COLUMN `cps` int NOT NULL default 0; +ALTER TABLE `tservice` ADD COLUMN `cascade_protection` tinyint(1) NOT NULL default 0; + -- --------------------------------------------------------------------- -- Table `tlayout` -- --------------------------------------------------------------------- @@ -1353,6 +1363,7 @@ ALTER TABLE tmetaconsole_agent ADD COLUMN `transactional_agent` tinyint(1) NOT N ALTER TABLE tmetaconsole_agent ADD COLUMN `alias` VARCHAR(600) not null DEFAULT ''; ALTER TABLE tmetaconsole_agent ADD COLUMN `alias_as_name` int(2) unsigned default '0'; ALTER TABLE tmetaconsole_agent ADD COLUMN `safe_mode_module` int(10) unsigned NOT NULL default '0'; +ALTER TABLE `tmetaconsole_agent` ADD COLUMN `cps` int NOT NULL default 0; UPDATE `tmetaconsole_agent` SET tmetaconsole_agent.alias = tmetaconsole_agent.nombre; -- --------------------------------------------------------------------- diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 791f09d2ab..5879790d57 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -515,9 +515,24 @@ $table->data[4][3] = html_print_input_text ('url_description', $url_description, '', 45, 255, true); $table->data[5][2] = __('Quiet'); -$table->data[5][3] = ui_print_help_tip( - __('The agent still runs but the alerts and events will be stop'), true); -$table->data[5][3] .= html_print_checkbox('quiet', 1, $quiet, true); +$table->data[5][3] .= ui_print_help_tip(__('The agent still runs but the alerts and events will be stop'), true); +$table->data[5][3] = html_print_checkbox('quiet', 1, $quiet, true); + +$cps_array[-1] = __('Disabled'); +if($cps > 0){ + $cps_array[$cps] = __('Enabled'); +} +else{ + $cps_inc = 0; + if($id_agente){ + $cps_inc = service_agents_cps($id_agente); + } + $cps_array[$cps_inc] = __('Enabled'); +} + +$table->data[6][0] = __('Cascade protection services'); +$table->data[6][0] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true); +$table->data[6][1] = html_print_select($cps_array, 'cps', $cps, '', '', 0, true); ui_toggle(html_print_table ($table, true), __('Advanced options')); unset($table); @@ -659,6 +674,13 @@ ui_require_jquery_file('bgiframe'); return } + // On agent creation PHP will update the secondary groups table (not via AJAX) + if (id_agent == 0) { + agent_manager_add_secondary_groups_ui(); + agent_manager_update_hidden_input_secondary(); + return; + } + var selected_items = new Array(); $("#secondary_groups option:selected").each(function(){ selected_items.push($(this).val()) @@ -679,11 +701,7 @@ ui_require_jquery_file('bgiframe'); data: data, success: function (data) { if (data == 1) { - // Move from one input to the other - $("#secondary_groups_selected option[value=0]").remove() - $("#secondary_groups option:selected").each(function() { - $(this).remove().appendTo("#secondary_groups_selected") - }) + agent_manager_add_secondary_groups_ui(); } else { console.error("Error in AJAX call to add secondary groups") } @@ -697,6 +715,13 @@ ui_require_jquery_file('bgiframe'); function agent_manager_remove_secondary_groups (event, id_agent) { event.preventDefault(); + // On agent creation PHP will update the secondary groups table (not via AJAX) + if (id_agent == 0) { + agent_manager_remove_secondary_groups_ui(); + agent_manager_update_hidden_input_secondary(); + return; + } + var selected_items = new Array(); $("#secondary_groups_selected option:selected").each(function(){ selected_items.push($(this).val()) @@ -717,18 +742,7 @@ ui_require_jquery_file('bgiframe'); data: data, success: function (data) { if (data == 1) { - // Remove the groups selected if success - $("#secondary_groups_selected option:selected").each(function(){ - $(this).remove().appendTo("#secondary_groups") - }) - - // Add none if empty select - if ($("#secondary_groups_selected option").length == 0) { - $("#secondary_groups_selected").append($('',{ - value: 0, - text: "" - })) - } + agent_manager_remove_secondary_groups_ui(); } else { console.error("Error in AJAX call to add secondary groups") } @@ -739,6 +753,46 @@ ui_require_jquery_file('bgiframe'); }); } + // Move from left input to right input + function agent_manager_add_secondary_groups_ui () { + $("#secondary_groups_selected option[value=0]").remove() + $("#secondary_groups option:selected").each(function() { + $(this).remove().appendTo("#secondary_groups_selected") + }) + } + + // Move from right input to left input + function agent_manager_remove_secondary_groups_ui () { + // Remove the groups selected if success + $("#secondary_groups_selected option:selected").each(function(){ + $(this).remove().appendTo("#secondary_groups") + }) + + // Add none if empty select + if ($("#secondary_groups_selected option").length == 0) { + $("#secondary_groups_selected").append($('',{ + value: 0, + text: "" + })) + } + } + + function agent_manager_update_hidden_input_secondary () { + var groups = []; + if(!$('form[name="conf_agent"] #secondary_hidden').length) { + $('form[name="conf_agent"]').append( + '' + ); + } + + var groups = new Array(); + $("#secondary_groups_selected option").each(function() { + groups.push($(this).val()) + }) + + $("#secondary_hidden").val(groups.join(',')); + } + $(document).ready (function() { $("select#id_os").pandoraSelectOS (); diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index 02fa58e597..bc9b8ee7ec 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -84,6 +84,7 @@ $direccion_agente = io_safe_input($direccion_agente); $intervalo = SECONDS_5MINUTES; $ff_interval = 0; $quiet_module = 0; +$cps_module = 0; $id_server = ""; $max_alerts = 0; $modo = 1; @@ -148,6 +149,7 @@ $tab_description = ''; $url_description = ''; $quiet = 0; $macros = ''; +$cps = 0; $create_agent = (bool)get_parameter('create_agent'); $module_macros = array (); @@ -161,7 +163,7 @@ if ($create_agent) { //safe_output only validate ip $direccion_agente = trim(io_safe_output($direccion_agente)); - + if(!validate_address($direccion_agente)){ $mssg_warning = 1; } @@ -187,11 +189,13 @@ if ($create_agent) { $update_gis_data = (int) get_parameter_post("update_gis_data", 0); $url_description = (string) get_parameter("url_description"); $quiet = (int) get_parameter("quiet", 0); - + $cps = (int) get_parameter("cps", 0); + + $secondary_groups = (string) get_parameter("secondary_hidden", ""); $fields = db_get_all_fields_in_table('tagent_custom_fields'); - + if ($fields === false) $fields = array(); - + $field_values = array(); foreach ($fields as $field) { @@ -216,8 +220,10 @@ if ($create_agent) { } if(!$exists_alias){ - $id_agente = db_process_sql_insert ('tagente', - array ('nombre' => $nombre_agente, + $id_agente = db_process_sql_insert ( + 'tagente', + array ( + 'nombre' => $nombre_agente, 'alias' => $alias, 'alias_as_name' => $alias_as_name, 'direccion' => $direccion_agente, @@ -235,7 +241,10 @@ if ($create_agent) { 'icon_path' => $icon_path, 'update_gis_data' => $update_gis_data, 'url_address' => $url_description, - 'quiet' => $quiet)); + 'quiet' => $quiet, + 'cps' => $cps + ) + ); enterprise_hook ('update_agent', array ($id_agente)); } else{ @@ -253,19 +262,19 @@ if ($create_agent) { if ( $direccion_agente != '') { agents_add_address ($id_agente, $direccion_agente); } - + $agent_created_ok = true; - + $tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups WHERE id_group = ".$grupo); - + if($tpolicy_group_old){ foreach ($tpolicy_group_old as $key => $old_group) { db_process_sql_insert ('tpolicy_agents', array('id_policy' => $old_group['id_policy'], 'id_agent' => $id_agente)); } } - + $info = '{"Name":"' . $nombre_agente .'", "IP":"' . $direccion_agente .'", "Group":"' . $grupo .'", @@ -282,8 +291,14 @@ if ($create_agent) { "Icon path":"' . $icon_path .'", "Update GIS data":"' . $update_gis_data .'", "Url description":"' . $url_description .'", - "Quiet":"' . (int)$quiet.'"}'; - + "Quiet":"' . (int)$quiet.'", + "Cps":"' . (int)$cps.'"}'; + + // Create the secondary groups + enterprise_hook('agents_update_secondary_groups', + array($id_agente, explode(',', $secondary_groups), array()) + ); + $unsafe_alias = io_safe_output($alias); db_pandora_audit("Agent management", "Created agent $unsafe_alias", false, true, $info); @@ -743,6 +758,7 @@ if ($update_agent) { // if modified some agent paramenter $update_gis_data = (int) get_parameter_post("update_gis_data", 0); $url_description = (string) get_parameter("url_description"); $quiet = (int) get_parameter("quiet", 0); + $cps = (int) get_parameter("cps", 0); $old_interval = db_get_value('intervalo', 'tagente', 'id_agente', $id_agente); $fields = db_get_all_fields_in_table('tagent_custom_fields'); @@ -794,47 +810,49 @@ if ($update_agent) { // if modified some agent paramenter $direccion_agente != agents_get_address ($id_agente)) { agents_add_address ($id_agente, $direccion_agente); } - + $action_delete_ip = (bool)get_parameter('delete_ip', false); //If IP is set for deletion, delete first if ($action_delete_ip) { $delete_ip = get_parameter_post ("address_list"); - + $direccion_agente = agents_delete_address($id_agente, $delete_ip); } - - $values = array ('disabled' => $disabled, - 'id_parent' => $id_parent, - 'id_os' => $id_os, - 'modo' => $modo, - 'alias' => $alias, - 'alias_as_name' => $alias_as_name, - 'direccion' => $direccion_agente, - 'id_grupo' => $grupo, - 'intervalo' => $intervalo, - 'comentarios' => $comentarios, - 'cascade_protection' => $cascade_protection, - 'cascade_protection_module' => $cascade_protection_module, - 'server_name' => $server_name, - 'custom_id' => $custom_id, - 'icon_path' => $icon_path, - 'update_gis_data' => $update_gis_data, - 'url_address' => $url_description, - 'url_address' => $url_description, - 'quiet' => $quiet, - 'safe_mode_module' => $safe_mode_module); - + + $values = array ( + 'disabled' => $disabled, + 'id_parent' => $id_parent, + 'id_os' => $id_os, + 'modo' => $modo, + 'alias' => $alias, + 'alias_as_name' => $alias_as_name, + 'direccion' => $direccion_agente, + 'id_grupo' => $grupo, + 'intervalo' => $intervalo, + 'comentarios' => $comentarios, + 'cascade_protection' => $cascade_protection, + 'cascade_protection_module' => $cascade_protection_module, + 'server_name' => $server_name, + 'custom_id' => $custom_id, + 'icon_path' => $icon_path, + 'update_gis_data' => $update_gis_data, + 'url_address' => $url_description, + 'url_address' => $url_description, + 'quiet' => $quiet, + 'cps' => $cps, + 'safe_mode_module' => $safe_mode_module + ); + if ($config['metaconsole_agent_cache'] == 1) { $values['update_module_count'] = 1; // Force an update of the agent cache. } - + $group_old = db_get_sql("SELECT id_grupo FROM tagente WHERE id_agente =" .$id_agente); $tpolicy_group_old = db_get_all_rows_sql("SELECT id_policy FROM tpolicy_groups WHERE id_group = ".$group_old); - + $result = db_process_sql_update ('tagente', $values, array ('id_agente' => $id_agente)); - - + if ($result == false && $update_custom_result == false) { ui_print_error_message( __('There was a problem updating the agent')); @@ -868,7 +886,7 @@ if ($update_agent) { // if modified some agent paramenter foreach ($tpolicy_group as $key => $value) { $tpolicy_agents= db_get_sql("SELECT * FROM tpolicy_agents WHERE id_policy = ".$value['id_policy'] . " AND id_agent =" .$id_agente); - + if(!$tpolicy_agents){ db_process_sql_insert ('tpolicy_agents', array('id_policy' => $value['id_policy'], 'id_agent' => $id_agente)); @@ -879,7 +897,7 @@ if ($update_agent) { // if modified some agent paramenter } } } - + $info = '{ "id_agente":"' . $id_agente . '", "alias":"' . $alias . '", @@ -897,8 +915,9 @@ if ($update_agent) { // if modified some agent paramenter "Icon Path":"' . $icon_path . '", "Update GIS data":"' .$update_gis_data .'", "Url description":"' . $url_description .'", - "Quiet":"' . (int)$quiet.'"}'; - + "Quiet":"' . (int)$quiet.'", + "Cps":"' . (int)$cps.'"}'; + enterprise_hook ('update_agent', array ($id_agente)); ui_print_success_message (__('Successfully updated')); db_pandora_audit("Agent management", @@ -918,14 +937,14 @@ if ($id_agente) { require ("general/noaccess.php"); exit; } - + $agent = db_get_row ('tagente', 'id_agente', $id_agente); if (empty ($agent)) { //Close out the page ui_print_error_message (__('There was a problem loading the agent')); return; } - + $intervalo = $agent["intervalo"]; // Define interval in seconds $nombre_agente = $agent["nombre"]; if(empty($alias)){ @@ -951,6 +970,7 @@ if ($id_agente) { $update_gis_data = $agent["update_gis_data"]; $url_description = $agent["url_address"]; $quiet = $agent["quiet"]; + $cps = $agent["cps"]; $safe_mode_module = $agent["safe_mode_module"]; $safe_mode = ($safe_mode_module) ? 1 : 0; } @@ -967,7 +987,7 @@ $edit_module = (bool) get_parameter ('edit_module'); // GET DATA for MODULE UPDATE OR MODULE INSERT if ($update_module || $create_module) { $id_grupo = agents_get_agent_group ($id_agente); - + $id_agent_module = (int) get_parameter ('id_agent_module'); if (!check_acl ($config["id_user"], $id_grupo, "AW")) { @@ -1001,6 +1021,7 @@ if ($update_module || $create_module) { $interval = (int) get_parameter ('module_interval', $intervalo); $ff_interval = (int) get_parameter ('module_ff_interval'); $quiet_module = (int) get_parameter ('quiet_module'); + $cps_module = (int) get_parameter ('cps_module'); $id_plugin = (int) get_parameter ('id_plugin'); $id_export = (int) get_parameter ('id_export'); $disabled = (bool) get_parameter ('disabled'); @@ -1318,6 +1339,7 @@ if ($update_module) { 'unit' => io_safe_output($unit), 'macros' => $macros, 'quiet' => $quiet_module, + 'cps' => $cps_module, 'critical_instructions' => $critical_instructions, 'warning_instructions' => $warning_instructions, 'unknown_instructions' => $unknown_instructions, @@ -1362,8 +1384,8 @@ if ($update_module) { } else { $check_dynamic = - db_get_row_sql('SELECT dynamic_interval, dynamic_max, dynamic_min, dynamic_two_tailed - FROM tagente_modulo WHERE id_agente_modulo =' . $id_agent_module); + db_get_row_sql('SELECT dynamic_interval, dynamic_max, dynamic_min, dynamic_two_tailed + FROM tagente_modulo WHERE id_agente_modulo =' . $id_agent_module); if( ($check_dynamic['dynamic_interval'] == $dynamic_interval) && ($check_dynamic['dynamic_max'] == $dynamic_max) && @@ -1500,6 +1522,7 @@ if ($create_module) { 'unit' => io_safe_output($unit), 'macros' => $macros, 'quiet' => $quiet_module, + 'cps' => $cps_module, 'critical_instructions' => $critical_instructions, 'warning_instructions' => $warning_instructions, 'unknown_instructions' => $unknown_instructions, diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index 53f43cd9c4..670009bf2f 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -177,11 +177,11 @@ echo ""; echo ""; echo __('Operative System') . ' '; -$pre_fields = db_get_all_rows_sql('select distinct(tagente.id_os),tconfig_os.description from tagente,tconfig_os where tagente.id_os = tconfig_os.id_os'); +$pre_fields = db_get_all_rows_sql('select distinct(tagente.id_os),tconfig_os.name from tagente,tconfig_os where tagente.id_os = tconfig_os.id_os'); $fields = array(); foreach ($pre_fields as $key => $value) { - $fields[$value['id_os']] = $value['description']; + $fields[$value['id_os']] = $value['name']; } html_print_select($fields,"os",$os,'this.form.submit()','All',0); @@ -564,7 +564,7 @@ if ($agents !== false) { if ($agent['quiet']) { echo " "; - html_print_image("images/dot_green.disabled.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => "")); + html_print_image("images/dot_blue.png", false, array("border" => '0', "title" => __('Quiet'), "alt" => "")); } if ($in_planned_downtime) { diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 335bd287fa..02698e3326 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -650,7 +650,7 @@ foreach ($modules as $module) { } if ($module['quiet']) { - $data[0] .= html_print_image("images/dot_green.disabled.png", + $data[0] .= html_print_image("images/dot_blue.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . " "; } diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index 4efa2767ba..1bf189c660 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -162,6 +162,7 @@ if ($id_agent_module) { } $ff_interval = $module['module_ff_interval']; $quiet_module = $module['quiet']; + $cps_module = $module['cps']; $unit = $module['unit']; $tcp_port = $module['tcp_port']; $tcp_send = $module['tcp_send']; @@ -289,7 +290,7 @@ if ($id_agent_module) { else { if (!isset ($moduletype)) { $moduletype = (string) get_parameter ('moduletype'); - + // Clean up specific network modules fields $name = ''; $description = ''; @@ -302,6 +303,7 @@ else { $max = ''; $interval = ''; $quiet_module = 0; + $cps_module = 0; $unit = ''; $prediction_module = ''; $custom_integer_1 = 0; @@ -314,7 +316,7 @@ else { $tcp_send = ''; $tcp_rcv = ''; $tcp_port = ''; - + if ($moduletype == "wmiserver") $snmp_community = ''; else diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 040ad8a307..db77af000b 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -566,11 +566,24 @@ if ($__code_from == 'modules') { } $table_advanced->data[7][0] = __('Quiet'); -$table_advanced->data[7][0] .= ui_print_help_tip( - __('The module still stores data but the alerts and events will be stop'), true); -$table_advanced->colspan[7][1] = 7; -$table_advanced->data[7][1] = html_print_checkbox('quiet_module', 1, - $quiet_module, true, $disabledBecauseInPolicy); +$table_advanced->data[7][0] .= ui_print_help_tip(__('The module still stores data but the alerts and events will be stop'), true); +$table_advanced->data[7][1] = html_print_checkbox('quiet_module', 1, $quiet_module, true, $disabledBecauseInPolicy); + +$cps_array[-1] = __('Disabled'); +if($cps_module > 0){ + $cps_array[$cps_module] = __('Enabled'); +} +else{ + $cps_inc = 0; + if($id_agent_module){ + $cps_inc = service_modules_cps($id_agent_module); + } + $cps_array[$cps_inc] = __('Enabled'); +} +$table_advanced->data[7][2] = __('Cascade Protection Services'); +$table_advanced->data[7][2] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true); +$table_advanced->colspan[7][3] = 5; +$table_advanced->data[7][3] = html_print_select($cps_array, 'cps_module', $cps_module, '', '', 0, true, false, true, "", $disabledBecauseInPolicy); $table_advanced->data[8][0] = __('Critical instructions') . ui_print_help_tip(__("Instructions when the status is critical"), true); diff --git a/pandora_console/godmode/events/custom_events.php b/pandora_console/godmode/events/custom_events.php index f60ba4e5a6..a356b7bc47 100644 --- a/pandora_console/godmode/events/custom_events.php +++ b/pandora_console/godmode/events/custom_events.php @@ -179,7 +179,7 @@ foreach ($fields_available as $key=>$available) { } $table->data[0][0] = '' . __('Fields available').''; -$table->data[1][0] = html_print_select ($fields_available, 'fields_available[]', true, '', '', '', true, true, false, '', false, 'width: 200px'); +$table->data[1][0] = html_print_select ($fields_available, 'fields_available[]', true, '', '', '', true, true, false, '', false, 'width: 300px'); $table->data[1][1] = '' . html_print_image('images/darrowright.png', true, array('id' => 'right', 'title' => __('Add fields to select'))) . @@ -192,7 +192,7 @@ $table->data[1][1] .= '' . $table->data[0][1] = ''; $table->data[0][2] = '' . __('Fields selected') . ''; $table->data[1][2] = html_print_select($result_selected, - 'fields_selected[]', true, '', '', '', true, true, false, '', false, 'width: 200px'); + 'fields_selected[]', true, '', '', '', true, true, false, '', false, 'width: 300px'); echo ''; html_print_table($table); diff --git a/pandora_console/godmode/massive/massive_edit_agents.php b/pandora_console/godmode/massive/massive_edit_agents.php index 849101f169..f543772648 100755 --- a/pandora_console/godmode/massive/massive_edit_agents.php +++ b/pandora_console/godmode/massive/massive_edit_agents.php @@ -82,7 +82,7 @@ if ($update_agents) { $values['delete_conf'] = get_parameter('delete_conf'); if (get_parameter('quiet_select', -1) != -1) $values['quiet'] = get_parameter('quiet_select'); - + $fields = db_get_all_fields_in_table('tagent_custom_fields'); if ($fields === false) $fields = array(); diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index a7c8626fce..87fb1b3173 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -635,21 +635,23 @@ $table->data['edit11'][0] .= ui_print_help_tip(__('The module still store data b $table->data['edit11'][1] = html_print_select(array(-1 => __('No change'), 1 => __('Yes'), 0 => __('No')), "quiet_select", -1, "", '', 0, true); + + + $table->data['edit11'][2] = __('Timeout'); $table->data['edit11'][3] = html_print_input_text( 'max_timeout', '', '', 5, 10, true) . ' ' . ui_print_help_tip ( __('Seconds that agent will wait for the execution of the module.'), true); - + $table->data['edit16'][0] = __('Retries'); $table->data['edit16'][1] = html_print_input_text ('max_retries', '', '', 5, 10, true) . ' ' . ui_print_help_tip ( __('Number of retries that the module will attempt to run.'), true); - - - $table->data['edit22'][0] = __('Web checks').ui_print_help_icon ("web_checks", true);; - $table->data['edit22'][1] = ''; - + +$table->data['edit22'][0] = __('Web checks').ui_print_help_icon ("web_checks", true);; +$table->data['edit22'][1] = ''; + $table->data['edit16'][2] = __('Port'); $table->data['edit16'][3] = html_print_input_text ('tcp_port', '', '', 5, 20, true); @@ -1491,7 +1493,7 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu $values['custom_string_2'] = io_input_password($snmp3_privacy_pass); } } - + $throw_unknown_events = get_parameter('throw_unknown_events', ''); if ($throw_unknown_events !== '') { //Set the event type that can show. @@ -1499,24 +1501,23 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu EVENTS_GOING_UNKNOWN => (int)$throw_unknown_events); $values['disabled_types_event'] = json_encode($disabled_types_event); } - - + if (strlen(get_parameter('history_data')) > 0) { $values['history_data'] = get_parameter('history_data'); } - + if (get_parameter('quiet_select', -1) != -1) { $values['quiet'] = get_parameter('quiet_select'); } - + $filter_modules = false; - + if (!is_numeric($module_name) or ($module_name != 0)) $filter_modules['nombre'] = $module_name; - + // Whether to update module tag info $update_tags = get_parameter('id_tag', false); - + if (array_search(0, $agents_select) !== false) { //Apply at All agents. $modules = db_get_all_rows_filter ('tagente_modulo', diff --git a/pandora_console/godmode/modules/manage_network_templates.php b/pandora_console/godmode/modules/manage_network_templates.php index e5f093a044..89dca776bc 100644 --- a/pandora_console/godmode/modules/manage_network_templates.php +++ b/pandora_console/godmode/modules/manage_network_templates.php @@ -190,7 +190,7 @@ $table->head = array (); $table->head[0] = __('Name'); $table->head[1] = __('Description'); $table->head[2] = ''.__('Action') .''. - html_print_checkbox('all_delete', 0, false, true, false, 'check_all_checkboxes();'); + html_print_checkbox('all_delete', 0, false, true, false); $table->size = array (); $table->size[1] = '65%'; $table->size[2] = '15%'; @@ -239,12 +239,16 @@ echo ''; ?> diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index c844ccc4d3..b21ec23f3d 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -234,7 +234,7 @@ echo ""; echo __('Group') . ' '; $own_info = get_user_info($config['id_user']); -if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "AW")) +if (!$own_info['is_admin'] && !check_acl ($config['id_user'], 0, "VR")) $return_all_group = false; else $return_all_group = true; diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 5bd9889855..c2ebad004d 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -125,7 +125,6 @@ switch ($action) { $name = ''; $description = null; $sql = null; - $show_in_two_columns = 0; $show_in_same_row = 0; $show_in_landscape = 0; $hide_notinit_agents = 0; @@ -167,7 +166,6 @@ switch ($action) { $name = ''; $description = null; $sql = null; - $show_in_two_columns = 0; $show_in_same_row = 0; $show_in_landscape = 0; $hide_notinit_agents = 0; @@ -195,7 +193,6 @@ switch ($action) { $style = json_decode(io_safe_output($item['style']), true); $show_in_same_row = $style['show_in_same_row']; - $show_in_two_columns = $style['show_in_two_columns']; $show_in_landscape = $style['show_in_landscape']; $hide_notinit_agents = $style['hide_notinit_agents']; $dyn_height = $style['dyn_height']; @@ -1547,11 +1544,6 @@ You can of course remove the warnings, that's why we include the source and do n html_print_checkbox('historical_db_check',1,$historical_db);?> - - - - - @@ -1582,8 +1574,7 @@ You can of course remove the warnings, that's why we include the source and do n @@ -2827,7 +2818,6 @@ function chooseType() { $("#row_quantity").hide(); $("#row_exception_condition_value").hide(); $("#row_exception_condition").hide(); - $("#row_show_in_two_columns").hide(); $("#row_dyn_height").hide(); $("#row_show_in_same_row").hide(); $("#row_historical_db_check").hide(); @@ -2883,7 +2873,6 @@ function chooseType() { $("#row_period").show(); $("#row_servers").show(); $("#row_group").show(); - $("#row_show_in_two_columns").show(); $("#row_event_filter").show(); $("#row_event_graphs").show(); @@ -2944,7 +2933,6 @@ function chooseType() { $("#row_period1").show(); $("#row_module").show(); $("#row_interval").show(); - $("#row_show_in_two_columns").show(); $("#row_historical_db_check").hide(); break; @@ -3018,7 +3006,6 @@ function chooseType() { $("#row_agent").show(); $("#row_module").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_historical_db_check").hide(); break; @@ -3027,7 +3014,6 @@ function chooseType() { $("#row_agent").show(); $("#row_module").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_lapse_calc").show(); $("#row_lapse").show(); $("#row_visual_format").show(); @@ -3039,7 +3025,6 @@ function chooseType() { $("#row_agent").show(); $("#row_module").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_lapse_calc").show(); $("#row_lapse").show(); $("#row_visual_format").show(); @@ -3051,7 +3036,6 @@ function chooseType() { $("#row_agent").show(); $("#row_module").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_lapse_calc").show(); $("#row_lapse").show(); $("#row_visual_format").show(); @@ -3063,7 +3047,6 @@ function chooseType() { $("#row_agent").show(); $("#row_module").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_historical_db_check").hide(); break; @@ -3072,7 +3055,6 @@ function chooseType() { $("#row_agent").show(); $("#row_module").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_historical_db_check").hide(); break; @@ -3080,14 +3062,12 @@ function chooseType() { $("#row_description").show(); $("#row_agent").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_historical_db_check").hide(); break; case 'text': $("#row_description").show(); $("#row_text").show(); - $("#row_show_in_two_columns").show(); $("#row_historical_db_check").hide(); break; @@ -3098,7 +3078,6 @@ function chooseType() { $("#row_header").show(); $("#row_custom").show(); $("#row_custom_example").show(); - $("#row_show_in_two_columns").show(); $("#row_dyn_height").show(); $("#row_servers").show(); $("#row_historical_db_check").show(); @@ -3129,7 +3108,6 @@ function chooseType() { $("#row_field_separator").show(); $("#row_line_separator").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_historical_db_check").hide(); break; @@ -3138,7 +3116,6 @@ function chooseType() { $("#row_agent").show(); $("#row_module").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_historical_db_check").hide(); break; @@ -3147,7 +3124,6 @@ function chooseType() { $("#row_agent").show(); $("#row_module").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_historical_db_check").hide(); break; @@ -3156,7 +3132,6 @@ function chooseType() { $("#row_agent").show(); $("#row_module").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_historical_db_check").hide(); break; @@ -3165,7 +3140,6 @@ function chooseType() { $("#row_agent").show(); $("#row_module").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_historical_db_check").hide(); break; @@ -3174,14 +3148,12 @@ function chooseType() { $("#row_agent").show(); $("#row_module").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_historical_db_check").hide(); break; case 'alert_report_group': $("#row_description").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_group").show(); $("#row_servers").show(); $("#row_historical_db_check").hide(); @@ -3191,7 +3163,6 @@ function chooseType() { $("#row_description").show(); $("#row_agent").show(); $("#row_period").show(); - $("#row_show_in_two_columns").show(); $("#row_historical_db_check").hide(); break; @@ -3265,7 +3236,6 @@ function chooseType() { $("#general_list").show(); $("#row_order_uptodown").show(); $("#row_show_resume").show(); - $("#row_show_in_two_columns").show(); $("#row_show_in_same_row").show(); var checked = $("input[name='last_value']").prop("checked"); @@ -3284,7 +3254,6 @@ function chooseType() { $("#general_list").show(); $("#row_order_uptodown").show(); $("#row_show_address_agent").show(); - $("#row_show_in_two_columns").show(); $("#row_show_resume").show(); $("#row_working_time").show(); $('#row_hide_notinit_agents').show(); @@ -3315,7 +3284,6 @@ function chooseType() { $("#row_order_uptodown").show(); $("#row_show_resume").show(); $("#row_show_graph").show(); - $("#row_show_in_two_columns").show(); $("#row_historical_db_check").hide(); break; @@ -3328,7 +3296,6 @@ function chooseType() { $("#row_order_uptodown").show(); $("#row_show_resume").show(); $("#row_show_graph").show(); - $("#row_show_in_two_columns").show(); var checked = $("input[name='last_value']").prop("checked"); @@ -3356,7 +3323,6 @@ function chooseType() { $("#row_group").show(); $("#row_agent_multi").show(); $("#row_module_multi").show(); - $("#row_show_in_two_columns").show(); $("#row_servers").show(); $("#id_agents").change(event_change_id_agent_inventory); $("#id_agents").trigger('change'); @@ -3374,7 +3340,6 @@ function chooseType() { $("#row_agent_multi").show(); $("#row_module_multi").show(); $("#row_date").show(); - $("#row_show_in_two_columns").show(); $("#id_agents") diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 61a53fe5ea..a9e955a04e 100755 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -1201,7 +1201,6 @@ switch ($action) { $values['line_separator'] = get_parameter('line'); $style = array(); - $style['show_in_two_columns'] = get_parameter('show_in_two_columns', 0); $style['show_in_same_row'] = get_parameter('show_in_same_row', 0); $style['show_in_landscape'] = get_parameter('show_in_landscape', 0); $style['hide_notinit_agents'] = get_parameter('hide_notinit_agents', 0); @@ -1541,7 +1540,6 @@ switch ($action) { $values['line_separator'] = get_parameter('line'); $style = array(); - $style['show_in_two_columns'] = get_parameter('show_in_two_columns', 0); $style['show_in_same_row'] = get_parameter('show_in_same_row', 0); $style['show_in_landscape'] = get_parameter('show_in_landscape', 0); $style['hide_notinit_agents'] = get_parameter('hide_notinit_agents', 0); diff --git a/pandora_console/godmode/reporting/visual_console_builder.data.php b/pandora_console/godmode/reporting/visual_console_builder.data.php index b219c65d51..1c5aaade37 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.data.php +++ b/pandora_console/godmode/reporting/visual_console_builder.data.php @@ -126,16 +126,11 @@ else { } $table->data[1][0] = __('Group:'); -$groups = users_get_groups ($config['id_user'], 'RW'); -$own_info = get_user_info($config['id_user']); // Only display group "All" if user is administrator // or has "RW" privileges -if ($own_info['is_admin'] || $vconsole_write || $vconsole_manage) - $display_all_group = true; -else - $display_all_group = false; +$display_all_group = (users_is_admin() || users_can_manage_group_all("RW")); $table->data[1][1] = html_print_select_groups($config['id_user'], "RW", $display_all_group, 'id_group', $idGroup, '', '', '', true); $backgrounds_list = list_files( diff --git a/pandora_console/include/ajax/config.ajax.php b/pandora_console/include/ajax/config.ajax.php new file mode 100644 index 0000000000..7640d6ca38 --- /dev/null +++ b/pandora_console/include/ajax/config.ajax.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index d431a83dd7..7a367e8da0 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -148,7 +148,7 @@ if ($perform_event_response) { break; } - echo system("ssh pandora_exec_proxy@" . $server_data['ip_address'] . " \"" . $timeout_bin . " 90 " . io_safe_output($command) . " 2>&1\"", $ret_val); + system("ssh pandora_exec_proxy@" . $server_data['ip_address'] . " \"" . $timeout_bin . " 90 " . io_safe_output($command) . " 2>&1\"", $ret_val); } } else { @@ -163,7 +163,7 @@ if ($perform_event_response) { $timeout_bin = '/usr/bin/timeout'; break; } - echo system($timeout_bin . ' 90 '.io_safe_output($command).' 2>&1'); + system($timeout_bin . ' 90 '.io_safe_output($command).' 2>&1'); } } else { @@ -178,7 +178,7 @@ if ($perform_event_response) { $timeout_bin = '/usr/bin/timeout'; break; } - echo system($timeout_bin . ' 90 '.io_safe_output($command).' 2>&1'); + system($timeout_bin . ' 90 '.io_safe_output($command).' 2>&1'); } return; diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index d0089fdcef..6c7ea543a6 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -913,7 +913,7 @@ if ($list_modules) { } if ($module['quiet']) { - $data[3] .= html_print_image("images/dot_green.disabled.png", true, + $data[3] .= html_print_image("images/dot_blue.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . " "; } diff --git a/pandora_console/include/auth/mysql.php b/pandora_console/include/auth/mysql.php index 705c600943..f2aff5ed44 100644 --- a/pandora_console/include/auth/mysql.php +++ b/pandora_console/include/auth/mysql.php @@ -349,7 +349,7 @@ function process_user_login_remote ($login, $pass, $api = false) { foreach ($attributes as $attr) { $attr = explode('=', $attr, 2); - if(in_array($attr[1],$sr[$attr[0]])) { + if(preg_match('/' . $attr[1] . '/', $sr[$attr[0]][0])){ $permissions[$i]["profile"] = $ldap_adv_perm['profile']; $permissions[$i]["groups"] = $ldap_adv_perm['group']; $permissions[$i]["tags"] = implode(",",$ldap_adv_perm['tags']); diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 5a0b9fad34..996eeaf07f 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -546,6 +546,7 @@ class Tree { $group_filter $agent_search_filter $agent_status_filter + GROUP BY ta.id_agente ORDER BY $order_fields"; } } @@ -1914,7 +1915,7 @@ class Tree { // Quiet image if (isset($agent['quiet']) && $agent['quiet']) - $agent['quietImageHTML'] = html_print_image("/images/dot_green.disabled.png", true, array("title" => __('Quiet'))); + $agent['quietImageHTML'] = html_print_image("/images/dot_blue.png", true, array("title" => __('Quiet'))); // Status $agent['statusRaw'] = agents_get_status($agent['id'], !$this->strictACL); diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index b9c3fdbf33..573cf16dfb 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 = 'PC180625'; +$build_version = 'PC180628'; $pandora_version = 'v7.0NG.724'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 854d7ef9cf..726fd5244f 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -3093,7 +3093,7 @@ function series_type_graph_array($data, $show_elements_graph){ elseif(strpos($key, 'sum') !== false || strpos($key, 'baseline') !== false){ switch ($value['id_module_type']) { case 21: case 2: case 6: - case 18: case 9: case 31: + case 18: case 9: case 31: case 100: $data_return['series_type'][$key] = 'boolean'; break; default: diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 6fc06a8751..ce31336723 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -3384,7 +3384,7 @@ function api_set_create_snmp_module($id, $thrash1, $other, $thrash3) { return; } - if ($other['data'][2] < 15 or $other['data'][2] > 17) { + if ($other['data'][2] < 15 or $other['data'][2] > 18) { returnError('error_create_snmp_module', __('Error in creation SNMP module. Invalid id_module_type for a SNMP module.')); return; } @@ -10368,7 +10368,9 @@ function api_set_create_service($thrash1, $thrash2, $other, $thrash3) { $id_critical_module_template = $other['data'][9]; $id_unknown_module_template = 0; $id_critical_module_sla = $other['data'][10]; - + $quiet = $other['data'][11]; + $cascade_protection = $other['data'][12]; + if(empty($name)){ returnError('error_create_service', __('Error in creation service. No name')); return; @@ -10411,12 +10413,22 @@ function api_set_create_service($thrash1, $thrash2, $other, $thrash3) { if(empty($id_critical_module_sla)){ $id_critical_module_sla = 0; } - - $result = services_create_service ($name, $description, $id_group, - $critical, $warning, SECONDS_5MINUTES, $mode, $id_agent, $sla_interval, $sla_limit, + if(empty($quiet)){ + $quiet = 0; + } + if(empty($cascade_protection)){ + $cascade_protection = 0; + } + + $result = services_create_service ( + $name, $description, $id_group, + $critical, $warning, SECONDS_5MINUTES, + $mode, $id_agent, $sla_interval, $sla_limit, $id_warning_module_template, $id_critical_module_template, - $id_unknown_module_template, $id_critical_module_sla); - + $id_unknown_module_template, $id_critical_module_sla, + $quiet, $cascade_protection + ); + if($result){ returnData('string', array('type' => 'string', 'data' => $result)); } else { @@ -10485,9 +10497,9 @@ function api_set_update_service($thrash1, $thrash2, $other, $thrash3) { if(empty($warning)){ $warning = $service['warning']; } - + $mode = 0; - + $id_agent = $other['data'][5]; if(empty($id_agent)){ $id_agent = $service['id_agent_module']; @@ -10512,25 +10524,40 @@ function api_set_update_service($thrash1, $thrash2, $other, $thrash3) { if(empty($id_critical_module_template)){ $id_critical_module_template = $service['id_template_alert_critical']; } - + $id_unknown_module_template = 0; - + $id_critical_module_sla = $other['data'][10]; if(empty($id_critical_module_sla)){ $id_critical_module_sla = $service['id_template_alert_critical_sla']; } - - $result = services_update_service ($id_service, $name,$description, $id_group, $critical, $warning, - SECONDS_5MINUTES, $mode, $id_agent,$sla_interval, $sla_limit,$id_warning_module_template, - $id_critical_module_template,$id_unknown_module_template,$id_critical_module_sla); - - + + $quiet = $other['data'][11]; + if(empty($quiet)){ + $quiet = $service['quiet']; + } + + $cascade_protection = $other['data'][12]; + if(empty($cascade_protection)){ + $cascade_protection = $service['cascade_protection']; + } + + $result = services_update_service ( + $id_service, $name,$description, $id_group, + $critical, $warning, SECONDS_5MINUTES, $mode, + $id_agent, $sla_interval, $sla_limit, + $id_warning_module_template, + $id_critical_module_template, + $id_unknown_module_template, + $id_critical_module_sla, + $quiet, $cascade_protection + ); + if($result){ returnData('string', array('type' => 'string', 'data' => $result)); } else { returnError('error_update_service', __('Error in update service')); } - } /** diff --git a/pandora_console/include/functions_gis.php b/pandora_console/include/functions_gis.php index 9d941b35a1..d37a4a433e 100644 --- a/pandora_console/include/functions_gis.php +++ b/pandora_console/include/functions_gis.php @@ -446,37 +446,27 @@ function gis_add_agent_point($layerName, $pointName, $lat, $lon, $icon = null, $ * Get the agents in layer but not by group in layer. * * @param integer $idLayer Layer ID. - * @param array $fields Fields of row tagente to return. * * @return array The array rows of tagente of agents in the layer. */ -function gis_get_agents_layer($idLayer, $fields = null) { - - if ($fields === null) { - $select = '*'; - } - else { - $select = implode(',',$fields); - } - - $sql = "SELECT $select +function gis_get_agents_layer($idLayer) { + + $sql = "SELECT id_agente, nombre FROM tagente WHERE id_agente IN ( SELECT tagente_id_agente FROM tgis_map_layer_has_tagente WHERE tgis_map_layer_id_tmap_layer = $idLayer)"; $agents = db_get_all_rows_sql($sql); - + + $returned_agents = array(); if ($agents !== false) { foreach ($agents as $index => $agent) { - $agents[$index] = $agent['nombre']; + $returned_agents[$agent['id_agente']] = $agent['nombre']; } } - else { - return array(); - } - - return $agents; + + return $returned_agents; } function gis_add_point_path($layerName, $lat, $lon, $color, $manual = 1, $id) { diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 812e729502..c02be7dcc0 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -257,8 +257,16 @@ function grafico_modulo_sparse_data_chart ( ); } else{ - //all points(data) - if($params['zoom'] == 5){ + //all points(data) and boolean + if( $params['zoom'] == 5 || + $data_module_graph['id_module_type'] == 2 || + $data_module_graph['id_module_type'] == 6 || + $data_module_graph['id_module_type'] == 21 || + $data_module_graph['id_module_type'] == 18 || + $data_module_graph['id_module_type'] == 9 || + $data_module_graph['id_module_type'] == 31 || + $data_module_graph['id_module_type'] == 100 ){ + $data = db_get_all_rows_filter ( 'tagente_datos', array ('id_agente_modulo' => (int)$agent_module_id, diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index 7481fae43d..a07bde5528 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -323,14 +323,7 @@ function menu_print_menu (&$menu) { //Print second level submenu if (isset($sub['sub2'])) { - - //Display if father is selected - $display = "style='display:none;'"; - - if ($selected) { - $display = ""; - } - + $submenu2_list = ''; $count_sub2 = 0; @@ -374,12 +367,9 @@ function menu_print_menu (&$menu) { // Added a top on inline styles $top = menu_calculate_top($config['count_main_menu'], $count_sub, $count_sub2); - if ($top !== 0) { - $display = rtrim($display, "'"); - $display .= "top: " . $top . "px;'"; - } + //Add submenu2 to submenu string - $submenu_output .= ""; + $submenu_output .= ""; $submenu_output .= $submenu2_list; $submenu_output .= ""; } diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 0d1c208e16..a0979e4887 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -2741,4 +2741,22 @@ function get_module_realtime_link_graph ($module) { return $link_button; } + +/** + * @brief Force a module to adopt a determinated status. + * WARNING: Only use this function to modules that changes their status + * with some user action through the console + * @param int New status + * @param int Agent module to force new status + */ +function force_set_module_status ($status, $id_agent_module) { + return db_process_sql_update( 'tagente_estado', + array( + 'estado' => $status, + 'known_status' => $status, + 'last_known_status' => $status + ), + array('id_agente_modulo' => $id_agent_module) + ); +} ?> diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index f5f06cf73e..81938d66c9 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -3879,8 +3879,23 @@ function reporting_value($report, $content, $type,$pdf) { if($pdf){ $only_image = 1; } + + $params =array( + 'agent_module_id' => $content['id_agent_module'], + 'period' => $content['period'], + 'width' => '600px', + 'pure' => false,///true + 'date' => $report["datetime"], + 'only_image' => $only_image, + 'homeurl' => ui_get_full_url(false, false, false, false), + 'ttl' => 1,///2 + 'type_graph' => $config['type_module_charts'], + 'time_interval' => $content['lapse'], + 'server_id' => $id_meta + ); switch ($type) { + case 'max': if($content['lapse_calc'] == 0){ $value = reporting_get_agentmodule_data_max( @@ -3893,20 +3908,6 @@ function reporting_value($report, $content, $type,$pdf) { } } else{ - $params =array( - 'agent_module_id' => $content['id_agent_module'], - 'period' => $content['period'], - 'width' => '600px', - 'pure' => false,///true - 'date' => $report["datetime"], - 'only_image' => $only_image, - 'homeurl' => ui_get_full_url(false, false, false, false), - 'ttl' => 1,///2 - 'type_graph' => $config['type_module_charts'], - 'time_interval' => $content['lapse'], - 'server_id' => $id_meta - ); - $value = ' @@ -4159,7 +4160,6 @@ function reporting_value($report, $content, $type,$pdf) { '; - if($content['visual_format'] == 2 || $content['visual_format'] == 3){ $params['force_interval'] = 'avg_only'; $value .= grafico_modulo_sparse($params); diff --git a/pandora_console/include/javascript/jquery.pandora.js b/pandora_console/include/javascript/jquery.pandora.js index c3b2e65c6c..55e1d0004f 100644 --- a/pandora_console/include/javascript/jquery.pandora.js +++ b/pandora_console/include/javascript/jquery.pandora.js @@ -59,46 +59,152 @@ $(document).ready (function () { }); $("a.show_systemalert_dialog").click (function () { - $('body').append( "" ); jQuery.post ("ajax.php", - {"page": "operation/system_alert"}, - function (data, status) { - $("#alert_messages").hide () - .empty () - .append (data) - .show (); - }, - "html" - ); - return false; + {"page": "include/ajax/config.ajax", + "token_name": 'visual_animation' + }, + function (data, status) { + if(data){ + $('body').append( "" ); + jQuery.post ("ajax.php", + {"page": "operation/system_alert"}, + function (data, status) { + + $("#alert_messages").css('width','auto'); + $("#alert_messages").css('height','auto'); + + $("#alert_messages").css('visibility','hidden'); + $("#alert_messages").empty ().append (data); + $("#alert_messages").css('display','block'); + + setTimeout( function() { + animation_modal('alert_messages'); + }, 50); + }, + "html" + ); + return false; + } + else{ + $('body').append( "" ); + jQuery.post ("ajax.php", + {"page": "operation/system_alert"}, + function (data, status) { + $("#alert_messages").hide () + .empty () + .append (data) + .show (); + }, + "html" + ); + return false; + } + }, + "html" + ); }); $("a.modalpopup").click (function () { - $('body').append( "" ); - jQuery.post ("ajax.php", - { - "page": "general/alert_enterprise", - "message": $(this).attr("id") - }, - function (data, status) { - $("#alert_messages").hide () - .empty () - .append (data) - .show (); - }, - "html" - ); - return false; - }); + var elem = $(this).attr("id"); + + jQuery.post ("ajax.php", + {"page": "include/ajax/config.ajax", + "token_name": 'visual_animation' + }, + function (data, status) { + if(data){ + $('body').append( "" ); + jQuery.post ("ajax.php", + { + "page": "general/alert_enterprise", + "message": elem + }, + function (data, status) { + + $("#alert_messages").css('width','auto'); + $("#alert_messages").css('height','auto'); + + $("#alert_messages").css('visibility','hidden'); + $("#alert_messages").empty ().append (data); + $("#alert_messages").css('display','block'); + + setTimeout( function() { + animation_modal('alert_messages'); + }, 50); + }, + "html" + ); + return false; + } + else{ + $('body').append( "" ); + jQuery.post ("ajax.php", + { + "page": "general/alert_enterprise", + "message": elem + }, + function (data, status) { + $("#alert_messages").hide () + .empty () + .append (data) + .show (); + }, + "html" + ); + return false; + } + }, + "html" + ); +}); // Creacion de ventana modal y botones $(".publienterprise").click (function () { + + var elem = $(this).attr("id"); + + jQuery.post ("ajax.php", + {"page": "include/ajax/config.ajax", + "token_name": 'visual_animation' + }, + function (data, status) { + + if(data){ + + $('body').append( "" ); + jQuery.post ("ajax.php", + { + "page": "general/alert_enterprise", + "message": elem + }, + function (data, status) { + + $("#alert_messages").css('width','auto'); + $("#alert_messages").css('height','auto'); + + $("#alert_messages").css('visibility','hidden'); + $("#alert_messages").empty ().append (data); + $("#alert_messages").css('display','block'); + + setTimeout( function() { + animation_modal('alert_messages'); + }, 50); + }, + "html" + ); + + return false; + + } + else{ + $('body').append( "" ); + jQuery.post ("ajax.php", { "page": "general/alert_enterprise", - "message": $(this).attr("id") + "message": elem }, function (data, status) { $("#alert_messages").hide () @@ -109,9 +215,13 @@ $(document).ready (function () { "html" ); - return false; - }); + } + }, + "html" + ); +}); + $(".publienterprisehide").click (function () { $('body').append( "" ); @@ -372,3 +482,23 @@ function forced_title_callback() { $('#forced_title_layer').hide().empty(); }); } + +function animation_modal(id){ + + var animation_width = $("#"+id).css('width'); + var animation_height = $("#"+id).css('height'); + var posanimation_left = parseInt($('#'+id).css('left')); + var preanimation_left = parseInt($('#'+id).css('left'))+parseInt($('#'+id).css('left'))/2; + $('#'+id).css({'width':'100px','height':'60px'}); + $("#alert_messages").css('visibility','visible'); + $('#'+id).css('left',+preanimation_left+'px'); + $('#'+id).css('opacity',0); + + $('#opacidad').animate({'opacity':0.8},2000); + + $("#"+id) + .animate({'width': animation_width,'left':posanimation_left+'px','opacity':1},1000) + .animate({'height': animation_height},1000); + +} + diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 906a91ed05..b4731de2ca 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -3596,7 +3596,6 @@ div.simple_value > a > span.text p position:fixed; width:750px; max-width:750px; - min-width:750px; top: 20%; background:white; } diff --git a/pandora_console/install.php b/pandora_console/install.php index e23d3c211f..18283fcef4 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@ agent['quiet']) { $agent_alias = "" . $agent_alias . " " . - html_print_image("images/dot_green.disabled.png", + html_print_image("images/dot_blue.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . ""; } diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 80783fcf1d..1632242dec 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -631,7 +631,7 @@ foreach ($agents as $agent) { if ($agent['quiet']) { $data[0] .= " "; - $data[0] .= html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")); + $data[0] .= html_print_image("images/dot_blue.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")); } if ($in_planned_downtime) { diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index c551268f5f..6dbb229c8b 100755 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -91,10 +91,10 @@ if ($agent['disabled']) { } else if ($agent['quiet']) { if ($in_planned_downtime) { - $agent_name = "" . $agent_name . " " . html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")); + $agent_name = "" . $agent_name . " " . html_print_image("images/dot_blue.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")); } else { - $agent_name = "" . $agent_name . " " . html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . ""; + $agent_name = "" . $agent_name . " " . html_print_image("images/dot_blue.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) . ""; } } else { diff --git a/pandora_console/operation/agentes/graphs.php b/pandora_console/operation/agentes/graphs.php index 2c1e15a79c..eaf9b4af3d 100644 --- a/pandora_console/operation/agentes/graphs.php +++ b/pandora_console/operation/agentes/graphs.php @@ -388,7 +388,7 @@ echo ""; }); } - var requestSparseGraph = function (moduleId, period, showEvents, width, height, title, showAlerts, avgOnly, date, unit, type_g) { + var requestSparseGraph = function (moduleId, period, showEvents, width, height, title, showAlerts, date, unit, type_g) { return requestGraph('sparse', { page: 'include/ajax/graph.ajax', print_sparse_graph: 1, @@ -488,7 +488,7 @@ echo ""; $container.html($errorMessage.html()); } - requestSparseGraph(moduleId, period, showEvents, width, height, title, showAlerts, avgOnly, date, unit, type_g) + requestSparseGraph(moduleId, period, showEvents, width, height, title, showAlerts, date, unit, type_g) .done(handleSuccess) .fail(handleError); } diff --git a/pandora_console/operation/agentes/pandora_networkmap.editor.php b/pandora_console/operation/agentes/pandora_networkmap.editor.php index 98752770b3..1db0e2985f 100644 --- a/pandora_console/operation/agentes/pandora_networkmap.editor.php +++ b/pandora_console/operation/agentes/pandora_networkmap.editor.php @@ -222,8 +222,14 @@ else { $table->data[0][1] = html_print_input_text ('name', $name, '', 30, 100,true); $table->data[1][0] = __('Group'); - $table->data[1][1] = html_print_select_groups(false, "AR", true, - 'id_group', $id_group, '', '', 0, true); + + // Only display group "All" if user is administrator + // or has "AR" privileges + + $display_all_group = (users_is_admin() || users_can_manage_group_all("AR")); + + $table->data[1][1] = html_print_select_groups($config['id_user'], "AR", + $display_all_group, 'id_group', $idGroup, '', '', '', true); $table->data[2][0] = __('Node radius'); $table->data[2][1] = html_print_input_text ('node_radius', $node_radius, '', 2, diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 90bcf8fd33..8fe5e5d997 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -286,18 +286,20 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); $table->data[] = $data; $table->rowclass[] = ''; - $data = array(); - $data[0] = __('Zoom'); - $options = array (); - $options[$zoom] = 'x' . $zoom; - $options[1] = 'x1'; - $options[2] = 'x2'; - $options[3] = 'x3'; - $options[4] = 'x4'; - $options[5] = __('full'); - $data[1] = html_print_select ($options, "zoom", $zoom, '', '', 0, true, false, false); - $table->data[] = $data; - $table->rowclass[] = ''; + if(!modules_is_boolean($id)){ + $data = array(); + $data[0] = __('Zoom'); + $options = array (); + $options[$zoom] = 'x' . $zoom; + $options[1] = 'x1'; + $options[2] = 'x2'; + $options[3] = 'x3'; + $options[4] = 'x4'; + $options[5] = __('full'); + $data[1] = html_print_select ($options, "zoom", $zoom, '', '', 0, true, false, false); + $table->data[] = $data; + $table->rowclass[] = ''; + } $data = array(); $data[0] = __('Time range'); @@ -456,6 +458,6 @@ ui_include_time_picker(true); }); $(window).resize(function() { - $("#field_list").css('height', ($(window).height() - 160) + 'px'); + $("#field_list").css('height', ($(document).height() - 160) + 'px'); }); diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index 01373c8358..d00dbd522a 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -763,14 +763,16 @@ else { echo ''; //~ if (!$readonly && tags_check_acl ($config["id_user"], 0, "EW", $event['clean_tags']) == 1) { if (!$readonly && $show_validate_button) { - html_print_button(__('Validate selected'), 'validate_button', false, 'validate_selected();', 'class="sub ok"'); + html_print_button(__('In progress selected'), 'validate_button', false, 'validate_selected(2);', 'class="sub ok"'); + echo " "; + html_print_button(__('Validate selected'), 'validate_button', false, 'validate_selected(1);', 'class="sub ok"'); // Fix: validated_selected JS function has to be included with the proper user ACLs ?>