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($('