From f430b8998f6074c7338f2c8f0c271d829f40c2b0 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 3 Jul 2018 12:01:37 +0200 Subject: [PATCH 01/84] Added DB changes to support ProvisioningServer 2 --- pandora_console/extras/mr/18.sql | 36 +++++++++++++++ .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 44 +++++++++++++++++++ pandora_console/pandoradb.sql | 43 ++++++++++++++++++ 3 files changed, 123 insertions(+) diff --git a/pandora_console/extras/mr/18.sql b/pandora_console/extras/mr/18.sql index b7e4be33e0..e82f940bfb 100644 --- a/pandora_console/extras/mr/18.sql +++ b/pandora_console/extras/mr/18.sql @@ -10,4 +10,40 @@ ALTER TABLE `tmetaconsole_agent` ADD COLUMN `cps` int NOT NULL DEFAULT '0'; ALTER TABLE `tagente_modulo` ADD COLUMN `cps` int NOT NULL DEFAULT '0'; +CREATE TABLE `tautoconfig` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `order` int(11) NOT NULL DEFAULT '0', + `description` text, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `tautoconfig_rules` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_autoconfig` int(10) unsigned NOT NULL, + `order_by` int(11) NOT NULL DEFAULT '0', + `operator` enum('AND','OR') DEFAULT 'OR', + `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', + `value` varchar(100) NOT NULL DEFAULT '', + `custom` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `id_autoconfig` (`id_autoconfig`), + CONSTRAINT `tautoconfig_rules_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `tautoconfig_actions` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_autoconfig` int(10) unsigned NOT NULL, + `order` int(11) NOT NULL DEFAULT '0', + `action_type` enum('set-group', 'set-secondary-group','apply-policy','apply-all-policies','launch-event','launch-alert-action','raw-config') DEFAULT 'launch-event', + `value` varchar(100) NOT NULL DEFAULT '', + `custom` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `id_autoconfig` (`id_autoconfig`), + CONSTRAINT `tautoconfig_action_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + 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 6752754a5c..19add1b91a 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 @@ -1667,3 +1667,47 @@ create table IF NOT EXISTS `tmetaconsole_agent_secondary_group`( ALTER TABLE tagente ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0'; ALTER TABLE tmetaconsole_agent ADD COLUMN `update_secondary_groups` tinyint(1) NOT NULL default '0'; ALTER TABLE tusuario_perfil ADD COLUMN `is_secondary` tinyint(1) NOT NULL default '0'; + +-- --------------------------------------------------------------------- +-- Table `tautoconfig` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tautoconfig` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `order` int(11) NOT NULL DEFAULT '0', + `description` text, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tautoconfig_rules` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tautoconfig_rules` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_autoconfig` int(10) unsigned NOT NULL, + `order_by` int(11) NOT NULL DEFAULT '0', + `operator` enum('AND','OR') DEFAULT 'OR', + `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', + `value` varchar(100) NOT NULL DEFAULT '', + `custom` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `id_autoconfig` (`id_autoconfig`), + CONSTRAINT `tautoconfig_rules_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tautoconfig_actions` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tautoconfig_actions` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_autoconfig` int(10) unsigned NOT NULL, + `order` int(11) NOT NULL DEFAULT '0', + `action_type` enum('set-group', 'set-secondary-group','apply-policy','apply-all-policies','launch-event','launch-alert-action','raw-config') DEFAULT 'launch-event', + `value` varchar(100) NOT NULL DEFAULT '', + `custom` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `id_autoconfig` (`id_autoconfig`), + CONSTRAINT `tautoconfig_action_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 5b77263b6a..a06099511b 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3195,3 +3195,46 @@ create table IF NOT EXISTS `tmetaconsole_agent_secondary_group`( ON DELETE CASCADE ) engine=InnoDB DEFAULT CHARSET=utf8; +-- --------------------------------------------------------------------- +-- Table `tautoconfig` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tautoconfig` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `order` int(11) NOT NULL DEFAULT '0', + `description` text, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tautoconfig_rules` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tautoconfig_rules` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_autoconfig` int(10) unsigned NOT NULL, + `order_by` int(11) NOT NULL DEFAULT '0', + `operator` enum('AND','OR') DEFAULT 'OR', + `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', + `value` varchar(100) NOT NULL DEFAULT '', + `custom` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `id_autoconfig` (`id_autoconfig`), + CONSTRAINT `tautoconfig_rules_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tautoconfig_actions` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tautoconfig_actions` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `id_autoconfig` int(10) unsigned NOT NULL, + `order` int(11) NOT NULL DEFAULT '0', + `action_type` enum('set-group', 'set-secondary-group','apply-policy','apply-all-policies','launch-event','launch-alert-action','raw-config') DEFAULT 'launch-event', + `value` varchar(100) NOT NULL DEFAULT '', + `custom` varchar(100) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `id_autoconfig` (`id_autoconfig`), + CONSTRAINT `tautoconfig_action_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + From c800061bc23673dd285242b54f4170b9fa300ac3 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 4 Jul 2018 18:39:06 +0200 Subject: [PATCH 02/84] Autoconfiguration v1 --- pandora_console/extras/mr/18.sql | 10 +++---- .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 10 +++---- pandora_console/pandoradb.sql | 10 +++---- pandora_server/lib/PandoraFMS/Config.pm | 5 ++++ pandora_server/lib/PandoraFMS/DB.pm | 30 +++++++++++++++++++ pandora_server/lib/PandoraFMS/DataServer.pm | 6 ++++ pandora_server/lib/PandoraFMS/PluginTools.pm | 12 ++++++++ 7 files changed, 68 insertions(+), 15 deletions(-) diff --git a/pandora_console/extras/mr/18.sql b/pandora_console/extras/mr/18.sql index e82f940bfb..310e42c1c8 100644 --- a/pandora_console/extras/mr/18.sql +++ b/pandora_console/extras/mr/18.sql @@ -25,8 +25,8 @@ CREATE TABLE `tautoconfig_rules` ( `order_by` int(11) NOT NULL DEFAULT '0', `operator` enum('AND','OR') DEFAULT 'OR', `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', - `value` varchar(100) NOT NULL DEFAULT '', - `custom` varchar(100) NOT NULL DEFAULT '', + `value` text, + `custom` text, PRIMARY KEY (`id`), KEY `id_autoconfig` (`id_autoconfig`), CONSTRAINT `tautoconfig_rules_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE @@ -37,9 +37,9 @@ CREATE TABLE `tautoconfig_actions` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_autoconfig` int(10) unsigned NOT NULL, `order` int(11) NOT NULL DEFAULT '0', - `action_type` enum('set-group', 'set-secondary-group','apply-policy','apply-all-policies','launch-event','launch-alert-action','raw-config') DEFAULT 'launch-event', - `value` varchar(100) NOT NULL DEFAULT '', - `custom` varchar(100) NOT NULL DEFAULT '', + `action_type` enum('set-group', 'set-secondary-group', 'apply-policiy', 'launch-script', 'launch-event', 'launch-alert-action', 'raw-config') DEFAULT 'launch-event', + `value` text, + `custom` text, PRIMARY KEY (`id`), KEY `id_autoconfig` (`id_autoconfig`), CONSTRAINT `tautoconfig_action_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE 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 19add1b91a..233f376410 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 @@ -1688,8 +1688,8 @@ CREATE TABLE IF NOT EXISTS `tautoconfig_rules` ( `order_by` int(11) NOT NULL DEFAULT '0', `operator` enum('AND','OR') DEFAULT 'OR', `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', - `value` varchar(100) NOT NULL DEFAULT '', - `custom` varchar(100) NOT NULL DEFAULT '', + `value` text, + `custom` text, PRIMARY KEY (`id`), KEY `id_autoconfig` (`id_autoconfig`), CONSTRAINT `tautoconfig_rules_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE @@ -1702,9 +1702,9 @@ CREATE TABLE IF NOT EXISTS `tautoconfig_actions` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_autoconfig` int(10) unsigned NOT NULL, `order` int(11) NOT NULL DEFAULT '0', - `action_type` enum('set-group', 'set-secondary-group','apply-policy','apply-all-policies','launch-event','launch-alert-action','raw-config') DEFAULT 'launch-event', - `value` varchar(100) NOT NULL DEFAULT '', - `custom` varchar(100) NOT NULL DEFAULT '', + `action_type` enum('set-group', 'set-secondary-group', 'apply-policiy', 'launch-script', 'launch-event', 'launch-alert-action', 'raw-config') DEFAULT 'launch-event', + `value` text, + `custom` text, PRIMARY KEY (`id`), KEY `id_autoconfig` (`id_autoconfig`), CONSTRAINT `tautoconfig_action_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index a06099511b..c3e6bdd9c7 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3215,8 +3215,8 @@ CREATE TABLE IF NOT EXISTS `tautoconfig_rules` ( `order_by` int(11) NOT NULL DEFAULT '0', `operator` enum('AND','OR') DEFAULT 'OR', `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', - `value` varchar(100) NOT NULL DEFAULT '', - `custom` varchar(100) NOT NULL DEFAULT '', + `value` text, + `custom` text, PRIMARY KEY (`id`), KEY `id_autoconfig` (`id_autoconfig`), CONSTRAINT `tautoconfig_rules_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE @@ -3229,9 +3229,9 @@ CREATE TABLE IF NOT EXISTS `tautoconfig_actions` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_autoconfig` int(10) unsigned NOT NULL, `order` int(11) NOT NULL DEFAULT '0', - `action_type` enum('set-group', 'set-secondary-group','apply-policy','apply-all-policies','launch-event','launch-alert-action','raw-config') DEFAULT 'launch-event', - `value` varchar(100) NOT NULL DEFAULT '', - `custom` varchar(100) NOT NULL DEFAULT '', + `action_type` enum('set-group', 'set-secondary-group', 'apply-policiy', 'launch-script', 'launch-event', 'launch-alert-action', 'raw-config') DEFAULT 'launch-event', + `value` text, + `custom` text, PRIMARY KEY (`id`), KEY `id_autoconfig` (`id_autoconfig`), CONSTRAINT `tautoconfig_action_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index afe1c98dfd..88eafe660a 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -487,6 +487,8 @@ sub pandora_load_config { $pa_config->{"provisioningserver_threads"} = 1; # 7.0 720 $pa_config->{"provisioning_cache_interval"} = 300; # 7.0 720 + $pa_config->{"autoconfigure_agents"} = 1; # 7.0 725 + # Check for UID0 if ($pa_config->{"quiet"} != 0){ if ($> == 0){ @@ -1113,6 +1115,9 @@ sub pandora_load_config { elsif ($parametro =~ m/^provisioning_cache_interval\s+([0-9]*)/i){ $pa_config->{'provisioning_cache_interval'}= clean_blank($1); } + elsif ($parametro =~ m/^autoconfigure_agents\s+([0-1])/i){ + $pa_config->{'autoconfigure_agents'}= clean_blank($1); + } } # end of loop for parameter # # Set to RDBMS' standard port diff --git a/pandora_server/lib/PandoraFMS/DB.pm b/pandora_server/lib/PandoraFMS/DB.pm index 1fe1208d78..417fd9cf5d 100644 --- a/pandora_server/lib/PandoraFMS/DB.pm +++ b/pandora_server/lib/PandoraFMS/DB.pm @@ -50,6 +50,7 @@ our @EXPORT = qw( db_text db_update db_update_get_values + set_update_agent get_action_id get_addr_id get_agent_addr_id @@ -801,6 +802,35 @@ sub get_db_rows_limit ($$$;@) { return @rows; } +########################################################################## +## Updates agent fields using field => value +## Be careful, no filter is done. +########################################################################## +sub set_update_agent { + my ($dbh, $agent_id, $data) = @_; + + return undef unless (defined($agent_id) && $agent_id > 0); + return undef unless (ref($data) eq "HASH"); + + # Build update query + my $query = 'UPDATE tagente SET '; + + my @values; + foreach my $field (keys %{$data}) { + push @values, $data->{$field}; + + $query .= ' ' . $field . ' = ?,'; + } + + chop($query); + + $query .= ' WHERE id_agente = ? '; + push @values, $agent_id; + + return db_update($dbh, $query, @values); +} + + ########################################################################## ## SQL delete with a LIMIT clause. ########################################################################## diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index ef62bab200..f0c05da7a4 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -409,6 +409,12 @@ sub process_xml_data ($$$$$) { } } } + + if (defined($pa_config->{'autoconfigure_agents'}) && $pa_config->{'autoconfigure_agents'} == 1) { + # Update agent configuration once, before create agent - MetaConsole port to Node + enterprise_hook('autoconfigure_agent', [$pa_config, $agent_name, $agent_id, $data, $dbh]); + } + } # Get the data of the agent, if fail return diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index 3afa5ff898..45ac0a6e93 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -990,6 +990,18 @@ sub init { return $conf; } +################################################################################ +# Update internal UA timeout +################################################################################ +sub ua_set_timeout { + my ($config, $timeout) = @_; + return unless looks_like_number($timeout) and $timeout > 0; + my $sys = get_sys_environment($config); + + return unless defined($sys->{'ua'}); + $sys->{'ua'}->timeout($timeout); +} + ################################################################################ # initialize plugin (basic) ################################################################################ From fb0800d37574fbc36e0b5a1e3583d30230a56924 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 4 Jul 2018 19:47:10 +0200 Subject: [PATCH 03/84] Minor fixes --- pandora_console/extras/mr/18.sql | 2 +- pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 +- pandora_console/pandoradb.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/extras/mr/18.sql b/pandora_console/extras/mr/18.sql index 310e42c1c8..26f97d8e21 100644 --- a/pandora_console/extras/mr/18.sql +++ b/pandora_console/extras/mr/18.sql @@ -22,7 +22,7 @@ CREATE TABLE `tautoconfig` ( CREATE TABLE `tautoconfig_rules` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_autoconfig` int(10) unsigned NOT NULL, - `order_by` int(11) NOT NULL DEFAULT '0', + `order` int(11) NOT NULL DEFAULT '0', `operator` enum('AND','OR') DEFAULT 'OR', `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', `value` text, 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 233f376410..203449fa1c 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 @@ -1685,7 +1685,7 @@ CREATE TABLE IF NOT EXISTS `tautoconfig` ( CREATE TABLE IF NOT EXISTS `tautoconfig_rules` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_autoconfig` int(10) unsigned NOT NULL, - `order_by` int(11) NOT NULL DEFAULT '0', + `order` int(11) NOT NULL DEFAULT '0', `operator` enum('AND','OR') DEFAULT 'OR', `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', `value` text, diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index c3e6bdd9c7..350b7dac99 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3212,7 +3212,7 @@ CREATE TABLE IF NOT EXISTS `tautoconfig` ( CREATE TABLE IF NOT EXISTS `tautoconfig_rules` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_autoconfig` int(10) unsigned NOT NULL, - `order_by` int(11) NOT NULL DEFAULT '0', + `order` int(11) NOT NULL DEFAULT '0', `operator` enum('AND','OR') DEFAULT 'OR', `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', `value` text, From 23a9cf7842afa7f52981b3ea111b355b842fcbed Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 4 Jul 2018 19:47:10 +0200 Subject: [PATCH 04/84] Minor fixes --- pandora_console/extras/mr/18.sql | 4 ++-- pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 4 ++-- pandora_console/pandoradb.sql | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pandora_console/extras/mr/18.sql b/pandora_console/extras/mr/18.sql index 310e42c1c8..0c86b45170 100644 --- a/pandora_console/extras/mr/18.sql +++ b/pandora_console/extras/mr/18.sql @@ -22,7 +22,7 @@ CREATE TABLE `tautoconfig` ( CREATE TABLE `tautoconfig_rules` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_autoconfig` int(10) unsigned NOT NULL, - `order_by` int(11) NOT NULL DEFAULT '0', + `order` int(11) NOT NULL DEFAULT '0', `operator` enum('AND','OR') DEFAULT 'OR', `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', `value` text, @@ -37,7 +37,7 @@ CREATE TABLE `tautoconfig_actions` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_autoconfig` int(10) unsigned NOT NULL, `order` int(11) NOT NULL DEFAULT '0', - `action_type` enum('set-group', 'set-secondary-group', 'apply-policiy', 'launch-script', 'launch-event', 'launch-alert-action', 'raw-config') DEFAULT 'launch-event', + `action_type` enum('set-group', 'set-secondary-group', 'apply-policy', 'launch-script', 'launch-event', 'launch-alert-action', 'raw-config') DEFAULT 'launch-event', `value` text, `custom` text, PRIMARY KEY (`id`), 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 233f376410..caaa95402d 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 @@ -1685,7 +1685,7 @@ CREATE TABLE IF NOT EXISTS `tautoconfig` ( CREATE TABLE IF NOT EXISTS `tautoconfig_rules` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_autoconfig` int(10) unsigned NOT NULL, - `order_by` int(11) NOT NULL DEFAULT '0', + `order` int(11) NOT NULL DEFAULT '0', `operator` enum('AND','OR') DEFAULT 'OR', `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', `value` text, @@ -1702,7 +1702,7 @@ CREATE TABLE IF NOT EXISTS `tautoconfig_actions` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_autoconfig` int(10) unsigned NOT NULL, `order` int(11) NOT NULL DEFAULT '0', - `action_type` enum('set-group', 'set-secondary-group', 'apply-policiy', 'launch-script', 'launch-event', 'launch-alert-action', 'raw-config') DEFAULT 'launch-event', + `action_type` enum('set-group', 'set-secondary-group', 'apply-policy', 'launch-script', 'launch-event', 'launch-alert-action', 'raw-config') DEFAULT 'launch-event', `value` text, `custom` text, PRIMARY KEY (`id`), diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index c3e6bdd9c7..e00ecfc28a 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3212,7 +3212,7 @@ CREATE TABLE IF NOT EXISTS `tautoconfig` ( CREATE TABLE IF NOT EXISTS `tautoconfig_rules` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_autoconfig` int(10) unsigned NOT NULL, - `order_by` int(11) NOT NULL DEFAULT '0', + `order` int(11) NOT NULL DEFAULT '0', `operator` enum('AND','OR') DEFAULT 'OR', `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', `value` text, @@ -3229,7 +3229,7 @@ CREATE TABLE IF NOT EXISTS `tautoconfig_actions` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id_autoconfig` int(10) unsigned NOT NULL, `order` int(11) NOT NULL DEFAULT '0', - `action_type` enum('set-group', 'set-secondary-group', 'apply-policiy', 'launch-script', 'launch-event', 'launch-alert-action', 'raw-config') DEFAULT 'launch-event', + `action_type` enum('set-group', 'set-secondary-group', 'apply-policy', 'launch-script', 'launch-event', 'launch-alert-action', 'raw-config') DEFAULT 'launch-event', `value` text, `custom` text, PRIMARY KEY (`id`), From 6ec4787c38e7a4a4221e44ec6ad0cd3342d18184 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 10 Jul 2018 15:11:18 +0200 Subject: [PATCH 05/84] added order filters to events table --- pandora_console/include/functions_events.php | 50 +++++++++++++++++-- .../operation/events/events.build_table.php | 12 ++--- .../operation/events/events_list.php | 7 ++- 3 files changed, 58 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 1348afc96b..bf3c2b49df 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -126,10 +126,10 @@ function events_get_events_no_grouped($sql_post, $offset = 0, function events_get_events_grouped($sql_post, $offset = 0, $pagination = 1, $meta = false, $history = false, $total = false, - $history_db = false, $order = "DESC") { - - global $config; + $history_db = false, $order = "down", $sort_field = "timestamp") { + global $config; + $table = events_get_events_table($meta, $history); if ($meta) { @@ -139,6 +139,7 @@ function events_get_events_grouped($sql_post, $offset = 0, $groupby_extra = ''; } + switch ($config["dbtype"]) { case "mysql": db_process_sql ('SET group_concat_max_len = 9999999'); @@ -162,7 +163,48 @@ function events_get_events_grouped($sql_post, $offset = 0, FROM $table te LEFT JOIN tagent_secondary_group tasg ON te.id_grupo = tasg.id_group WHERE 1=1 " . $sql_post . " GROUP BY estado, evento, id_agente, id_agentmodule" . $groupby_extra . " - ORDER BY timestamp_rep " . $order . " LIMIT " . $offset . "," . $pagination; + ORDER BY "; + + if (!empty($sort_field)) { + switch ($sort_field) { + case 'event_id': + if ($order=='up') + $sql .= "id_evento" . " ASC"; + if ($order=='down') + $sql .= "id_evento" . " DESC"; + break; + case 'event_name': + if ($order=='up') + $sql .= "evento" . " ASC"; + if ($order=='down') + $sql .= "evento" . " DESC"; + break; + case 'status': + if ($order=='up') + $sql .= "estado" . " ASC"; + if ($order=='down') + $sql .= "estado" . " DESC"; + break; + case 'agent_id': + if ($order=='up') + $sql .= "id_agente" . " ASC"; + if ($order=='down') + $sql .= "id_agente" . " DESC"; + break; + case 'timestamp': + if ($order=='up') + $sql .= "timestamp_rep" . " ASC"; + if ($order=='down') + $sql .= "timestamp_rep" . " DESC"; + break; + default: + $sql .= "timestamp_rep" . " DESC"; + } + } + + + $sql .= " LIMIT " . $offset . "," . $pagination; + } break; case "postgresql": diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index d00dbd522a..ca54bac707 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -130,7 +130,7 @@ else { //headers $i = 0; - $table->head[$i] = __('ID'); + $table->head[$i] = __('ID') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; @@ -141,7 +141,7 @@ else { $i++; } if (in_array('estado', $show_fields)) { - $table->head[$i] = __('Status'); + $table->head[$i] = __('Status') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } @@ -152,19 +152,19 @@ else { $i++; } if (in_array('evento', $show_fields)) { - $table->head[$i] = __('Event Name'); + $table->head[$i] = __('Event Name') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $table->style[$i] = 'min-width: 200px; max-width: 350px; word-break: break-all;'; $i++; } if (in_array('id_agente', $show_fields)) { - $table->head[$i] = __('Agent name'); + $table->head[$i] = __('Agent name') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $table->style[$i] = 'max-width: 350px; word-break: break-all;'; $i++; } if (in_array('timestamp', $show_fields)) { - $table->head[$i] = __('Timestamp'); + $table->head[$i] = __('Timestamp') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; @@ -741,7 +741,7 @@ else { echo '
'; if (!empty ($table->data)) { - + if ($allow_pagination) { ui_pagination ($total_events, $url, $offset, $pagination); } diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index 7fd0250f37..783383daa5 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -28,6 +28,10 @@ enterprise_include_once('include/functions_events.php'); check_login (); +$sort_field = get_parameter("sort_field", "timestamp"); + +$sort_order = get_parameter("sort", "down"); + $event_a = check_acl ($config['id_user'], 0, "ER"); $event_w = check_acl ($config['id_user'], 0, "EW"); $event_m = check_acl ($config['id_user'], 0, "EM"); @@ -758,7 +762,8 @@ elseif ($group_rep == 1) { $history, false, false, - 'DESC'); + $sort_order, + $sort_field); } elseif ($group_rep == 2) { $filter_resume['duplicate'] = $group_rep; From 3cc1f815ff808f6fbe80a8e5da7df05c18850f71 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 18 Jul 2018 17:56:35 +0200 Subject: [PATCH 06/84] Added extra compat. to print_module (plugintools) --- pandora_server/lib/PandoraFMS/PluginTools.pm | 22 ++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm index a68d86466d..d714e4dd9f 100644 --- a/pandora_server/lib/PandoraFMS/PluginTools.pm +++ b/pandora_server/lib/PandoraFMS/PluginTools.pm @@ -461,9 +461,7 @@ sub print_agent { # print_module ################################################################################ sub print_module { - my $conf = shift; - my $data = shift; - my $not_print_flag = shift; + my ($conf, $data, $not_print_flag) = @_; if ((ref($data) ne "HASH") || (!defined $data->{name})) { return undef; @@ -476,9 +474,21 @@ sub print_module { } $data->{value} = '' if empty($data->{value}); - $data->{tags} = $data->{tags}?$data->{tags}:($conf->{MODULE_TAG_LIST}?$conf->{MODULE_TAG_LIST}:undef); - $data->{interval} = $data->{interval}?$data->{interval}:($conf->{MODULE_INTERVAL}?$conf->{MODULE_INTERVAL}:undef); - $data->{module_group} = $data->{module_group}?$data->{module_group}:($conf->{MODULE_GROUP}?$conf->{MODULE_GROUP}:undef); + + $data->{tags} = ($data->{tags} ? + $data->{tags} : ($conf->{MODULE_TAG_LIST} ? + $conf->{MODULE_TAG_LIST} : ($conf->{module_tag_list} ? + $conf->{module_tag_list} : undef))); + + $data->{interval} = ($data->{interval} ? + $data->{interval} : ($conf->{MODULE_INTERVAL} ? + $conf->{MODULE_INTERVAL} : ($conf->{module_interval} ? + $conf->{module_interval} : undef))); + + $data->{module_group} = ($data->{module_group} ? + $data->{module_group} : ($conf->{MODULE_GROUP} ? + $conf->{MODULE_GROUP} : ( $conf->{module_group} ? + $conf->{module_group} : undef))); # Global instructions (if defined) From c09a91b284b6660f20516e6f4cb6e9c322028ed5 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Thu, 19 Jul 2018 08:35:33 +0200 Subject: [PATCH 07/84] Added server-name in tautoconfig_rules --- pandora_console/extras/mr/18.sql | 2 +- pandora_console/extras/pandoradb_migrate_6.0_to_7.0.mysql.sql | 2 +- pandora_console/pandoradb.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/extras/mr/18.sql b/pandora_console/extras/mr/18.sql index 0c86b45170..f0ebaddef2 100644 --- a/pandora_console/extras/mr/18.sql +++ b/pandora_console/extras/mr/18.sql @@ -24,7 +24,7 @@ CREATE TABLE `tautoconfig_rules` ( `id_autoconfig` int(10) unsigned NOT NULL, `order` int(11) NOT NULL DEFAULT '0', `operator` enum('AND','OR') DEFAULT 'OR', - `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', + `type` enum('alias','ip-range','group','os','custom-field','script','server-name') DEFAULT 'alias', `value` text, `custom` text, PRIMARY KEY (`id`), 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 caaa95402d..70118e2407 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 @@ -1687,7 +1687,7 @@ CREATE TABLE IF NOT EXISTS `tautoconfig_rules` ( `id_autoconfig` int(10) unsigned NOT NULL, `order` int(11) NOT NULL DEFAULT '0', `operator` enum('AND','OR') DEFAULT 'OR', - `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', + `type` enum('alias','ip-range','group','os','custom-field','script','server-name') DEFAULT 'alias', `value` text, `custom` text, PRIMARY KEY (`id`), diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index e00ecfc28a..7076c9349b 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3214,7 +3214,7 @@ CREATE TABLE IF NOT EXISTS `tautoconfig_rules` ( `id_autoconfig` int(10) unsigned NOT NULL, `order` int(11) NOT NULL DEFAULT '0', `operator` enum('AND','OR') DEFAULT 'OR', - `type` enum('alias','ip-range','group','os','custom-field','script') DEFAULT 'alias', + `type` enum('alias','ip-range','group','os','custom-field','script','server-name') DEFAULT 'alias', `value` text, `custom` text, PRIMARY KEY (`id`), From b922066a72f39837034ccd32a5b8c7c74cb3c6e0 Mon Sep 17 00:00:00 2001 From: "manuel.montes" Date: Thu, 19 Jul 2018 18:04:50 +0200 Subject: [PATCH 08/84] Add items to the view events --- pandora_console/extras/mr/18.sql | 12 +++++ .../godmode/events/custom_events.php | 8 +++ pandora_console/include/functions_events.php | 2 + pandora_console/include/functions_modules.php | 53 +++++++++++++++++++ .../operation/events/events.build_table.php | 22 ++++++++ pandora_console/pandoradb.sql | 6 +++ 6 files changed, 103 insertions(+) diff --git a/pandora_console/extras/mr/18.sql b/pandora_console/extras/mr/18.sql index 66963763d1..fcabc7de76 100644 --- a/pandora_console/extras/mr/18.sql +++ b/pandora_console/extras/mr/18.sql @@ -18,4 +18,16 @@ DROP INDEX id_policy ON `tpolicy_agents`; ALTER TABLE `tpolicy_agents` ADD COLUMN `id_node` int(10) NOT NULL DEFAULT '0'; ALTER TABLE `tpolicy_agents` ADD UNIQUE(`id_policy`, `id_agent`, `id_node`); +ALTER TABLE `tevento` ADD COLUMN `data` double(22,5) default NULL; + +ALTER TABLE `tmetaconsole_event` ADD COLUMN `data` double(22,5) default NULL; + +ALTER TABLE `tmetaconsole_event_history` ADD COLUMN `data` double(22,5) default NULL; + +ALTER TABLE `tevento` ADD COLUMN `module_status` int(4) NOT NULL default '0'; + +ALTER TABLE `tmetaconsole_event` ADD COLUMN `module_status` int(4) NOT NULL default '0'; + +ALTER TABLE `tmetaconsole_event_history` ADD COLUMN `module_status` int(4) NOT NULL default '0'; + COMMIT; \ No newline at end of file diff --git a/pandora_console/godmode/events/custom_events.php b/pandora_console/godmode/events/custom_events.php index a356b7bc47..134cb76a72 100644 --- a/pandora_console/godmode/events/custom_events.php +++ b/pandora_console/godmode/events/custom_events.php @@ -121,6 +121,12 @@ if ($fields_selected[0]!='') { case 'server_name': $result = __('Server name'); break; + case 'data': + $result = __('Data'); + case 'module_status': + $result = __('Module status'); + break; + break; } $result_selected[$field_selected] = $result; } @@ -168,6 +174,8 @@ $fields_available['owner_user'] = __('Owner'); $fields_available['ack_utimestamp'] = __('ACK Timestamp'); $fields_available['instructions'] = __('Instructions'); $fields_available['server_name'] = __('Server name'); +$fields_available['data'] = __('Data'); +$fields_available['module_status'] = __('Module status'); //remove fields already selected foreach ($fields_available as $key=>$available) { diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 1348afc96b..073dd62443 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -50,6 +50,8 @@ function events_get_all_fields() { $columns['ack_utimestamp'] = __('ACK Timestamp'); $columns['instructions'] = __('Instructions'); $columns['server_name'] = __('Server name'); + $columns['data'] = __('Data'); + $columns['module_status'] = __('Module status'); return $columns; } diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 59e88d9cdf..71d98a8d2e 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -2764,4 +2764,57 @@ function force_set_module_status ($status, $id_agent_module) { array('id_agente_modulo' => $id_agent_module) ); } +function modules_get_modules_status ($mod_status_id) { + + $diferent_types = get_priorities (); + + $mod_status_desc = ''; + switch ($mod_status_id) { + case AGENT_MODULE_STATUS_NORMAL: + $mod_status_desc = __('NORMAL'); + break; + case AGENT_MODULE_STATUS_CRITICAL_BAD: + $mod_status_desc = __('CRITICAL'); + break; + case AGENT_MODULE_STATUS_WARNING: + $mod_status_desc = __('WARNING'); + break; + case AGENT_MODULE_STATUS_UNKNOWN: + $mod_status_desc = __('UNKNOWN'); + break; + case AGENT_MODULE_STATUS_NOT_INIT: + $mod_status_desc = __('NOT INIT'); + break; + case AGENT_MODULE_STATUS_ALL: + $mod_status_desc = __('ALL'); + break; + case AGENT_MODULE_STATUS_CRITICAL_ALERT: + $mod_status_desc = __('CRITICAL'); + break; + case AGENT_MODULE_STATUS_NO_DATA: + $mod_status_desc = __('NO DATA'); + break; + case AGENT_MODULE_STATUS_NORMAL_ALERT: + $mod_status_desc = __('NORMAL'); + break; + case AGENT_MODULE_STATUS_NOT_NORMAL: + $mod_status_desc = __('NOT NORMAL'); + break; + case AGENT_MODULE_STATUS_WARNING_ALERT: + $mod_status_desc = __('WARNING'); + break; + default: + if (isset($config['text_char_long'])) { + foreach ($diferent_types as $key => $type) { + if ($key == $mod_status_id) { + $mod_status_desc = ui_print_truncate_text($type, + $config['text_char_long'], false, true, false); + } + } + } + break; + } + + return $mod_status_desc; +} ?> diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index d00dbd522a..c92f0dc795 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -249,6 +249,18 @@ else { $i++; } + if (in_array('data', $show_fields)) { + $table->head[$i] = __('Data'); + $table->align[$i] = 'left'; + + $i++; + } + if (in_array('module_status', $show_fields)) { + $table->head[$i] = __('Module status'); + $table->align[$i] = 'left'; + + $i++; + } if ($i != 0 && $allow_action) { $table->head[$i] = __('Action'); $table->align[$i] = 'left'; @@ -663,6 +675,16 @@ else { $table->cellclass[count($table->data)][$i] = $myclass; $i++; } + if (in_array('data',$show_fields)) { + $data[$i] = $event["data"]; + $table->cellclass[count($table->data)][$i] = $myclass; + $i++; + } + if (in_array('module_status',$show_fields)) { + $data[$i] = modules_get_modules_status ($event["module_status"]); + $table->cellclass[count($table->data)][$i] = $myclass; + $i++; + } if ($i != 0 && $allow_action) { //Actions diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index e57502ade8..a72c2051f0 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -641,6 +641,8 @@ CREATE TABLE IF NOT EXISTS `tevento` ( `owner_user` VARCHAR(100) NOT NULL DEFAULT '', `ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0', `custom_data` TEXT NOT NULL, + `data` double(22,5) default NULL, + `module_status` int(4) NOT NULL default '0', PRIMARY KEY (`id_evento`), KEY `idx_agente` (`id_agente`), KEY `idx_agentmodule` (`id_agentmodule`), @@ -2878,6 +2880,8 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` ( `ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0', `server_id` int(10) NOT NULL, `custom_data` TEXT NOT NULL DEFAULT '', + `data` double(22,5) default NULL, + `module_status` int(4) NOT NULL default '0', PRIMARY KEY (`id_evento`), KEY `idx_agente` (`id_agente`), KEY `idx_agentmodule` (`id_agentmodule`), @@ -2923,6 +2927,8 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event_history` ( `ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0', `server_id` int(10) NOT NULL, `custom_data` TEXT NOT NULL DEFAULT '', + `data` double(22,5) default NULL, + `module_status` int(4) NOT NULL default '0', PRIMARY KEY (`id_evento`), KEY `idx_agente` (`id_agente`), KEY `idx_agentmodule` (`id_agentmodule`), From d102a588eb1d37d48687b81c2ee0bfa1d898a887 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Fri, 20 Jul 2018 13:50:56 +0200 Subject: [PATCH 09/84] Add module data and status information to events. --- pandora_server/lib/PandoraFMS/Core.pm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 19caec0169..27f7794b8a 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -3116,11 +3116,12 @@ Generate an event. =cut ########################################################################## -sub pandora_event ($$$$$$$$$$;$$$$$$$$$) { +sub pandora_event ($$$$$$$$$$;$$$$$$$$$$$) { my ($pa_config, $evento, $id_grupo, $id_agente, $severity, $id_alert_am, $id_agentmodule, $event_type, $event_status, $dbh, $source, $user_name, $comment, $id_extra, $tags, - $critical_instructions, $warning_instructions, $unknown_instructions, $custom_data) = @_; + $critical_instructions, $warning_instructions, $unknown_instructions, $custom_data, + $module_data, $module_status) = @_; my $event_table = is_metaconsole($pa_config) ? 'tmetaconsole_event' : 'tevento'; my $agent = undef; @@ -3134,7 +3135,10 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$) { my $module = undef; if (defined($id_agentmodule) && $id_agentmodule != 0) { - $module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente_modulo = ?', $id_agentmodule); + $module = get_db_single_row ($dbh, 'SELECT *, tagente_estado.datos, tagente_estado.estado + FROM tagente_modulo, tagente_estado + WHERE tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo + AND tagente_modulo.id_agente_modulo = ?', $id_agentmodule); if (defined ($module) && $module->{'quiet'} == 1) { logger($pa_config, "Generate Event. The module '" . $module->{'nombre'} . "' is in quiet mode.", 10); return; @@ -3162,6 +3166,8 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$) { $warning_instructions = '' unless defined ($warning_instructions); $unknown_instructions = '' unless defined ($unknown_instructions); $custom_data = '' unless defined ($custom_data); + $module_data = defined($module) ? $module->{'datos'} : '' unless defined ($module_data); + $module_status = defined($module) ? $module->{'estado'} : '' unless defined ($module_status); # If the event is created with validated status, assign ack_utimestamp my $ack_utimestamp = $event_status == 1 ? time() : 0; @@ -3183,8 +3189,8 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$) { # Create the event logger($pa_config, "Generating event '$evento' for agent ID $id_agente module ID $id_agentmodule.", 10); - db_do ($dbh, 'INSERT INTO ' . $event_table . ' (id_agente, id_grupo, evento, timestamp, estado, utimestamp, event_type, id_agentmodule, id_alert_am, criticity, user_comment, tags, source, id_extra, id_usuario, critical_instructions, warning_instructions, unknown_instructions, ack_utimestamp, custom_data) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $id_agente, $id_grupo, safe_input ($evento), $timestamp, $event_status, $utimestamp, $event_type, $id_agentmodule, $id_alert_am, $severity, $comment, $module_tags, $source, $id_extra, $user_name, $critical_instructions, $warning_instructions, $unknown_instructions, $ack_utimestamp, $custom_data); + db_do ($dbh, 'INSERT INTO ' . $event_table . ' (id_agente, id_grupo, evento, timestamp, estado, utimestamp, event_type, id_agentmodule, id_alert_am, criticity, user_comment, tags, source, id_extra, id_usuario, critical_instructions, warning_instructions, unknown_instructions, ack_utimestamp, custom_data, data, module_status) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $id_agente, $id_grupo, safe_input ($evento), $timestamp, $event_status, $utimestamp, $event_type, $id_agentmodule, $id_alert_am, $severity, $comment, $module_tags, $source, $id_extra, $user_name, $critical_instructions, $warning_instructions, $unknown_instructions, $ack_utimestamp, $custom_data, $module_data, $module_status); # Do not write to the event file return if ($pa_config->{'event_file'} eq ''); @@ -4168,11 +4174,11 @@ sub generate_status_event ($$$$$$$$) { # Generate the event if ($status != 0){ pandora_event ($pa_config, $description, $agent->{'id_grupo'}, $module->{'id_agente'}, - $severity, 0, $module->{'id_agente_modulo'}, $event_type, 0, $dbh, 'monitoring_server', '', '', '', '', $module->{'critical_instructions'}, $module->{'warning_instructions'}, $module->{'unknown_instructions'}); + $severity, 0, $module->{'id_agente_modulo'}, $event_type, 0, $dbh, 'monitoring_server', '', '', '', '', $module->{'critical_instructions'}, $module->{'warning_instructions'}, $module->{'unknown_instructions'}, undef, $data, $status); } else { # Self validate this event if has "normal" status pandora_event ($pa_config, $description, $agent->{'id_grupo'}, $module->{'id_agente'}, - $severity, 0, $module->{'id_agente_modulo'}, $event_type, 1, $dbh, 'monitoring_server', '', '', '', '', $module->{'critical_instructions'}, $module->{'warning_instructions'}, $module->{'unknown_instructions'}); + $severity, 0, $module->{'id_agente_modulo'}, $event_type, 1, $dbh, 'monitoring_server', '', '', '', '', $module->{'critical_instructions'}, $module->{'warning_instructions'}, $module->{'unknown_instructions'}, undef, $data, $status); } } From f05ba656e125e0d68e009a60812aa2d812b6d2fa Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 23 Jul 2018 08:59:08 +0200 Subject: [PATCH 10/84] add functions api for policies node --- pandora_console/include/functions_api.php | 95 +++++++++---------- .../include/graphs/functions_utils.php | 18 ++++ 2 files changed, 61 insertions(+), 52 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 680181c380..4bcc570637 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -99,78 +99,69 @@ function returnError($typeError, $returnType = 'string') { break; default: returnData("string", - array('type' => 'string', 'data' => __($returnType))); + array('type' => 'string', 'data' => __($typeError))); break; } } /** - * * @param $returnType * @param $data * @param $separator - * * @return */ function returnData($returnType, $data, $separator = ';') { switch ($returnType) { case 'string': - if ($data['type'] == 'string') { - echo $data['data']; + if( is_array($data['data']) ){ + echo convert_array_multi($data['data'], $separator); } - else { - //TODO + else{ + echo $data['data']; } break; case 'csv': case 'csv_head': - switch ($data['type']) { - case 'array': - if (array_key_exists('list_index', $data)) - { - if ($returnType == 'csv_head') { - foreach($data['list_index'] as $index) { - echo $index; - if (end($data['list_index']) == $index) - echo "\n"; - else - echo $separator; - } - } - foreach($data['data'] as $dataContent) { - foreach($data['list_index'] as $index) { - if (array_key_exists($index, $dataContent)) - echo str_replace("\n", " ", $dataContent[$index]); - if (end($data['list_index']) == $index) - echo "\n"; - else - echo $separator; - } + if( is_array($data['data']) ){ + if (array_key_exists('list_index', $data)) { + if ($returnType == 'csv_head') { + foreach($data['list_index'] as $index) { + echo $index; + if (end($data['list_index']) == $index) + echo "\n"; + else + echo $separator; } } - else { - if (!empty($data['data'])) { - - foreach ($data['data'] as $dataContent) { - - $clean = array_map("array_apply_io_safe_output", $dataContent); - - foreach ($clean as $k => $v) { - $clean[$k] = str_replace("\r", "\n", $clean[$k]); - $clean[$k] = str_replace("\n", " ", $clean[$k]); - $clean[$k] = strip_tags($clean[$k]); - $clean[$k] = str_replace(';',' ',$clean[$k]); - } - $row = implode($separator, $clean); - - echo $row . "\n"; - } + foreach($data['data'] as $dataContent) { + foreach($data['list_index'] as $index) { + if (array_key_exists($index, $dataContent)) + echo str_replace("\n", " ", $dataContent[$index]); + if (end($data['list_index']) == $index) + echo "\n"; + else + echo $separator; } } - break; - case 'string': - echo $data['data']; - break; + } + else { + if (!empty($data['data'])) { + foreach ($data['data'] as $dataContent) { + $clean = array_map("array_apply_io_safe_output", $dataContent); + foreach ($clean as $k => $v) { + $clean[$k] = str_replace("\r", "\n", $clean[$k]); + $clean[$k] = str_replace("\n", " ", $clean[$k]); + $clean[$k] = strip_tags($clean[$k]); + $clean[$k] = str_replace(';',' ',$clean[$k]); + } + $row = implode($separator, $clean); + echo $row . "\n"; + } + } + } + } + else{ + echo $data['data']; } break; case 'json': @@ -180,13 +171,13 @@ function returnData($returnType, $data, $separator = ';') { if ($separator == ";") { $separator = null; } - + if(empty($separator)){ echo json_encode ($data); } else { echo json_encode ($data, $separator); } - + break; } } diff --git a/pandora_console/include/graphs/functions_utils.php b/pandora_console/include/graphs/functions_utils.php index 983a785dc4..e2d5ce96bb 100644 --- a/pandora_console/include/graphs/functions_utils.php +++ b/pandora_console/include/graphs/functions_utils.php @@ -301,4 +301,22 @@ function get_complementary_rgb ($hexcode) { return $rgbhex; } + +/** +* Returns convert array multidimensional to string whit gluer. +* @param array $array to convert +* @param string glue to implode +*/ +function convert_array_multi($array, $glue) { + $result = ''; + foreach ($array as $item) { + if (is_array($item)) { + $result .= convert_array_multi($item, $glue) . $glue; + } else { + $result .= $item . $glue; + } + } + $result = substr($result, 0, 0-strlen($glue)); + return $result; +} ?> \ No newline at end of file From 9236285a981a3b4ab3b50b30085800dd6034b304 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 23 Jul 2018 17:04:07 +0200 Subject: [PATCH 11/84] remove functions api to api enterprise because policies is enterprise --- pandora_console/include/functions_api.php | 215 ---------------------- 1 file changed, 215 deletions(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 4bcc570637..76968e1e75 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -5391,74 +5391,6 @@ function api_set_planned_downtimes_additem ($id, $thrash1, $other, $thrash3) { } } -/** - * Add agent to a policy. And return a message with the result of the operation. - * - * @param string $id Id of the target policy. - * @param $thrash1 Don't use. - * @param array $other it's array, $other as param is in this order - * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_) - * example: - * - * example: - * - * api.php?op=set&op2=add_agent_policy&id=1&other=167&other_mode=url_encode_separator_| - * - * @param $thrash3 Don't use - */ -function api_set_add_agent_policy($id, $thrash1, $other, $thrash2) { - if (defined ('METACONSOLE')) { - return; - } - - if ($id == "") { - returnError('error_add_agent_policy', __('Error adding agent to policy. Id_policy cannot be left blank.')); - return; - } - - if ($other['data'][0] == "") { - returnError('error_add_agent_policy', __('Error adding agent to policy. Id_agent cannot be left blank.')); - return; - } - - // Check if the agent exists and permissions - if (!util_api_check_agent_and_print_error((int) $other['data'][0], 'string', "AW")) { - return; - } - - // Check the policy permissions and existence - if (enterprise_hook('policies_check_user_policy', array($id)) === false) { - $result_agent = db_get_value ('id_agente', 'tagente', 'id_agente', (int) $other['data'][0]); - if ($result_agent) { - returnError('error_add_agent_policy', __('Error adding agent to policy. Id policy doesn\'t exist.')); - return; - } - returnError('forbidden', 'string'); - return; - } - - // Check if the agent is already in the policy - $id_agent_policy = enterprise_hook('policies_get_agents', array($id, array('id_agent' => $other['data'][0]), 'id')); - - if ($id_agent_policy === ENTERPRISE_NOT_HOOK) { - returnError('error_add_agent_policy', __('Error adding agent to policy.')); - return; - } - - if ($id_agent_policy === false) { - $success = enterprise_hook('policies_create_agent', array($other['data'][0], $id)); - } - else { - returnError('error_add_agent_policy', __('Error adding agent to policy. The agent is already in the policy.')); - return; - } - - if ($success) - returnData('string', array('type' => 'string', 'data' => $success)); - else - returnError('error_add_agent_policy', 'Error adding agent to policy.'); -} - /** * Add data module to policy. And return id from new module. * @@ -6420,153 +6352,6 @@ function api_set_update_snmp_module_policy($id, $thrash1, $other, $thrash3) { array('type' => 'string', 'data' => __('SNMP policy module updated.'))); } - -/** - * Apply policy. And return id from the applying operation. - * - * @param string $id Id of the target policy. - * @param $thrash1 Don't use. - * @param array $other Don't use - * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_) - * example: - * - * api.php?op=set&op2=apply_policy&id=1 - * - * @param $thrash3 Don't use - */ -function api_set_apply_policy($id, $thrash1, $other, $thrash3) { - if (defined ('METACONSOLE')) { - return; - } - - if ($id == "") { - returnError('error_apply_policy', __('Error applying policy. Id_policy cannot be left blank.')); - return; - } - - # Check if this operation is duplicated - $duplicated = enterprise_hook('policies_get_policy_queue_status', array($id)); - - if ($duplicated === ENTERPRISE_NOT_HOOK) { - // We want to return a value - if ($other == "return") { - return -1; - } - else { - returnError('error_apply_policy', __('Error applying policy.')); - return; - } - } - - if ($duplicated == STATUS_IN_QUEUE_APPLYING or $duplicated == STATUS_IN_QUEUE_IN) { - // We want to return a value - if ($other == "return") { - return -1; - } - else { - returnError('error_apply_policy', - __('Error applying policy. This policy is already pending to apply.')); - return; - } - } - - $check_acl = enterprise_hook('policies_check_user_policy', array($id)); - if ($check_acl !== true) { - // We want to return a value - if ($other == "return") { - return -1; - } - else { - returnError('error_apply_policy', __('Error applying policy.')); - return; - } - } - - $id = enterprise_hook('add_policy_queue_operation', array($id, 0, 'apply')); - - if ($id === ENTERPRISE_NOT_HOOK) { - // We want to return a value - if ($other == "return") { - return -1; - } - else { - returnError('error_apply_policy', __('Error applying policy.')); - return; - } - } - - // We want to return a value - if ($other == "return") { - if ($id) - return $id; - else - return -1; - } - else { - if ($id) - returnData('string', array('type' => 'string', 'data' => $id)); - else - returnError('error_apply_policy', 'Error applying policy.'); - } -} - - -/** - * Apply all policy in database. And return the number of policies applied. - * - * @param string $id Don't use. - * @param $thrash1 Don't use. - * @param array $other Don't use - * and separator char (after text ; ) and separator (pass in param othermode as othermode=url_encode_separator_) - * example: - * - * api.php?op=set&op2=apply_all_policies - * - * @param $thrash3 Don't use - */ -function api_set_apply_all_policies($thrash1, $thrash2, $other, $thrash3) { - global $config; - if (defined ('METACONSOLE')) { - return; - } - - if (!check_acl($config['id_user'], 0, "AW")) { - returnError('forbidden', 'string'); - return; - } - - $policies = array(); - - # Get all policies - $policies = enterprise_hook('policies_get_policies', array(false, false, false)); - - if ($policies === ENTERPRISE_NOT_HOOK) { - returnError('error_apply_all_policy', __('Error applying all policies.')); - return; - } - if ($policies === false) $policies = array(); - - $num_policies = count($policies); - $count_results = 0; - foreach ($policies as $policy) { - $return_value = enterprise_hook('add_policy_queue_operation', - array($policy['id'], 0, 'apply')); - - if ($return_value != -1) { - $count_results++; - } - } - - if ($num_policies > $count_results) { - $errors = $num_policies - $count_results; - - returnError('error_apply_policy', 'Error applying policy. ' . $errors . ' failed. '); - } - else { - returnData('string', array('type' => 'string', 'data' => $count_results)); - } -} - /** * Create a new group. And return the id_group of the new group. * From ba676e13e312808f723bc03fbe246a243807883e Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 23 Jul 2018 20:11:35 +0200 Subject: [PATCH 12/84] Added autoconfiguration menu --- pandora_console/godmode/menu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index fdf4b71360..f9b6632c23 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -101,12 +101,12 @@ if (check_acl ($config['id_user'], 0, "PM")) { $sub["godmode/modules/manage_network_templates"]["text"] = __('Module templates'); $sub["godmode/modules/manage_network_templates"]["id"] = 'Module templates'; enterprise_hook ('inventory_submenu'); + enterprise_hook ('autoconfiguration_menu'); } if (check_acl ($config['id_user'], 0, "AW")) { enterprise_hook ('policies_menu'); enterprise_hook('agents_submenu'); } - if (check_acl ($config['id_user'], 0, "AW")) { $sub["gmassive"]["text"] = __('Bulk operations'); $sub["gmassive"]["id"] = 'Bulk operations'; From 33dd9d5886656f1ca1129dd0eb4f5c8a8467229e Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 24 Jul 2018 00:01:28 +0200 Subject: [PATCH 13/84] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index c12981cb8e..fd697f3fb5 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-180723 +Version: 7.0NG.724-180724 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 cbb7845984..1cf756d366 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-180723" +pandora_version="7.0NG.724-180724" 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 cef976d906..339a58976c 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 => '180723'; +use constant AGENT_BUILD => '180724'; # 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 d3d19defea..6beba6628d 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 180723 +%define release 180724 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 a89db9d8ad..1d6e6c7dfa 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 180723 +%define release 180724 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 5ec0844d5c..c644947cf3 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="180723" +PI_BUILD="180724" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 65752904ed..2c6e33393b 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180723} +{180724} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 40f174ea95..e8e1a2c6ee 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 180723)") +#define PANDORA_VERSION ("7.0NG.724(Build 180724)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 1865784766..e903f9a1ff 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 180723))" + VALUE "ProductVersion", "(7.0NG.724(Build 180724))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index d5c3891711..bc06292a1e 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.724-180723 +Version: 7.0NG.724-180724 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 7ce84d14fe..b586fceeb3 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-180723" +pandora_version="7.0NG.724-180724" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 32c5cb18f9..7c208f5d0e 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 = 'PC180723'; +$build_version = 'PC180724'; $pandora_version = 'v7.0NG.724'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index c2c6f608fd..b26e3ce211 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index ceef27de97..ee3324eb28 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.724 -%define release 180723 +%define release 180724 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index c9be3888c9..299a855490 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.724 -%define release 180723 +%define release 180724 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 48c4db47fe..221879e1ca 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.724" -PI_BUILD="180723" +PI_BUILD="180724" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index edea68ffd2..0e9ad80a5d 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.724 PS180723"; +my $version = "7.0NG.724 PS180724"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 5a175a848e..ecedb3ba8e 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.724 PS180723"; +my $version = "7.0NG.724 PS180724"; # save program name for logging my $progname = basename($0); From 65ff6b260c70d27760530b94b226f4bc560f4b2a Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 24 Jul 2018 13:12:46 +0200 Subject: [PATCH 14/84] fixed error pandoradb metapolicies --- pandora_server/util/pandora_db.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 0e9ad80a5d..e38b87ea92 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -687,7 +687,7 @@ sub pandora_load_config_pdb ($) { ############################################################################### sub pandora_checkdb_integrity { - my $dbh = shift; + my ($conf, $dbh) = @_; log_message ('INTEGRITY', "Cleaning up group stats."); @@ -719,7 +719,7 @@ sub pandora_checkdb_integrity { db_do ($dbh, 'DELETE FROM tagente_datos_inc WHERE id_agente_modulo NOT IN (SELECT id_agente_modulo FROM tagente_modulo)'); # Check enterprise tables - enterprise_hook ('pandora_checkdb_integrity_enterprise', [$dbh]); + enterprise_hook ('pandora_checkdb_integrity_enterprise', [$conf, $dbh]); } ############################################################################### @@ -996,7 +996,7 @@ sub pandoradb_main ($$$) { pandora_checkdb_consistency ($conf, $dbh); # Maintain Referential integrity and other stuff - pandora_checkdb_integrity ($dbh); + pandora_checkdb_integrity ($conf, $dbh); # Move old data to the history DB if (defined ($history_dbh)) { From 7748fcf5ce6a6bc8146964db49bee589b4939dd8 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 24 Jul 2018 17:45:16 +0200 Subject: [PATCH 15/84] Updated version and build strings. --- pandora_agents/pc/AIX/pandora_agent.conf | 2 +- pandora_agents/pc/FreeBSD/pandora_agent.conf | 2 +- pandora_agents/pc/HP-UX/pandora_agent.conf | 2 +- pandora_agents/pc/Linux/pandora_agent.conf | 2 +- pandora_agents/pc/NT4/pandora_agent.conf | 2 +- pandora_agents/pc/SunOS/pandora_agent.conf | 2 +- pandora_agents/pc/Win32/pandora_agent.conf | 2 +- pandora_agents/shellscript/aix/pandora_agent.conf | 2 +- pandora_agents/shellscript/bsd-ipso/pandora_agent.conf | 2 +- pandora_agents/shellscript/hp-ux/pandora_agent.conf | 2 +- pandora_agents/shellscript/linux/pandora_agent.conf | 2 +- pandora_agents/shellscript/mac_osx/pandora_agent.conf | 2 +- pandora_agents/shellscript/openWRT/pandora_agent.conf | 2 +- pandora_agents/shellscript/solaris/pandora_agent.conf | 2 +- pandora_agents/unix/AIX/pandora_agent.conf | 2 +- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/Darwin/pandora_agent.conf | 2 +- pandora_agents/unix/FreeBSD/pandora_agent.conf | 2 +- pandora_agents/unix/HP-UX/pandora_agent.conf | 2 +- pandora_agents/unix/Linux/pandora_agent.conf | 2 +- pandora_agents/unix/NT4/pandora_agent.conf | 2 +- pandora_agents/unix/NetBSD/pandora_agent.conf | 2 +- pandora_agents/unix/SunOS/pandora_agent.conf | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 4 ++-- pandora_agents/unix/pandora_agent.spec | 4 ++-- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/bin/pandora_agent.conf | 2 +- pandora_agents/win32/installer/pandora.mpi | 4 ++-- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 4 ++-- pandora_console/pandora_console.spec | 4 ++-- pandora_console/pandora_console_install | 2 +- pandora_console/pandoradb_data.sql | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/conf/pandora_server.conf.new | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 4 ++-- pandora_server/pandora_server.spec | 4 ++-- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 50 files changed, 57 insertions(+), 57 deletions(-) diff --git a/pandora_agents/pc/AIX/pandora_agent.conf b/pandora_agents/pc/AIX/pandora_agent.conf index 17af72510d..245a30ef4c 100644 --- a/pandora_agents/pc/AIX/pandora_agent.conf +++ b/pandora_agents/pc/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724, AIX version +# Version 7.0NG.725, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/FreeBSD/pandora_agent.conf b/pandora_agents/pc/FreeBSD/pandora_agent.conf index 5ddcfbf6d9..0fc2927c2f 100644 --- a/pandora_agents/pc/FreeBSD/pandora_agent.conf +++ b/pandora_agents/pc/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724, FreeBSD Version +# Version 7.0NG.725, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/HP-UX/pandora_agent.conf b/pandora_agents/pc/HP-UX/pandora_agent.conf index a1c9b17c55..c97115d409 100644 --- a/pandora_agents/pc/HP-UX/pandora_agent.conf +++ b/pandora_agents/pc/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724, HP-UX Version +# Version 7.0NG.725, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Linux/pandora_agent.conf b/pandora_agents/pc/Linux/pandora_agent.conf index d62e268b24..a0d7d5ea8d 100644 --- a/pandora_agents/pc/Linux/pandora_agent.conf +++ b/pandora_agents/pc/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724, GNU/Linux +# Version 7.0NG.725, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/NT4/pandora_agent.conf b/pandora_agents/pc/NT4/pandora_agent.conf index 1450b7dc3b..995d0d33d7 100644 --- a/pandora_agents/pc/NT4/pandora_agent.conf +++ b/pandora_agents/pc/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724, GNU/Linux +# Version 7.0NG.725, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/SunOS/pandora_agent.conf b/pandora_agents/pc/SunOS/pandora_agent.conf index 909148bd3d..fa86fe707d 100644 --- a/pandora_agents/pc/SunOS/pandora_agent.conf +++ b/pandora_agents/pc/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724, Solaris Version +# Version 7.0NG.725, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/pc/Win32/pandora_agent.conf b/pandora_agents/pc/Win32/pandora_agent.conf index 5e3194a8cc..d347375de2 100644 --- a/pandora_agents/pc/Win32/pandora_agent.conf +++ b/pandora_agents/pc/Win32/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2010 Artica Soluciones Tecnologicas -# Version 7.0NG.724 +# Version 7.0NG.725 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software diff --git a/pandora_agents/shellscript/aix/pandora_agent.conf b/pandora_agents/shellscript/aix/pandora_agent.conf index 3b9fe9a7a7..965020560c 100644 --- a/pandora_agents/shellscript/aix/pandora_agent.conf +++ b/pandora_agents/shellscript/aix/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.724, AIX version +# Version 7.0NG.725, AIX version # General Parameters # ================== diff --git a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf index 79d8968952..edca5a3c52 100644 --- a/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf +++ b/pandora_agents/shellscript/bsd-ipso/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.724 +# Version 7.0NG.725 # FreeBSD/IPSO version # Licenced under GPL licence, 2003-2007 Sancho Lerena diff --git a/pandora_agents/shellscript/hp-ux/pandora_agent.conf b/pandora_agents/shellscript/hp-ux/pandora_agent.conf index e3dfd27731..edec1bb26c 100644 --- a/pandora_agents/shellscript/hp-ux/pandora_agent.conf +++ b/pandora_agents/shellscript/hp-ux/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.724, HPUX Version +# Version 7.0NG.725, HPUX Version # General Parameters # ================== diff --git a/pandora_agents/shellscript/linux/pandora_agent.conf b/pandora_agents/shellscript/linux/pandora_agent.conf index 8acf764a5b..dfe908bae8 100644 --- a/pandora_agents/shellscript/linux/pandora_agent.conf +++ b/pandora_agents/shellscript/linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724 +# Version 7.0NG.725 # Licensed under GPL license v2, # (c) 2003-2010 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/mac_osx/pandora_agent.conf b/pandora_agents/shellscript/mac_osx/pandora_agent.conf index a2019f25da..9b1c31e469 100644 --- a/pandora_agents/shellscript/mac_osx/pandora_agent.conf +++ b/pandora_agents/shellscript/mac_osx/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724 +# Version 7.0NG.725 # Licensed under GPL license v2, # (c) 2003-2009 Artica Soluciones Tecnologicas # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/openWRT/pandora_agent.conf b/pandora_agents/shellscript/openWRT/pandora_agent.conf index 7bd610392f..c7806abd5c 100644 --- a/pandora_agents/shellscript/openWRT/pandora_agent.conf +++ b/pandora_agents/shellscript/openWRT/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724 +# Version 7.0NG.725 # Licensed under GPL license v2, # please visit http://pandora.sourceforge.net diff --git a/pandora_agents/shellscript/solaris/pandora_agent.conf b/pandora_agents/shellscript/solaris/pandora_agent.conf index 010e99f76b..17bd56f29d 100644 --- a/pandora_agents/shellscript/solaris/pandora_agent.conf +++ b/pandora_agents/shellscript/solaris/pandora_agent.conf @@ -1,6 +1,6 @@ # Fichero de configuracion base de agentes de Pandora # Base config file for Pandora agents -# Version 7.0NG.724, Solaris version +# Version 7.0NG.725, Solaris version # General Parameters # ================== diff --git a/pandora_agents/unix/AIX/pandora_agent.conf b/pandora_agents/unix/AIX/pandora_agent.conf index babed637b9..95cb035609 100644 --- a/pandora_agents/unix/AIX/pandora_agent.conf +++ b/pandora_agents/unix/AIX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724, AIX version +# Version 7.0NG.725, AIX version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index fd697f3fb5..3d582859ef 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-180724 +Version: 7.0NG.725 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 1cf756d366..20ce37142d 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-180724" +pandora_version="7.0NG.725" 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/Darwin/pandora_agent.conf b/pandora_agents/unix/Darwin/pandora_agent.conf index 3b3ca87c5b..c7f2a3547c 100644 --- a/pandora_agents/unix/Darwin/pandora_agent.conf +++ b/pandora_agents/unix/Darwin/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724, GNU/Linux +# Version 7.0NG.725, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2012 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/FreeBSD/pandora_agent.conf b/pandora_agents/unix/FreeBSD/pandora_agent.conf index 3b103eab67..f0568cae8f 100644 --- a/pandora_agents/unix/FreeBSD/pandora_agent.conf +++ b/pandora_agents/unix/FreeBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724, FreeBSD Version +# Version 7.0NG.725, FreeBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2016 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/HP-UX/pandora_agent.conf b/pandora_agents/unix/HP-UX/pandora_agent.conf index e8473cc321..77b678de67 100644 --- a/pandora_agents/unix/HP-UX/pandora_agent.conf +++ b/pandora_agents/unix/HP-UX/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724, HP-UX Version +# Version 7.0NG.725, HP-UX Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index a3dd4cccac..754470aa4c 100644 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724, GNU/Linux +# Version 7.0NG.725, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2014 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NT4/pandora_agent.conf b/pandora_agents/unix/NT4/pandora_agent.conf index 19b8c551e1..dde28ceef5 100644 --- a/pandora_agents/unix/NT4/pandora_agent.conf +++ b/pandora_agents/unix/NT4/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724, GNU/Linux +# Version 7.0NG.725, GNU/Linux # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/NetBSD/pandora_agent.conf b/pandora_agents/unix/NetBSD/pandora_agent.conf index cf1aaf60b7..682fd6f270 100644 --- a/pandora_agents/unix/NetBSD/pandora_agent.conf +++ b/pandora_agents/unix/NetBSD/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724, NetBSD Version +# Version 7.0NG.725, NetBSD Version # Licensed under GPL license v2, # Copyright (c) 2003-2010 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/SunOS/pandora_agent.conf b/pandora_agents/unix/SunOS/pandora_agent.conf index dcd12cda47..7bdcf6fbde 100644 --- a/pandora_agents/unix/SunOS/pandora_agent.conf +++ b/pandora_agents/unix/SunOS/pandora_agent.conf @@ -1,5 +1,5 @@ # Base config file for Pandora FMS agents -# Version 7.0NG.724, Solaris Version +# Version 7.0NG.725, Solaris Version # Licensed under GPL license v2, # Copyright (c) 2003-2009 Artica Soluciones Tecnologicas # http://www.pandorafms.com diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 339a58976c..7eba6c7568 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -41,7 +41,7 @@ my $Sem = undef; # Semaphore used to control the number of threads my $ThreadSem = undef; -use constant AGENT_VERSION => '7.0NG.724'; +use constant AGENT_VERSION => '7.0NG.725'; use constant AGENT_BUILD => '180724'; # Agent log default file size maximum and instances diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 6beba6628d..cfa1685a92 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.724 -%define release 180724 +%define version 7.0NG.725 +%define release 1 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 1d6e6c7dfa..da8d726c09 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -2,8 +2,8 @@ #Pandora FMS Linux Agent # %define name pandorafms_agent_unix -%define version 7.0NG.724 -%define release 180724 +%define version 7.0NG.725 +%define release 1 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 c644947cf3..fc33760bf5 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -9,7 +9,7 @@ # Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license. # ********************************************************************** -PI_VERSION="7.0NG.724" +PI_VERSION="7.0NG.725" PI_BUILD="180724" OS_NAME=`uname -s` diff --git a/pandora_agents/win32/bin/pandora_agent.conf b/pandora_agents/win32/bin/pandora_agent.conf index fc179e93d7..e7a920d22c 100644 --- a/pandora_agents/win32/bin/pandora_agent.conf +++ b/pandora_agents/win32/bin/pandora_agent.conf @@ -1,6 +1,6 @@ # Base config file for Pandora FMS Windows Agent # (c) 2006-2017 Artica Soluciones Tecnologicas -# Version 7.0NG.724 +# Version 7.0NG.725 # This program is Free Software, you can redistribute it and/or modify it # under the terms of the GNU General Public Licence as published by the Free Software diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 2c6e33393b..08e172eee7 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -3,7 +3,7 @@ AllowLanguageSelection {Yes} AppName -{Pandora FMS Windows Agent v7.0NG.724} +{Pandora FMS Windows Agent v7.0NG.725} ApplicationID {17E3D2CF-CA02-406B-8A80-9D31C17BD08F} @@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives {No} Windows,Executable -{<%AppName%>-<%Version%>-Setup<%Ext%>} +{<%AppName%>-Setup<%Ext%>} Windows,FileDescription {<%AppName%> <%Version%> Setup} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index e8e1a2c6ee..85ce207f48 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 180724)") +#define PANDORA_VERSION ("7.0NG.725(Build 180724)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index e903f9a1ff..4f80c6eacd 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 180724))" + VALUE "ProductVersion", "(7.0NG.725(Build 180724))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index bc06292a1e..ce32b37b01 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.724-180724 +Version: 7.0NG.725 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 b586fceeb3..dfba79b615 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-180724" +pandora_version="7.0NG.725" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 7c208f5d0e..6cb8151a09 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -23,7 +23,7 @@ * Pandora build version and version */ $build_version = 'PC180724'; -$pandora_version = 'v7.0NG.724'; +$pandora_version = 'v7.0NG.725'; // Do not overwrite default timezone set if defined. $script_tz = @date_default_timezone_get(); diff --git a/pandora_console/install.php b/pandora_console/install.php index b26e3ce211..58d27e482c 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -70,7 +70,7 @@
Date: Tue, 24 Jul 2018 17:55:33 +0200 Subject: [PATCH 16/84] Added management_allowed --- pandora_console/include/functions.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 4b9e8ef6da..d83dc42df5 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1363,6 +1363,19 @@ function is_metaconsole() { return (bool) $config['metaconsole']; } +/** + * @brief Check if there is management operations are allowed in current context + * (node // meta) + * + * @return bool + */ +function is_management_allowed() { + global $config; + return ( (is_metaconsole() && $config["centralized_management"]) + || (is_metaconsole() && !$config["centralized_management"]) + || (!is_metaconsole() && !$config["centralized_management"])); +} + /** * @brief Check if there is centralized management in metaconsole environment. * Usefull to display some policy features on metaconsole. From ae6d7139b4ed98d760d872e1f52c918ab2dc6ac1 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 24 Jul 2018 18:24:03 +0200 Subject: [PATCH 17/84] is_management_allowed fix --- pandora_console/include/functions.php | 1 - 1 file changed, 1 deletion(-) diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index d83dc42df5..7e93e52aa4 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1372,7 +1372,6 @@ function is_metaconsole() { function is_management_allowed() { global $config; return ( (is_metaconsole() && $config["centralized_management"]) - || (is_metaconsole() && !$config["centralized_management"]) || (!is_metaconsole() && !$config["centralized_management"])); } From b0434e7f1d4aeaa1c94fc80bd3697247acb5abd9 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 25 Jul 2018 00:01:26 +0200 Subject: [PATCH 18/84] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 4 ++-- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 25 insertions(+), 25 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 3d582859ef..ff4ec57040 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.725 +Version: 7.0NG.725-180725 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 20ce37142d..bc4259fc44 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.725" +pandora_version="7.0NG.725-180725" 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 7eba6c7568..02314d6ead 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.725'; -use constant AGENT_BUILD => '180724'; +use constant AGENT_BUILD => '180725'; # 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 cfa1685a92..7d868309dc 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.725 -%define release 1 +%define release 180725 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 da8d726c09..4dcc82f513 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.725 -%define release 1 +%define release 180725 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 fc33760bf5..21eee055b0 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180724" +PI_BUILD="180725" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 08e172eee7..8695408856 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180724} +{180725} ViewReadme {Yes} @@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives {No} Windows,Executable -{<%AppName%>-Setup<%Ext%>} +{<%AppName%>-<%Version%>-Setup<%Ext%>} Windows,FileDescription {<%AppName%> <%Version%> Setup} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 85ce207f48..2e46cfe3b0 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.725(Build 180724)") +#define PANDORA_VERSION ("7.0NG.725(Build 180725)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 4f80c6eacd..92431309bf 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.725(Build 180724))" + VALUE "ProductVersion", "(7.0NG.725(Build 180725))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index ce32b37b01..c38be84dc4 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.725 +Version: 7.0NG.725-180725 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 dfba79b615..132f865779 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.725" +pandora_version="7.0NG.725-180725" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 6cb8151a09..cc1fac6bec 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 = 'PC180724'; +$build_version = 'PC180725'; $pandora_version = 'v7.0NG.725'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 58d27e482c..4611126fa6 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 6109f2b602..c759f64240 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 1 +%define release 180725 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index d4b4bb4b56..963351249b 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 1 +%define release 180725 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 93501af374..a7c9ac585a 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180724" +PI_BUILD="180725" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 5c190b56f3..9bb6e53e32 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.725 PS180724"; +my $version = "7.0NG.725 PS180725"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 32081a122d..19c3cb0d99 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.725 PS180724"; +my $version = "7.0NG.725 PS180725"; # save program name for logging my $progname = basename($0); From fb73a0b8b21fb6316f835e6a49835089ae83fb87 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 26 Jul 2018 00:01:30 +0200 Subject: [PATCH 19/84] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index ff4ec57040..e963a771a4 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.725-180725 +Version: 7.0NG.725-180726 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 bc4259fc44..848259e9e0 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.725-180725" +pandora_version="7.0NG.725-180726" 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 02314d6ead..c4266001b9 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.725'; -use constant AGENT_BUILD => '180725'; +use constant AGENT_BUILD => '180726'; # 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 7d868309dc..e079132a83 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.725 -%define release 180725 +%define release 180726 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 4dcc82f513..5b15b35e92 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.725 -%define release 180725 +%define release 180726 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 21eee055b0..d483a05998 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180725" +PI_BUILD="180726" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 8695408856..d9b2a246e1 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180725} +{180726} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 2e46cfe3b0..768dbb6195 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.725(Build 180725)") +#define PANDORA_VERSION ("7.0NG.725(Build 180726)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 92431309bf..929f8e25e5 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.725(Build 180725))" + VALUE "ProductVersion", "(7.0NG.725(Build 180726))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c38be84dc4..5b2bcf7bf9 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.725-180725 +Version: 7.0NG.725-180726 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 132f865779..c96ebf9db8 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.725-180725" +pandora_version="7.0NG.725-180726" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index cc1fac6bec..b500ced0d5 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 = 'PC180725'; +$build_version = 'PC180726'; $pandora_version = 'v7.0NG.725'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 4611126fa6..0ded92421f 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index c759f64240..cda9a94319 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180725 +%define release 180726 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 963351249b..3ffa021a25 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180725 +%define release 180726 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index a7c9ac585a..af24963781 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180725" +PI_BUILD="180726" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 9bb6e53e32..ecd730adda 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.725 PS180725"; +my $version = "7.0NG.725 PS180726"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 19c3cb0d99..60d5ad0b77 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.725 PS180725"; +my $version = "7.0NG.725 PS180726"; # save program name for logging my $progname = basename($0); From 3985316a9ba13f6d3a63b2d7a7d13b3cf19ebfad Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 26 Jul 2018 12:41:09 +0200 Subject: [PATCH 20/84] fixed errors in policies metaconsole --- pandora_console/include/functions_ui.php | 43 ++++++++++----- .../operation/agentes/alerts_status.php | 14 ++--- .../operation/agentes/status_monitor.php | 53 +++++++++++++------ 3 files changed, 72 insertions(+), 38 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 4ba0fde1c5..376de23869 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -831,22 +831,39 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f $description = io_safe_output($template['name']); $data = array (); - - if (!defined('METACONSOLE')) { - if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { - $policyInfo = policies_is_alert_in_policy2($alert['id'], false); - if ($policyInfo === false) - $data[$index['policy']] = ''; - else { - $img = 'images/policies.png'; - + + if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { + if(is_metaconsole()){ + $node = metaconsole_get_connection_by_id($alert['server_data']['id']); + if (metaconsole_load_external_db($node) !== NOERR) { + // Restore the default connection. + metaconsole_restore_db(); + $errors++; + break; + } + } + + $policyInfo = policies_is_alert_in_policy2($alert['id'], false); + if ($policyInfo === false) + $data[$index['policy']] = ''; + else { + $img = 'images/policies.png'; + if(!is_metaconsole()){ $data[$index['policy']] = '' . html_print_image($img,true, array('title' => $policyInfo['name'])) . ''; + }else{ + $data[$index['policy']] = '' . + html_print_image($img,true, array('title' => $policyInfo['name'])) . + ''; } } + + if(is_metaconsole()){ + metaconsole_restore_db(); + } } - + // Standby $data[$index['standby']] = ''; if (isset ($alert["standby"]) && $alert["standby"] == 1) { @@ -881,8 +898,8 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f $agent_name = false; $id_agent = modules_get_agentmodule_agent ($alert["id_agent_module"]); } - - if (defined('METACONSOLE') && !can_user_access_node ()) { + + if (defined('METACONSOLE') || !can_user_access_node ()) { $data[$index['agent_name']] = ui_print_truncate_text($agent_name, 'agent_small', false, true, false, '[…]', 'font-size:7.5pt;'); } else { @@ -893,7 +910,7 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f $data[$index['agent_name']] .= ' '.$agente["alias"].''; } } - + $data[$index['module_name']] = ui_print_truncate_text (isset($alert['agent_module_name']) ? $alert['agent_module_name'] : modules_get_agentmodule_name ($alert["id_agent_module"]), 'module_small', false, true, true, '[…]', 'font-size: 7.2pt'); } diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index 93b31abf14..12c7fd5d8d 100755 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -449,11 +449,9 @@ $table->align = array (); if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if ($print_agent) { - if (!is_metaconsole()) { - $table->head[0] = "" . - __('P.') . ""; - } - + + $table->head[0] = "" . __('P.') . ""; + $table->head[1] = "" . __('S.') . ""; @@ -496,10 +494,8 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { } } else { - if (!is_metaconsole()) { - $table->head[0] = "" . __('P.') . ""; - } - + $table->head[0] = "" . __('P.') . ""; + $table->head[1] = "" . __('S.') . ""; if (!is_metaconsole()) { diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 812df978f1..8d0a703584 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -977,17 +977,17 @@ if (!empty($result)) { $table->head[2] = __('Data Type'); $table->head[2] .= ' ' . html_print_image('images/sort_up.png', true, array('style' => $selectTypeUp, 'alt' => 'up')) . '' . '' . html_print_image('images/sort_down.png', true, array('style' => $selectTypeDown, 'alt' => 'down')) . ''; - + $table->align[2] = 'left'; $table->head[3] = __('Module name'); $table->head[3] .= ' ' . html_print_image('images/sort_up.png', true, array('style' => $selectModuleNameUp, 'alt' => 'up')) . '' . '' . html_print_image('images/sort_down.png', true, array('style' => $selectModuleNameDown, 'alt' => 'down')) . ''; - - $table->head[4] = __('Server type'); + + $table->head[4] = __('Server type'); $table->head[4] .= ' ' . html_print_image('images/sort_up.png', true, array('style' => $selectModuleNameUp, 'alt' => 'up')) . '' . '' . html_print_image('images/sort_down.png', true, array('style' => $selectModuleNameDown, 'alt' => 'down')) . ''; - + $table->head[5] = __('Interval'); $table->head[5] .= ' ' . html_print_image('images/sort_up.png', true, array('style' => $selectIntervalUp, 'alt' => 'up')) . '' . '' . html_print_image('images/sort_down.png', true, array('style' => $selectIntervalDown, 'alt' => 'down')) . ''; @@ -1024,36 +1024,47 @@ if (!empty($result)) { //Avoid unset, null and false value if (empty($row['server_name'])) $row['server_name'] = ""; - + $is_web_content_string = (bool)db_get_value_filter('id_agente_modulo', 'tagente_modulo', array('id_agente_modulo' => $row['id_agente_modulo'], 'id_tipo_modulo' => $id_type_web_content_string)); - + //Fixed the goliat sends the strings from web //without HTML entities if ($is_web_content_string) { $row['datos'] = io_safe_input($row['datos']); } - + //Fixed the data from Selenium Plugin if ($row['datos'] != strip_tags($row['datos'])) { $row['datos'] = io_safe_input($row['datos']); } - + $data = array (); if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { + if(is_metaconsole()){ + $node = metaconsole_get_connection_by_id($row['server_id']); + if (metaconsole_load_external_db($node) !== NOERR) { + // Restore the default connection. + metaconsole_restore_db(); + $errors++; + break; + } + } + $policyInfo = policies_info_module_policy($row['id_agente_modulo']); + if ($policyInfo === false) $data[0] = ''; else { $linked = policies_is_module_linked($row['id_agente_modulo']); - + $adopt = false; if (policies_is_module_adopt($row['id_agente_modulo'])) { $adopt = true; } - + if ($linked) { if ($adopt) { $img = 'images/policies_brick.png'; @@ -1074,15 +1085,25 @@ if (!empty($result)) { $title = __('(Unlinked) ') . $policyInfo['name_policy']; } } - - $data[0] = '' . - html_print_image($img,true, array('title' => $title)) . - ''; + if(is_metaconsole()){ + $data[0] = '' . + html_print_image($img,true, array('title' => $title)) . + ''; + } + else{ + $data[0] = '' . + html_print_image($img,true, array('title' => $title)) . + ''; + } + } + + if(is_metaconsole()){ + metaconsole_restore_db(); } } - + $agent_alias = !empty($row['agent_alias']) ? $row['agent_alias'] : $row['agent_name']; - + // TODO: Calculate hash access before to use it more simply like other sections. I.E. Events view if (defined('METACONSOLE')) { $agent_link = ' Date: Thu, 26 Jul 2018 15:30:49 +0200 Subject: [PATCH 21/84] fix bug in metaconsole view events --- .../godmode/events/custom_events.php | 32 +++++++++---------- .../operation/events/events.build_table.php | 16 ++++++---- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/pandora_console/godmode/events/custom_events.php b/pandora_console/godmode/events/custom_events.php index 134cb76a72..3ca3d625bb 100644 --- a/pandora_console/godmode/events/custom_events.php +++ b/pandora_console/godmode/events/custom_events.php @@ -65,10 +65,10 @@ if ($fields_selected[0]!='') { foreach ($fields_selected as $field_selected) { switch ($field_selected) { case 'id_evento': - $result = __('Event id'); + $result = __('Event Id'); break; case 'evento': - $result = __('Event name'); + $result = __('Event Name'); break; case 'id_agente': $result = __('Agent name'); @@ -86,10 +86,10 @@ if ($fields_selected[0]!='') { $result = __('Timestamp'); break; case 'event_type': - $result = __('Event type'); + $result = __('Event Type'); break; case 'id_agentmodule': - $result = __('Agent module'); + $result = __('Module Name'); break; case 'id_alert_am': $result = __('Alert'); @@ -107,7 +107,7 @@ if ($fields_selected[0]!='') { $result = __('Source'); break; case 'id_extra': - $result = __('Extra id'); + $result = __('Extra Id'); break; case 'owner_user': $result = __('Owner'); @@ -119,13 +119,13 @@ if ($fields_selected[0]!='') { $result = __('Instructions'); break; case 'server_name': - $result = __('Server name'); + $result = __('Server Name'); break; case 'data': $result = __('Data'); - case 'module_status': - $result = __('Module status'); break; + case 'module_status': + $result = __('Module Status'); break; } $result_selected[$field_selected] = $result; @@ -155,27 +155,27 @@ $table->data = array(); $fields_available = array(); -$fields_available['id_evento'] = __('Event id'); -$fields_available['evento'] = __('Event name'); -$fields_available['id_agente'] = __('Agent name'); +$fields_available['id_evento'] = __('Event Id'); +$fields_available['evento'] = __('Event Name'); +$fields_available['id_agente'] = __('Agent Name'); $fields_available['id_usuario'] = __('User'); $fields_available['id_grupo'] = __('Group'); $fields_available['estado'] = __('Status'); $fields_available['timestamp'] = __('Timestamp'); -$fields_available['event_type'] = __('Event type'); -$fields_available['id_agentmodule'] = __('Agent module'); +$fields_available['event_type'] = __('Event Type'); +$fields_available['id_agentmodule'] = __('Module Name'); $fields_available['id_alert_am'] = __('Alert'); $fields_available['criticity'] = __('Severity'); $fields_available['user_comment'] = __('Comment'); $fields_available['tags'] = __('Tags'); $fields_available['source'] = __('Source'); -$fields_available['id_extra'] = __('Extra id'); +$fields_available['id_extra'] = __('Extra Id'); $fields_available['owner_user'] = __('Owner'); $fields_available['ack_utimestamp'] = __('ACK Timestamp'); $fields_available['instructions'] = __('Instructions'); -$fields_available['server_name'] = __('Server name'); +$fields_available['server_name'] = __('Server Name'); $fields_available['data'] = __('Data'); -$fields_available['module_status'] = __('Module status'); +$fields_available['module_status'] = __('Module Status'); //remove fields already selected foreach ($fields_available as $key=>$available) { diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index c92f0dc795..4d6649cc1b 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -158,7 +158,7 @@ else { $i++; } if (in_array('id_agente', $show_fields)) { - $table->head[$i] = __('Agent name'); + $table->head[$i] = __('Agent Name'); $table->align[$i] = 'left'; $table->style[$i] = 'max-width: 350px; word-break: break-all;'; $i++; @@ -188,14 +188,14 @@ else { $i++; } if (in_array('event_type', $show_fields)) { - $table->head[$i] = __('Event type'); + $table->head[$i] = __('Event Type'); $table->align[$i] = 'left'; $table->style[$i] = 'min-width: 85px;'; $i++; } if (in_array('id_agentmodule', $show_fields)) { - $table->head[$i] = __('Agent Module'); + $table->head[$i] = __('Module Name'); $table->align[$i] = 'left'; $i++; @@ -256,7 +256,7 @@ else { $i++; } if (in_array('module_status', $show_fields)) { - $table->head[$i] = __('Module status'); + $table->head[$i] = __('Module Status'); $table->align[$i] = 'left'; $i++; @@ -675,10 +675,14 @@ else { $table->cellclass[count($table->data)][$i] = $myclass; $i++; } - if (in_array('data',$show_fields)) { + if (in_array('data',$show_fields)) { $data[$i] = $event["data"]; + if($data[$i] %1 == 0) + $data[$i]= number_format($data[$i], 0); + else + $data[$i]= number_format($data[$i], 2); $table->cellclass[count($table->data)][$i] = $myclass; - $i++; + $i++; } if (in_array('module_status',$show_fields)) { $data[$i] = modules_get_modules_status ($event["module_status"]); From a38e93b1c1de0d719f11088ca11ab344acc98da7 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Thu, 26 Jul 2018 15:39:38 +0200 Subject: [PATCH 22/84] Fixed node connection in visual_map --- pandora_console/include/functions_visual_map.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 9773bd831d..4387e3fd95 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -1731,6 +1731,9 @@ function visual_map_print_item($mode = "read", $layoutData, $result = array_merge($result, $result_server); } + if ($connection) { + metaconsole_restore_db(); + } } } From 4b23824eb47e09355b2d1cb1b35523b605e86fa5 Mon Sep 17 00:00:00 2001 From: "manuel.montes" Date: Thu, 26 Jul 2018 15:41:52 +0200 Subject: [PATCH 23/84] fix bug in metaconsole view events --- .../godmode/events/custom_events.php | 35 +++++------ pandora_console/include/functions_events.php | 60 +++++++++++++------ .../operation/events/events.build_table.php | 14 +++-- 3 files changed, 69 insertions(+), 40 deletions(-) diff --git a/pandora_console/godmode/events/custom_events.php b/pandora_console/godmode/events/custom_events.php index 134cb76a72..9b519fa6dd 100644 --- a/pandora_console/godmode/events/custom_events.php +++ b/pandora_console/godmode/events/custom_events.php @@ -65,13 +65,13 @@ if ($fields_selected[0]!='') { foreach ($fields_selected as $field_selected) { switch ($field_selected) { case 'id_evento': - $result = __('Event id'); + $result = __('Event Id'); break; case 'evento': - $result = __('Event name'); + $result = __('Event Name'); break; case 'id_agente': - $result = __('Agent name'); + $result = __('Agent Name'); break; case 'id_usuario': $result = __('User'); @@ -86,10 +86,10 @@ if ($fields_selected[0]!='') { $result = __('Timestamp'); break; case 'event_type': - $result = __('Event type'); + $result = __('Event Type'); break; case 'id_agentmodule': - $result = __('Agent module'); + $result = __('Module Name'); break; case 'id_alert_am': $result = __('Alert'); @@ -107,7 +107,7 @@ if ($fields_selected[0]!='') { $result = __('Source'); break; case 'id_extra': - $result = __('Extra id'); + $result = __('Extra Id'); break; case 'owner_user': $result = __('Owner'); @@ -119,14 +119,15 @@ if ($fields_selected[0]!='') { $result = __('Instructions'); break; case 'server_name': - $result = __('Server name'); + $result = __('Server Name'); break; case 'data': $result = __('Data'); - case 'module_status': - $result = __('Module status'); break; + case 'module_status': + $result = __('Module Status'); break; + } $result_selected[$field_selected] = $result; } @@ -155,27 +156,27 @@ $table->data = array(); $fields_available = array(); -$fields_available['id_evento'] = __('Event id'); -$fields_available['evento'] = __('Event name'); -$fields_available['id_agente'] = __('Agent name'); +$fields_available['id_evento'] = __('Event Id'); +$fields_available['evento'] = __('Event Name'); +$fields_available['id_agente'] = __('Agent Name'); $fields_available['id_usuario'] = __('User'); $fields_available['id_grupo'] = __('Group'); $fields_available['estado'] = __('Status'); $fields_available['timestamp'] = __('Timestamp'); -$fields_available['event_type'] = __('Event type'); -$fields_available['id_agentmodule'] = __('Agent module'); +$fields_available['event_type'] = __('Event Type'); +$fields_available['id_agentmodule'] = __('Module Name'); $fields_available['id_alert_am'] = __('Alert'); $fields_available['criticity'] = __('Severity'); $fields_available['user_comment'] = __('Comment'); $fields_available['tags'] = __('Tags'); $fields_available['source'] = __('Source'); -$fields_available['id_extra'] = __('Extra id'); +$fields_available['id_extra'] = __('Extra Id'); $fields_available['owner_user'] = __('Owner'); $fields_available['ack_utimestamp'] = __('ACK Timestamp'); $fields_available['instructions'] = __('Instructions'); -$fields_available['server_name'] = __('Server name'); +$fields_available['server_name'] = __('Server Name'); $fields_available['data'] = __('Data'); -$fields_available['module_status'] = __('Module status'); +$fields_available['module_status'] = __('Module Status'); //remove fields already selected foreach ($fields_available as $key=>$available) { diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 073dd62443..c7bde839f9 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -723,15 +723,15 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0, event_type, criticity, id_agentmodule, id_alert_am, critical_instructions, warning_instructions, unknown_instructions, source, tags, custom_data, - server_id, id_extra) + server_id, id_extra, data, module_status) VALUES (%d, %d, "%s", NOW(), %d, UNIX_TIMESTAMP(NOW()), "%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s", - "%s", "%s", %d, "%s")', + "%s", "%s", %d, "%s", %d, %d)', $id_agent, $id_group, $event, $status, $id_user, $event_type, $priority, $id_agent_module, $id_aam, $critical_instructions, $warning_instructions, $unknown_instructions, $source, $tags, $custom_data, - $server_id, $id_extra); + $server_id, $id_extra, $data, $module_status); break; case "postgresql": $sql = sprintf (' @@ -740,16 +740,16 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0, event_type, criticity, id_agentmodule, id_alert_am, critical_instructions, warning_instructions, unknown_instructions, source, tags, custom_data, - server_id, id_extra) + server_id, id_extra, data, module_status) VALUES (%d, %d, "%s", NOW(), %d, ceil(date_part(\'epoch\', CURRENT_TIMESTAMP)), "%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", - "%s", %d, "%s")', + "%s", %d, "%s", %d, %d)', $id_agent, $id_group, $event, $status, $id_user, $event_type, $priority, $id_agent_module, $id_aam, $critical_instructions, $warning_instructions, $unknown_instructions, $source, $tags, $custom_data, - $server_id, $id_extra); + $server_id, $id_extra, $data, $module_status); break; case "oracle": $sql = sprintf (' @@ -758,15 +758,15 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0, event_type, criticity, id_agentmodule, id_alert_am, critical_instructions, warning_instructions, unknown_instructions, source, tags, custom_data, - server_id, id_extra) + server_id, id_extra, data, module_status) VALUES (%d, %d, "%s", CURRENT_TIMESTAMP, %d, UNIX_TIMESTAMP, "%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s", - "%s", "%s", %d, "%s")', + "%s", "%s", %d, "%s", %d, %d)', $id_agent, $id_group, $event, $status, $id_user, $event_type, $priority, $id_agent_module, $id_aam, $critical_instructions, $warning_instructions, $unknown_instructions, $source, $tags, $custom_data, - $server_id, $id_extra); + $server_id, $id_extra, $data, $module_status); break; } } @@ -778,13 +778,13 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0, timestamp, estado, utimestamp, id_usuario, event_type, criticity, id_agentmodule, id_alert_am, critical_instructions, warning_instructions, - unknown_instructions, source, tags, custom_data, id_extra) + unknown_instructions, source, tags, custom_data, id_extra, data, module_status) VALUES (%d, %d, "%s", NOW(), %d, UNIX_TIMESTAMP(NOW()), - "%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s", "%s")', + "%s", "%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s", "%s", %d, %d)', $id_agent, $id_group, $event, $status, $id_user, $event_type, $priority, $id_agent_module, $id_aam, $critical_instructions, $warning_instructions, - $unknown_instructions, $source, $tags, $custom_data, $id_extra); + $unknown_instructions, $source, $tags, $custom_data, $id_extra, $data, $module_status); break; case "postgresql": $sql = sprintf (' @@ -792,14 +792,14 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0, timestamp, estado, utimestamp, id_usuario, event_type, criticity, id_agentmodule, id_alert_am, critical_instructions, warning_instructions, - unknown_instructions, source, tags, custom_data, id_extra) + unknown_instructions, source, tags, custom_data, id_extra, data, module_status) VALUES (%d, %d, "%s", NOW(), %d, ceil(date_part(\'epoch\', CURRENT_TIMESTAMP)), "%s", - "%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s", "%s")', + "%s", %d, %d, %d, "%s", "%s", "%s", "%s", "%s", "%s", "%s", %d, %d)', $id_agent, $id_group, $event, $status, $id_user, $event_type, $priority, $id_agent_module, $id_aam, $critical_instructions, $warning_instructions, - $unknown_instructions, $source, $tags, $custom_data, $id_extra); + $unknown_instructions, $source, $tags, $custom_data, $id_extra, $data, $module_status); break; case "oracle": $sql = sprintf (" @@ -807,13 +807,13 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0, timestamp, estado, utimestamp, id_usuario, event_type, criticity, id_agentmodule, id_alert_am, critical_instructions, warning_instructions, - unknown_instructions, source, tags, custom_data, id_extra) + unknown_instructions, source, tags, custom_data, id_extra, data, module_status) VALUES (%d, %d, '%s', CURRENT_TIMESTAMP, %d, UNIX_TIMESTAMP, - '%s', '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s')", + '%s', '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d)", $id_agent, $id_group, $event, $status, $id_user, $event_type, $priority, $id_agent_module, $id_aam, $critical_instructions, $warning_instructions, - $unknown_instructions, $source, $tags, $custom_data, $id_extra); + $unknown_instructions, $source, $tags, $custom_data, $id_extra, $data, $module_status); break; } } @@ -3705,6 +3705,16 @@ function events_list_events_grouped_agents($sql) { $table->align[$i] = 'left'; $i++; } + if (in_array('data', $show_fields)) { + $table->head[$i] = __('Data'); + $table->align[$i] = 'left'; + $i++; + } + if (in_array('module_status', $show_fields)) { + $table->head[$i] = __('Module status'); + $table->align[$i] = 'left'; + $i++; + } if ($i != 0 && $allow_action) { $table->head[$i] = __('Action'); $table->align[$i] = 'left'; @@ -4104,6 +4114,20 @@ function events_list_events_grouped_agents($sql) { $table->cellclass[count($table->data)][$i] = $myclass; $i++; } + if (in_array('data',$show_fields)) { + $data[$i] = $event["data"]; + if($data[$i] %1 == 0) + $data[$i]= number_format($data[$i], 0); + else + $data[$i]= number_format($data[$i], 2); + $table->cellclass[count($table->data)][$i] = $myclass; + $i++; + } + if (in_array('module_status',$show_fields)) { + $data[$i] = modules_get_modules_status ($event["module_status"]); + $table->cellclass[count($table->data)][$i] = $myclass; + $i++; + } if ($i != 0 && $allow_action) { //Actions diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index c92f0dc795..6069add213 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -158,7 +158,7 @@ else { $i++; } if (in_array('id_agente', $show_fields)) { - $table->head[$i] = __('Agent name'); + $table->head[$i] = __('Agent Name'); $table->align[$i] = 'left'; $table->style[$i] = 'max-width: 350px; word-break: break-all;'; $i++; @@ -188,14 +188,14 @@ else { $i++; } if (in_array('event_type', $show_fields)) { - $table->head[$i] = __('Event type'); + $table->head[$i] = __('Event Type'); $table->align[$i] = 'left'; $table->style[$i] = 'min-width: 85px;'; $i++; } if (in_array('id_agentmodule', $show_fields)) { - $table->head[$i] = __('Agent Module'); + $table->head[$i] = __('Module Name'); $table->align[$i] = 'left'; $i++; @@ -256,7 +256,7 @@ else { $i++; } if (in_array('module_status', $show_fields)) { - $table->head[$i] = __('Module status'); + $table->head[$i] = __('Module Status'); $table->align[$i] = 'left'; $i++; @@ -677,8 +677,12 @@ else { } if (in_array('data',$show_fields)) { $data[$i] = $event["data"]; + if($data[$i] %1 == 0) + $data[$i]= number_format($data[$i], 0); + else + $data[$i]= number_format($data[$i], 2); $table->cellclass[count($table->data)][$i] = $myclass; - $i++; + $i++; } if (in_array('module_status',$show_fields)) { $data[$i] = modules_get_modules_status ($event["module_status"]); From 284f9928195fce29386324b3c9173865978917a3 Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 27 Jul 2018 00:01:29 +0200 Subject: [PATCH 24/84] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index e963a771a4..a6de46cc23 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.725-180726 +Version: 7.0NG.725-180727 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 848259e9e0..4f1ad1456d 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.725-180726" +pandora_version="7.0NG.725-180727" 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 c4266001b9..01cb5afeff 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.725'; -use constant AGENT_BUILD => '180726'; +use constant AGENT_BUILD => '180727'; # 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 e079132a83..556b5fdfa9 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.725 -%define release 180726 +%define release 180727 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 5b15b35e92..bf14f7da43 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.725 -%define release 180726 +%define release 180727 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 d483a05998..6a5d695d0a 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180726" +PI_BUILD="180727" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index d9b2a246e1..a37667825e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180726} +{180727} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 768dbb6195..b0ad78e119 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.725(Build 180726)") +#define PANDORA_VERSION ("7.0NG.725(Build 180727)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 929f8e25e5..0418f280ed 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.725(Build 180726))" + VALUE "ProductVersion", "(7.0NG.725(Build 180727))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 5b2bcf7bf9..0ceabdbda5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.725-180726 +Version: 7.0NG.725-180727 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 c96ebf9db8..8861a67310 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.725-180726" +pandora_version="7.0NG.725-180727" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index b500ced0d5..58e4ed0f65 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 = 'PC180726'; +$build_version = 'PC180727'; $pandora_version = 'v7.0NG.725'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 0ded92421f..ecfa789371 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index cda9a94319..353e41a720 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180726 +%define release 180727 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 3ffa021a25..fafc616613 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180726 +%define release 180727 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index af24963781..8c2f50bf4a 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180726" +PI_BUILD="180727" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index ecd730adda..264931d3f6 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.725 PS180726"; +my $version = "7.0NG.725 PS180727"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 60d5ad0b77..84c012aa26 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.725 PS180726"; +my $version = "7.0NG.725 PS180727"; # save program name for logging my $progname = basename($0); From 8247df6d65cb9802ab2345ffa4365398028e2669 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Fri, 27 Jul 2018 10:42:45 +0200 Subject: [PATCH 25/84] Fixed edit snmp modules in bulk --- .../godmode/massive/massive_edit_modules.php | 131 ++++++++++-------- 1 file changed, 76 insertions(+), 55 deletions(-) diff --git a/pandora_console/godmode/massive/massive_edit_modules.php b/pandora_console/godmode/massive/massive_edit_modules.php index 87fb1b3173..e7f92d4594 100755 --- a/pandora_console/godmode/massive/massive_edit_modules.php +++ b/pandora_console/godmode/massive/massive_edit_modules.php @@ -650,25 +650,25 @@ $table->data['edit16'][1] = html_print_input_text ('max_retries', '', '', 5, 10, __('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'][1] = ''; $table->data['edit16'][2] = __('Port'); $table->data['edit16'][3] = html_print_input_text ('tcp_port', '', '', 5, 20, true); $table->data['edit17'][0] = __('TCP send') . ' ' . ui_print_help_icon ("tcp_send", true); -$table->data['edit17'][1] = html_print_textarea ('tcp_send', 2, 65, '', '', true); +$table->data['edit17'][1] = html_print_textarea ('tcp_send2', 2, 65, '', '', true); $table->data['edit17'][2] = __('TCP receive'); $table->data['edit17'][3] = html_print_textarea ('tcp_rcv', 2, 65, '', '', true); $table->data['edit18'][0] = __('WMI query') . ui_print_help_icon ('wmiquery', true); -$table->data['edit18'][1] = html_print_input_text ('snmp_oid', '', '', 35, 255, true); +$table->data['edit18'][1] = html_print_input_text ('wmi_query', '', '', 35, 255, true); $table->data['edit18'][2] = __('Key string'); -$table->data['edit18'][3] = html_print_input_text ('snmp_community', '', '', 20, 60, true); +$table->data['edit18'][3] = html_print_input_text ('key_string', '', '', 20, 60, true); $table->data['edit19'][0] = __('Field number') . ui_print_help_icon ('wmifield', true); -$table->data['edit19'][1] = html_print_input_text ('tcp_port', '', '', 5, 15, true); +$table->data['edit19'][1] = html_print_input_text ('field_number', '', '', 5, 15, true); $table->data['edit20'][0] = __('Plugin') . ui_print_help_icon ('plugin_macros', true); $table->data['edit20'][1] = html_print_select_from_sql ('SELECT id, name FROM tplugin ORDER BY name', @@ -1381,7 +1381,8 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu 'id_category', 'disabled_types_event', 'ip_target', "custom_ip_target", 'descripcion', 'min_ff_event_normal', 'min_ff_event_warning', 'min_ff_event_critical', 'each_ff', 'module_ff_interval', - 'ff_timeout', 'max_timeout','tcp_port','max_retries','tcp_rcv','id_plugin'); + 'ff_timeout', 'max_timeout','tcp_port','max_retries','tcp_rcv','id_plugin', + 'wmi_query','key_string','field_number','tcp_send2','plugin_parameter_text'); $values = array (); foreach ($fields as $field) { @@ -1391,61 +1392,55 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu case 'id_plugin': if ($value != 0) { - $value_field_1 = get_parameter ('_field1_', ''); - $value_field_1_desc = get_parameter ('desc_field1_', ''); - - $value_field_2 = get_parameter ('_field2_', ''); - $value_field_2_desc = get_parameter ('desc_field2_', ''); - - $value_field_3 = get_parameter ('_field3_', ''); - $value_field_3_desc = get_parameter ('desc_field3_', ''); - - $value_field_4 = get_parameter ('_field4_', ''); - $value_field_4_desc = get_parameter ('desc_field4_', ''); - - $value_field_5 = get_parameter ('_field5_', ''); - $value_field_5_desc = get_parameter ('desc_field5_', ''); - - $values['macros'] = '{"1":{"macro":"_field1_","desc":"'.io_safe_input($value_field_1_desc).'","help":"'.io_safe_input($value_field_1_desc).'","value":"'.$value_field_1.'"}'; - - if($value_field_2_desc != ''){ - $values['macros'] .= ',"2":{"macro":"_field2_","desc":"'.io_safe_input($value_field_2_desc).'","help":"'.io_safe_input($value_field_2_desc).'","value":"'.$value_field_2.'"}'; - - if($value_field_3_desc != ''){ - $values['macros'] .= ',"3":{"macro":"_field3_","desc":"'.io_safe_input($value_field_3_desc).'","help":"'.io_safe_input($value_field_3_desc).'","value":"'.$value_field_3.'"}'; + $value_field_1 = get_parameter ('_field1_', ''); + $value_field_1_desc = get_parameter ('desc_field1_', ''); - if($value_field_4_desc != ''){ - $values['macros'] .= ',"4":{"macro":"_field4_","desc":"'.io_safe_input($value_field_4_desc).'","help":"'.io_safe_input($value_field_4_desc).'","value":"'.$value_field_4.'"}'; - - if($value_field_5_desc != ''){ - $values['macros'] .= ',"5":{"macro":"_field5_","desc":"'.io_safe_input($value_field_5_desc).'","help":"'.io_safe_input($value_field_5_desc).'","value":"'.$value_field_5.'"}'; - } - else{ - $values['macros'] .= '}'; - } - + $value_field_2 = get_parameter ('_field2_', ''); + $value_field_2_desc = get_parameter ('desc_field2_', ''); + + $value_field_3 = get_parameter ('_field3_', ''); + $value_field_3_desc = get_parameter ('desc_field3_', ''); + + $value_field_4 = get_parameter ('_field4_', ''); + $value_field_4_desc = get_parameter ('desc_field4_', ''); + + $value_field_5 = get_parameter ('_field5_', ''); + $value_field_5_desc = get_parameter ('desc_field5_', ''); + + $values['macros'] = '{"1":{"macro":"_field1_","desc":"'.io_safe_input($value_field_1_desc).'","help":"'.io_safe_input($value_field_1_desc).'","value":"'.$value_field_1.'"}'; + + if($value_field_2_desc != ''){ + $values['macros'] .= ',"2":{"macro":"_field2_","desc":"'.io_safe_input($value_field_2_desc).'","help":"'.io_safe_input($value_field_2_desc).'","value":"'.$value_field_2.'"}'; + + if($value_field_3_desc != ''){ + $values['macros'] .= ',"3":{"macro":"_field3_","desc":"'.io_safe_input($value_field_3_desc).'","help":"'.io_safe_input($value_field_3_desc).'","value":"'.$value_field_3.'"}'; + + if($value_field_4_desc != ''){ + $values['macros'] .= ',"4":{"macro":"_field4_","desc":"'.io_safe_input($value_field_4_desc).'","help":"'.io_safe_input($value_field_4_desc).'","value":"'.$value_field_4.'"}'; + + if($value_field_5_desc != ''){ + $values['macros'] .= ',"5":{"macro":"_field5_","desc":"'.io_safe_input($value_field_5_desc).'","help":"'.io_safe_input($value_field_5_desc).'","value":"'.$value_field_5.'"}'; + } + else{ + $values['macros'] .= '}'; + } + + } + else{ + $values['macros'] .= '}'; + } + + } + else{ + $values['macros'] .= '}'; + } } else{ $values['macros'] .= '}'; } - - } - else{ - $values['macros'] .= '}'; - } - } - else{ - $values['macros'] .= '}'; - } - - - - } - - - break; + case 'module_interval': if ($value != 0) { $values[$field] = $value; @@ -1470,6 +1465,32 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu } } break; + case 'wmi_query': + if ($value != '') { + $values['snmp_oid'] = $value; + } + break; + case 'key_string': + if ($value != '') { + $values['snmp_community'] = $value; + } + break; + case 'field_number': + if ($value != '') { + $values['tcp_port'] = $value; + } + break; + + case 'tcp_send2': + if ($value != '') { + $values['tcp_send'] = $value; + } + break; + case 'plugin_parameter_text': + if ($value != '') { + $values['plugin_parameter'] = $value; + } + break; default: if ($value != '') { $values[$field] = $value; @@ -1477,7 +1498,7 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu break; } } - + // Specific snmp reused fields if (get_parameter ('tcp_send', '') == 3) { $plugin_user_snmp = get_parameter ('plugin_user_snmp', ''); From d740240a51b2ae1b1cdc4866d14c6c5075fe737b Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 27 Jul 2018 14:07:02 +0200 Subject: [PATCH 26/84] fixed error data string show --- pandora_console/include/ajax/module.php | 10 +++++++++- pandora_console/include/functions_ui.php | 7 ++++++- pandora_console/operation/agentes/snapshot_view.php | 12 ++++++------ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 6c7ea543a6..470cdd471e 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -355,7 +355,15 @@ if ($get_module_detail) { if($data_macro){ $data[] = $data_macro; } else { - $data[] = $row[$attr[0]]; + $datos = $row[$attr[0]]; + $datos = preg_replace ('//', '>', $datos); + $datos = preg_replace ('/\n/i','
',$datos); + $datos = preg_replace ('/\s/i',' ',$datos); + $datos_format = "
"; + $datos_format .= $datos; + $datos_format .= "
"; + $data[] = $datos_format; } } } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 376de23869..644200f271 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3853,12 +3853,17 @@ function ui_print_module_string_value($value, $id_agente_module, $salida = $value; } else { + $value = preg_replace ('//', '>', $value); + $value = preg_replace ('/\n/i','
',$value); + $value = preg_replace ('/\s/i',' ',$value); + $title_dialog = modules_get_agentmodule_agent_alias($id_agente_module) . " / " . $module_name; $salida = "
" . + style='display: none; width: 100%; height: 100%; overflow: scroll; padding: 10px; font-size: 14px; line-height: 16px; font-family: mono,monospace; text-align: left' title='" . $title_dialog . "'>" . $value . "
" . "image'; } else { - $datos = preg_replace ('//', '>', $datos); - $datos = preg_replace ('/\n/i','
',$datos); - $datos = preg_replace ('/\s/i',' ',$datos); - echo "
"; + $last_data = preg_replace ('//', '>', $last_data); + $last_data = preg_replace ('/\n/i','
',$last_data); + $last_data = preg_replace ('/\s/i',' ',$last_data); + echo "
"; echo $last_data; echo "
"; ?> "; - + $returnString = ob_get_clean(); - - - - + if ($return) return $returnString; else From cd26042fa9419bfe127fa3b6e5e0513a644d499d Mon Sep 17 00:00:00 2001 From: danielmaya Date: Tue, 31 Jul 2018 15:41:15 +0200 Subject: [PATCH 37/84] Fixed event graph in cluster view --- pandora_console/include/styles/pandora.css | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index b4731de2ca..fe4782bb31 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -4617,10 +4617,6 @@ form ul.form_flex li ul li{ flex-direction: column; } -.events_bar { - margin:0 auto; -} - #snmp_data { background: #f9faf9; } From 1088c5390daeb9258b4ab1e0472c404c086793cd Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 1 Aug 2018 00:01:22 +0200 Subject: [PATCH 38/84] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 9bf89cb256..e2c58e4f81 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.725-180731 +Version: 7.0NG.725-180801 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 cd6dc2351b..67edde8dd5 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.725-180731" +pandora_version="7.0NG.725-180801" 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 7d699403dc..4f0c54665c 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.725'; -use constant AGENT_BUILD => '180731'; +use constant AGENT_BUILD => '180801'; # 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 7677ad56a7..1ae8669e9c 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.725 -%define release 180731 +%define release 180801 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 60a39e4015..f65c65827b 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.725 -%define release 180731 +%define release 180801 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 8fd08b5d32..a027d020c2 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180731" +PI_BUILD="180801" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 5095aa4e67..3a0e72d40b 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180731} +{180801} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index a31b8834ae..dd9efa094b 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.725(Build 180731)") +#define PANDORA_VERSION ("7.0NG.725(Build 180801)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index a61f351085..aaa0385f71 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.725(Build 180731))" + VALUE "ProductVersion", "(7.0NG.725(Build 180801))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 58fcaac6cd..c69186b997 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.725-180731 +Version: 7.0NG.725-180801 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 232c6810b3..b592028cb5 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.725-180731" +pandora_version="7.0NG.725-180801" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a753d950b9..22d931b8b0 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 = 'PC180731'; +$build_version = 'PC180801'; $pandora_version = 'v7.0NG.725'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 9e1b8e9dd6..aa7dcc11fa 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index e156701e4e..53ccdb3653 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180731 +%define release 180801 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 8759d9f67e..411ccc7d3f 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180731 +%define release 180801 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 287853b4ef..b735a55b59 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180731" +PI_BUILD="180801" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 8fe4098776..ca2570a5dd 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.725 PS180731"; +my $version = "7.0NG.725 PS180801"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index b6037248a5..5fd5213456 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.725 PS180731"; +my $version = "7.0NG.725 PS180801"; # save program name for logging my $progname = basename($0); From cb77a299bbc0918b84778bc70322b80c1d505111 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 1 Aug 2018 09:58:48 +0200 Subject: [PATCH 39/84] add templates console visual --- pandora_console/extras/mr/19.sql | 55 ++++++++++++++ .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 55 +++++++++++++- .../godmode/reporting/map_builder.php | 31 +++++++- .../reporting/visual_console_favorite.php | 26 ++++++- .../reporting/visual_console_template.php | 73 +++++++++++++++++++ .../visual_console_template_wizard.php | 71 ++++++++++++++++++ pandora_console/pandoradb.sql | 50 +++++++++++++ pandora_console/pandoradb_data.sql | 4 +- 8 files changed, 355 insertions(+), 10 deletions(-) create mode 100644 pandora_console/extras/mr/19.sql create mode 100644 pandora_console/godmode/reporting/visual_console_template.php create mode 100644 pandora_console/godmode/reporting/visual_console_template_wizard.php diff --git a/pandora_console/extras/mr/19.sql b/pandora_console/extras/mr/19.sql new file mode 100644 index 0000000000..1678c6ec6d --- /dev/null +++ b/pandora_console/extras/mr/19.sql @@ -0,0 +1,55 @@ +START TRANSACTION; + +-- --------------------------------------------------------------------- +-- Table `tlayout` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tlayout_template` ( + `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `id_group` INTEGER UNSIGNED NOT NULL, + `background` varchar(200) NOT NULL, + `height` INTEGER UNSIGNED NOT NULL default 0, + `width` INTEGER UNSIGNED NOT NULL default 0, + `background_color` varchar(50) NOT NULL default '#FFF', + `is_favourite` INTEGER UNSIGNED NOT NULL default 0, + PRIMARY KEY(`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tlayout_data` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( + `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `id_layout_template` INTEGER UNSIGNED NOT NULL default 0, + `pos_x` INTEGER UNSIGNED NOT NULL default 0, + `pos_y` INTEGER UNSIGNED NOT NULL default 0, + `height` INTEGER UNSIGNED NOT NULL default 0, + `width` INTEGER UNSIGNED NOT NULL default 0, + `label` TEXT, + `image` varchar(200) DEFAULT "", + `type` tinyint(1) UNSIGNED NOT NULL default 0, + `period` INTEGER UNSIGNED NOT NULL default 3600, + `module_name` mediumint(8) unsigned NOT NULL default '0', + `agent_name` int(10) unsigned NOT NULL default 0, + `id_layout_linked` INTEGER unsigned NOT NULL default '0', + `parent_item` INTEGER UNSIGNED NOT NULL default 0, + `enable_link` tinyint(1) UNSIGNED NOT NULL default 1, + `id_metaconsole` int(10) NOT NULL default 0, + `id_group` INTEGER UNSIGNED NOT NULL default 0, + `id_custom_graph` INTEGER UNSIGNED NOT NULL default 0, + `border_width` INTEGER UNSIGNED NOT NULL default 0, + `type_graph` varchar(50) NOT NULL default 'area', + `label_position` varchar(50) NOT NULL default 'down', + `border_color` varchar(200) DEFAULT "", + `fill_color` varchar(200) DEFAULT "", + `show_statistics` tinyint(2) NOT NULL default '0', + `id_layout_linked_weight` int(10) NOT NULL default '0', + `element_group` int(10) NOT NULL default '0', + `show_on_top` tinyint(1) NOT NULL default '0', + `clock_animation` varchar(60) NOT NULL default "analogic_1", + `time_format` varchar(60) NOT NULL default "time", + `timezone` varchar(60) NOT NULL default "Europe/Madrid", + PRIMARY KEY(`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; + +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 4516010753..8bbde497b6 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 @@ -1175,13 +1175,13 @@ 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', 18); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 19); 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'); UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; -INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '724'); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '726'); -- --------------------------------------------------------------------- -- Table `tconfig_os` @@ -1712,4 +1712,55 @@ CREATE TABLE IF NOT EXISTS `tautoconfig_actions` ( CONSTRAINT `tautoconfig_action_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- --------------------------------------------------------------------- +-- Table `tlayout` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tlayout_template` ( + `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `id_group` INTEGER UNSIGNED NOT NULL, + `background` varchar(200) NOT NULL, + `height` INTEGER UNSIGNED NOT NULL default 0, + `width` INTEGER UNSIGNED NOT NULL default 0, + `background_color` varchar(50) NOT NULL default '#FFF', + `is_favourite` INTEGER UNSIGNED NOT NULL default 0, + PRIMARY KEY(`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; + +-- --------------------------------------------------------------------- +-- Table `tlayout_data` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( + `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `id_layout_template` INTEGER UNSIGNED NOT NULL default 0, + `pos_x` INTEGER UNSIGNED NOT NULL default 0, + `pos_y` INTEGER UNSIGNED NOT NULL default 0, + `height` INTEGER UNSIGNED NOT NULL default 0, + `width` INTEGER UNSIGNED NOT NULL default 0, + `label` TEXT, + `image` varchar(200) DEFAULT "", + `type` tinyint(1) UNSIGNED NOT NULL default 0, + `period` INTEGER UNSIGNED NOT NULL default 3600, + `module_name` mediumint(8) unsigned NOT NULL default '0', + `agent_name` int(10) unsigned NOT NULL default 0, + `id_layout_linked` INTEGER unsigned NOT NULL default '0', + `parent_item` INTEGER UNSIGNED NOT NULL default 0, + `enable_link` tinyint(1) UNSIGNED NOT NULL default 1, + `id_metaconsole` int(10) NOT NULL default 0, + `id_group` INTEGER UNSIGNED NOT NULL default 0, + `id_custom_graph` INTEGER UNSIGNED NOT NULL default 0, + `border_width` INTEGER UNSIGNED NOT NULL default 0, + `type_graph` varchar(50) NOT NULL default 'area', + `label_position` varchar(50) NOT NULL default 'down', + `border_color` varchar(200) DEFAULT "", + `fill_color` varchar(200) DEFAULT "", + `show_statistics` tinyint(2) NOT NULL default '0', + `id_layout_linked_weight` int(10) NOT NULL default '0', + `element_group` int(10) NOT NULL default '0', + `show_on_top` tinyint(1) NOT NULL default '0', + `clock_animation` varchar(60) NOT NULL default "analogic_1", + `time_format` varchar(60) NOT NULL default "time", + `timezone` varchar(60) NOT NULL default "Europe/Madrid", + PRIMARY KEY(`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index b21ec23f3d..9574354e2d 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -34,14 +34,39 @@ $hack_metaconsole = ''; if (defined('METACONSOLE')) $hack_metaconsole = '../../'; -$buttons['visual_console_favorite'] = array('active' => false, +$buttons['visual_console'] = array( + 'active' => true, + 'text' => '' . + html_print_image ("images/visual_console.png", true, array ("title" => __('Visual Console List'))) .'' +); + +$buttons['visual_console_favorite'] = array( + 'active' => false, 'text' => '' . - html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .''); + html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .'' +); + +$buttons['visual_console_template'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' +); + +$buttons['visual_console_template_wizard'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' +); if (!defined('METACONSOLE')) { ui_print_page_header( __('Reporting') .' » ' . __('Visual Console'), - "images/op_reporting.png", false, "map_builder", false, $buttons); + "images/op_reporting.png", + false, + "map_builder", + false, + $buttons + ); } $id_layout = (int) get_parameter ('id_layout'); diff --git a/pandora_console/godmode/reporting/visual_console_favorite.php b/pandora_console/godmode/reporting/visual_console_favorite.php index d8f58da452..b753125375 100644 --- a/pandora_console/godmode/reporting/visual_console_favorite.php +++ b/pandora_console/godmode/reporting/visual_console_favorite.php @@ -28,9 +28,29 @@ if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { exit; } -$buttons['map_builder'] = array('active' => false, - 'text' => '' . - html_print_image ("images/visual_console.png", true, array ("title" => __('Visual Console'))) .''); +$buttons['visual_console'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/visual_console.png", true, array ("title" => __('Visual Console List'))) .'' +); + +$buttons['visual_console_favorite'] = array( + 'active' => true, + 'text' => '' . + html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .'' +); + +$buttons['visual_console_template'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' +); + +$buttons['visual_console_template_wizard'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' +); if (!defined('METACONSOLE')) { ui_print_page_header( diff --git a/pandora_console/godmode/reporting/visual_console_template.php b/pandora_console/godmode/reporting/visual_console_template.php new file mode 100644 index 0000000000..2a0c5952c7 --- /dev/null +++ b/pandora_console/godmode/reporting/visual_console_template.php @@ -0,0 +1,73 @@ + false, + 'text' => '' . + html_print_image ("images/visual_console.png", true, array ("title" => __('Visual Console List'))) .'' +); + +$buttons['visual_console_favorite'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .'' +); + +$buttons['visual_console_template'] = array( + 'active' => true, + 'text' => '' . + html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' +); + +$buttons['visual_console_template_wizard'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' +); + +if (!defined('METACONSOLE')) { + ui_print_page_header( + __('Reporting') .' » ' . __('Visual Console'), + "images/op_reporting.png", + false, + "map_builder", + false, + $buttons + ); +} + + +?> \ No newline at end of file diff --git a/pandora_console/godmode/reporting/visual_console_template_wizard.php b/pandora_console/godmode/reporting/visual_console_template_wizard.php new file mode 100644 index 0000000000..bcedbabd0b --- /dev/null +++ b/pandora_console/godmode/reporting/visual_console_template_wizard.php @@ -0,0 +1,71 @@ + false, + 'text' => '' . + html_print_image ("images/visual_console.png", true, array ("title" => __('Visual Console List'))) .'' +); + +$buttons['visual_console_favorite'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .'' +); + +$buttons['visual_console_template'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' +); + +$buttons['visual_console_template_wizard'] = array( + 'active' => true, + 'text' => '' . + html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' +); + +if (!defined('METACONSOLE')) { + ui_print_page_header( + __('Reporting') .' » ' . __('Visual Console'), + "images/op_reporting.png", + false, + "map_builder", + false, + $buttons + ); +} +?> \ No newline at end of file diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 7817f642fb..eceafc2f2b 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3246,4 +3246,54 @@ CREATE TABLE IF NOT EXISTS `tautoconfig_actions` ( CONSTRAINT `tautoconfig_action_ibfk_1` FOREIGN KEY (`id_autoconfig`) REFERENCES `tautoconfig` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- --------------------------------------------------------------------- +-- Table `tlayout` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tlayout_template` ( + `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `id_group` INTEGER UNSIGNED NOT NULL, + `background` varchar(200) NOT NULL, + `height` INTEGER UNSIGNED NOT NULL default 0, + `width` INTEGER UNSIGNED NOT NULL default 0, + `background_color` varchar(50) NOT NULL default '#FFF', + `is_favourite` INTEGER UNSIGNED NOT NULL default 0, + PRIMARY KEY(`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; +-- --------------------------------------------------------------------- +-- Table `tlayout_data` +-- --------------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( + `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, + `id_layout_template` INTEGER UNSIGNED NOT NULL default 0, + `pos_x` INTEGER UNSIGNED NOT NULL default 0, + `pos_y` INTEGER UNSIGNED NOT NULL default 0, + `height` INTEGER UNSIGNED NOT NULL default 0, + `width` INTEGER UNSIGNED NOT NULL default 0, + `label` TEXT, + `image` varchar(200) DEFAULT "", + `type` tinyint(1) UNSIGNED NOT NULL default 0, + `period` INTEGER UNSIGNED NOT NULL default 3600, + `module_name` mediumint(8) unsigned NOT NULL default '0', + `agent_name` int(10) unsigned NOT NULL default 0, + `id_layout_linked` INTEGER unsigned NOT NULL default '0', + `parent_item` INTEGER UNSIGNED NOT NULL default 0, + `enable_link` tinyint(1) UNSIGNED NOT NULL default 1, + `id_metaconsole` int(10) NOT NULL default 0, + `id_group` INTEGER UNSIGNED NOT NULL default 0, + `id_custom_graph` INTEGER UNSIGNED NOT NULL default 0, + `border_width` INTEGER UNSIGNED NOT NULL default 0, + `type_graph` varchar(50) NOT NULL default 'area', + `label_position` varchar(50) NOT NULL default 'down', + `border_color` varchar(200) DEFAULT "", + `fill_color` varchar(200) DEFAULT "", + `show_statistics` tinyint(2) NOT NULL default '0', + `id_layout_linked_weight` int(10) NOT NULL default '0', + `element_group` int(10) NOT NULL default '0', + `show_on_top` tinyint(1) NOT NULL default '0', + `clock_animation` varchar(60) NOT NULL default "analogic_1", + `time_format` varchar(60) NOT NULL default "time", + `timezone` varchar(60) NOT NULL default "Europe/Madrid", + PRIMARY KEY(`id`) +) ENGINE = InnoDB DEFAULT CHARSET=utf8; diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 63052f7458..58f35ab553 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -109,10 +109,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_report_front_logo', 'images/pandora_logo_white.jpg'), ('custom_report_front_header', ''), ('custom_report_front_footer', ''), -('MR', 18), +('MR', 19), ('identification_reminder', 1), ('identification_reminder_timestamp', 0), -('current_package_enterprise', '725'), +('current_package_enterprise', '726'), ('post_process_custom_values', '{"0.00000038580247":"Seconds to months","0.00000165343915":"Seconds to weeks","0.00001157407407":"Seconds to days","0.01666666666667":"Seconds to minutes","0.00000000093132":"Bytes to Gigabytes","0.00000095367432":"Bytes to Megabytes","0.0009765625":"Bytes to Kilobytes","0.00000001653439":"Timeticks to weeks","0.00000011574074":"Timeticks to days"}'), ('custom_docs_logo', 'default_docs.png'), ('custom_support_logo', 'default_support.png'), From 333e5c874c4411ce80cbc1fb709715796f670efa Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 1 Aug 2018 11:52:20 +0200 Subject: [PATCH 40/84] create template visual console --- .../reporting/visual_console_template.php | 64 ++++++++- .../visual_console_template_wizard.php | 134 ++++++++++++++++++ 2 files changed, 196 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_template.php b/pandora_console/godmode/reporting/visual_console_template.php index 2a0c5952c7..074a8648b7 100644 --- a/pandora_console/godmode/reporting/visual_console_template.php +++ b/pandora_console/godmode/reporting/visual_console_template.php @@ -18,8 +18,8 @@ global $config; require_once ($config['homedir'] . '/include/functions_visual_map.php'); // ACL for the general permission -$vconsoles_read = check_acl ($config['id_user'], 0, "VR"); -$vconsoles_write = check_acl ($config['id_user'], 0, "VW"); +$vconsoles_read = check_acl ($config['id_user'], 0, "VR"); +$vconsoles_write = check_acl ($config['id_user'], 0, "VW"); $vconsoles_manage = check_acl ($config['id_user'], 0, "VM"); if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { @@ -69,5 +69,65 @@ if (!defined('METACONSOLE')) { ); } +$id_layout = (int) get_parameter ('id_layout', 0); +$name_template = (string) get_parameter ('name_template', ''); +$group = (int) get_parameter ('group'); +$action = (string) get_parameter ('action', ''); + +if($action == "create_template"){ + +} + +if($action == "delete_template"){ + +} + +$visual_console_array = visual_map_get_user_layouts($config['id_user'], true); + +if (!check_acl ($config['id_user'], 0, "VR")){ + $return_all_group = false; +} +else{ + $return_all_group = true; +} + +$table = '
'; +$table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; +$table .= "
"; + $table .= "" . __("Create From") . ":"; + $table .= ""; + $table .= html_print_select($visual_console_array, 'id_layout', $id_layout, '', __('none'), 0, true); + $table .= "
"; + $table .= "" . __("Name") . ":"; + $table .= ""; + $table .= html_print_input_text ('name_template', $name_template, '', 50, 255, true); + $table .= "
"; + $table .= '' . __("Group") . ':'; + $table .= ""; + $table .= html_print_select_groups(false, "AR", $return_all_group, "group", $group, 'this.form.submit();', '', 0, true, false, true, '', false); + $table .= "
"; + +if (check_acl ($config['id_user'], 0, "RW")) { + $table .= '
'; + $table .= html_print_input_hidden('action', 'create_template'); + $table .= html_print_submit_button (__('Create template'), 'apply', false, 'class="sub next"', true); + $table .= '
'; +} +$table .= '
'; + +echo ui_toggle($table, __('Create New Template'), '', false, true); + ?> \ No newline at end of file diff --git a/pandora_console/godmode/reporting/visual_console_template_wizard.php b/pandora_console/godmode/reporting/visual_console_template_wizard.php index bcedbabd0b..76ac71b03d 100644 --- a/pandora_console/godmode/reporting/visual_console_template_wizard.php +++ b/pandora_console/godmode/reporting/visual_console_template_wizard.php @@ -68,4 +68,138 @@ if (!defined('METACONSOLE')) { $buttons ); } + + +$templates = reporting_enterprise_get_template_reports(array ('order' => 'id_group, name'), array('id_report', 'name'), true); + +$template_select = array(); +if ($templates === false) + $template_select = array(); +else { + $groups = array(__('All') => 0); + foreach ($templates as $template) { + $id_group = $template['id_group']; + $group_name = ''; + + if (!isset($groups[$id_group])) + $groups[$id_group] = groups_get_name($id_group, true); + + if (!empty($groups[$id_group])) + $group_name = $groups[$id_group]; + + $template_select[$template['id_report']] = array('optgroup' => $group_name, 'name' => $template['name']); + } +} + +if (is_metaconsole()) { + $keys_field = 'nombre'; +} +else { + $keys_field = 'id_grupo'; +} + +$attr_available = array('id' => 'image-select_all_available', 'title' => __('Select all'), 'style' => 'cursor: pointer;'); +$attr_apply = array('id' => 'image-select_all_apply', 'title' => __('Select all'), 'style' => 'cursor: pointer;'); + +$table = '
'; +$table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; + $table .= ""; +$table .= "
"; + $table .= "" . __('Templates') . ":"; + $table .= ""; + $table .= html_print_select($template_select, 'templates', $template_selected, '', __('None'), '0', true, false, true, '', false, 'width:180px;'); + $table .= ""; + $table .= "" . __('Report name') . " " . + ui_print_help_tip(__('Left in blank if you want to use default name: Template name - agents (num agents) - Date'), true) . ":"; + $table .= ""; + $table .= html_print_input_text ('template_report_name', '', '', 80, 150, true); + $table .= "
"; + $table .= '' . __('Filter group') . ':'; + $table .= ""; + $table .= html_print_select_groups( + false, "RR", users_can_manage_group_all("RR"), + 'group', '', '', '', 0, true, false, false, + '', false, false, false, false, $keys_field + ); + $table .= ""; + $table .= "" . __('Target group') . ":"; + $table .= ""; + $table .= html_print_select_groups( + false, "RR", users_can_manage_group_all("RR"), + 'template_report_group', '', '', '', 0, true, + false, false, '', false, false, false, false, + $keys_field + ); + $table .= "
"; + $table .= '' . __('Filter agent') . ':'; + $table .= ""; + $table .= html_print_input_text ('agent_filter', $agent_filter, '', 20, 150, true); + $table .= ""; + $table .= ''; + $table .= ""; + $table .= ''; + $table .= "
"; + $table .= "" . __('Agents available')."  " . + html_print_image ('images/tick.png', true, $attr_available, false, true); + $table .= ""; + $table .= "" . __('Agents to apply')."  " . + html_print_image ('images/tick.png', true, $attr_apply, false, true); + $table .= "
"; + $option_style = array(); + $template_agents_in = array(); + $template_agents_all = array(); + $template_agents_out = array(); + $template_agents_out = array_diff_key($template_agents_all, $template_agents_in); + $template_agents_in_keys = array_keys($template_agents_in); + $template_agents_out_keys = array_keys($template_agents_out); + + $table .= html_print_select ($template_agents_out, 'id_agents[]', 0, false, '', '', true, true, true, '', false, 'width: 100%;', $option_style); + $table .= ""; + $table .= html_print_image ('images/darrowright.png', true, array ('id' => 'right', 'title' => __('Add agents to template'))); + $table .= html_print_image ('images/darrowleft.png', true, array ('id' => 'left', 'title' => __('Undo agents to template'))); + $table .= ""; + $table .= $option_style = array(); + //Agents applied to the template + $table .= html_print_select ($template_agents_in, 'id_agents2[]', 0, false, '', '', true, true, true, '', false, 'width: 100%;', $option_style); + $table .= "
"; + +if (check_acl ($config['id_user'], 0, "RW")) { + $table .= '
'; + $table .= html_print_input_hidden('action', 'create_template'); + $table .= html_print_submit_button (__('Apply template'), 'apply', false, 'class="sub next"', true); + $table .= '
'; +} +$table .= '
'; + +echo $table; + ?> \ No newline at end of file From f10058428f9b4274a54846dc94139d55db5096ec Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 1 Aug 2018 12:22:13 +0200 Subject: [PATCH 41/84] Added backend functions to create vconsole template --- pandora_console/extras/mr/19.sql | 13 +-- .../pandoradb_migrate_6.0_to_7.0.mysql.sql | 14 +-- .../include/functions_visual_map.php | 88 +++++++++++++++++++ pandora_console/pandoradb.sql | 13 +-- 4 files changed, 109 insertions(+), 19 deletions(-) diff --git a/pandora_console/extras/mr/19.sql b/pandora_console/extras/mr/19.sql index 1678c6ec6d..97275c0961 100644 --- a/pandora_console/extras/mr/19.sql +++ b/pandora_console/extras/mr/19.sql @@ -1,7 +1,7 @@ START TRANSACTION; -- --------------------------------------------------------------------- --- Table `tlayout` +-- Table `tlayout_template` -- --------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tlayout_template` ( `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, @@ -16,11 +16,11 @@ CREATE TABLE IF NOT EXISTS `tlayout_template` ( ) ENGINE = InnoDB DEFAULT CHARSET=utf8; -- --------------------------------------------------------------------- --- Table `tlayout_data` +-- Table `tlayout_template_data` -- --------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, - `id_layout_template` INTEGER UNSIGNED NOT NULL default 0, + `id_layout_template` INTEGER UNSIGNED NOT NULL, `pos_x` INTEGER UNSIGNED NOT NULL default 0, `pos_y` INTEGER UNSIGNED NOT NULL default 0, `height` INTEGER UNSIGNED NOT NULL default 0, @@ -29,8 +29,8 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( `image` varchar(200) DEFAULT "", `type` tinyint(1) UNSIGNED NOT NULL default 0, `period` INTEGER UNSIGNED NOT NULL default 3600, - `module_name` mediumint(8) unsigned NOT NULL default '0', - `agent_name` int(10) unsigned NOT NULL default 0, + `module_name` text NOT NULL, + `agent_name` varchar(600) BINARY NOT NULL default '', `id_layout_linked` INTEGER unsigned NOT NULL default '0', `parent_item` INTEGER UNSIGNED NOT NULL default 0, `enable_link` tinyint(1) UNSIGNED NOT NULL default 1, @@ -49,7 +49,8 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( `clock_animation` varchar(60) NOT NULL default "analogic_1", `time_format` varchar(60) NOT NULL default "time", `timezone` varchar(60) NOT NULL default "Europe/Madrid", - PRIMARY KEY(`id`) + PRIMARY KEY(`id`), + FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE = InnoDB DEFAULT CHARSET=utf8; 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 8bbde497b6..ecb53717a3 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 @@ -1713,7 +1713,7 @@ CREATE TABLE IF NOT EXISTS `tautoconfig_actions` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- --------------------------------------------------------------------- --- Table `tlayout` +-- Table `tlayout_template` -- --------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tlayout_template` ( `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, @@ -1728,11 +1728,11 @@ CREATE TABLE IF NOT EXISTS `tlayout_template` ( ) ENGINE = InnoDB DEFAULT CHARSET=utf8; -- --------------------------------------------------------------------- --- Table `tlayout_data` +-- Table `tlayout_template_data` -- --------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, - `id_layout_template` INTEGER UNSIGNED NOT NULL default 0, + `id_layout_template` INTEGER UNSIGNED NOT NULL, `pos_x` INTEGER UNSIGNED NOT NULL default 0, `pos_y` INTEGER UNSIGNED NOT NULL default 0, `height` INTEGER UNSIGNED NOT NULL default 0, @@ -1741,8 +1741,8 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( `image` varchar(200) DEFAULT "", `type` tinyint(1) UNSIGNED NOT NULL default 0, `period` INTEGER UNSIGNED NOT NULL default 3600, - `module_name` mediumint(8) unsigned NOT NULL default '0', - `agent_name` int(10) unsigned NOT NULL default 0, + `module_name` text NOT NULL, + `agent_name` varchar(600) BINARY NOT NULL default '', `id_layout_linked` INTEGER unsigned NOT NULL default '0', `parent_item` INTEGER UNSIGNED NOT NULL default 0, `enable_link` tinyint(1) UNSIGNED NOT NULL default 1, @@ -1761,6 +1761,6 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( `clock_animation` varchar(60) NOT NULL default "analogic_1", `time_format` varchar(60) NOT NULL default "time", `timezone` varchar(60) NOT NULL default "Europe/Madrid", - PRIMARY KEY(`id`) + PRIMARY KEY(`id`), + FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE = InnoDB DEFAULT CHARSET=utf8; - diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 9773bd831d..92bb93a735 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -4064,6 +4064,94 @@ function visual_map_macro($label,$module){ $label = str_replace('_address_',agents_get_address(modules_get_agentmodule_agent($module)),$label); $label = str_replace('_moduledescription_',modules_get_agentmodule_descripcion($module),$label); return $label; +} + +/** + * Visual console templates + */ + +function visual_map_template_get_template_definition($id_layout_template) { + global $config; + + return db_get_row ('tlayout_template', 'id_layout_template', $id_layout_template); +} + + +function visual_map_template_get_template_elements($id_layout_template) { + global $config; + + return db_get_all_rows_filter('tlayout_template_data', array('id_layout_template' => $id_layout_template)); +} + +function visual_map_get_definition($id_layout) { + global $config; + + return db_get_row ('tlayout', 'id', $id_layout); +} + + +function visual_map_get_elements($id_layout) { + global $config; + + return db_get_all_rows_filter('tlayout_data', array('id_layout' => $id_layout)); +} + +/** + * Creates a new template from existing visual console + * @param int $id_layout existing visual console + * @return true OK, false not OK + */ +function visual_map_create_template($id_layout, $name) { + global $config; + + $layout = visual_map_get_definition($id_layout); + $layout_data = visual_map_get_elements($id_layout); + + // Create new template based on received information + $template_skel = $layout; + + // rm id + unset($template_skel["id"]); + + $template_id = db_process_sql_insert('tlayout_template', $template_skel); + + foreach ($layout_data as $item) { + $data_template_skel = $item; + + // remove unwanted fields + unset($data_template_skel["id"]); + unset($data_template_skel["id_layout"]); + + // Update fields + $data_template_skel["id_layout_template"] = $template_id; + $data_template_skel["module_name"] = modules_get_agentmodule_name($item["id_agente_modulo"]); + $data_template_skel["agent_name"] = agents_get_name($item["id_agent"]); + + // remove unwanted fields + unset($data_template_skel["id_agente_modulo"]); + unset($data_template_skel["id_agent"]); + + $data_template_id = db_process_sql_insert('tlayout_template_data', $data_template_skel); + + } + + + return $template_id; +} + + +/** + * Creates a new visual console based on target id_layout_template + * @param int $id_layout_template target template + * @param string $name name for new visual console + * @param int $id_agent target id_agent to customize template + * @return id_layout OK, null not OK + */ +function visual_map_instanciate_template($id_layout_template, $name, $id_agent) { + + + + } ?> \ No newline at end of file diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index eceafc2f2b..be2783255c 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -3247,7 +3247,7 @@ CREATE TABLE IF NOT EXISTS `tautoconfig_actions` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- --------------------------------------------------------------------- --- Table `tlayout` +-- Table `tlayout_template` -- --------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tlayout_template` ( `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, @@ -3262,11 +3262,11 @@ CREATE TABLE IF NOT EXISTS `tlayout_template` ( ) ENGINE = InnoDB DEFAULT CHARSET=utf8; -- --------------------------------------------------------------------- --- Table `tlayout_data` +-- Table `tlayout_template_data` -- --------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, - `id_layout_template` INTEGER UNSIGNED NOT NULL default 0, + `id_layout_template` INTEGER UNSIGNED NOT NULL, `pos_x` INTEGER UNSIGNED NOT NULL default 0, `pos_y` INTEGER UNSIGNED NOT NULL default 0, `height` INTEGER UNSIGNED NOT NULL default 0, @@ -3275,8 +3275,8 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( `image` varchar(200) DEFAULT "", `type` tinyint(1) UNSIGNED NOT NULL default 0, `period` INTEGER UNSIGNED NOT NULL default 3600, - `module_name` mediumint(8) unsigned NOT NULL default '0', - `agent_name` int(10) unsigned NOT NULL default 0, + `module_name` text NOT NULL, + `agent_name` varchar(600) BINARY NOT NULL default '', `id_layout_linked` INTEGER unsigned NOT NULL default '0', `parent_item` INTEGER UNSIGNED NOT NULL default 0, `enable_link` tinyint(1) UNSIGNED NOT NULL default 1, @@ -3295,5 +3295,6 @@ CREATE TABLE IF NOT EXISTS `tlayout_template_data` ( `clock_animation` varchar(60) NOT NULL default "analogic_1", `time_format` varchar(60) NOT NULL default "time", `timezone` varchar(60) NOT NULL default "Europe/Madrid", - PRIMARY KEY(`id`) + PRIMARY KEY(`id`), + FOREIGN KEY (`id_layout_template`) REFERENCES tlayout_template(`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE = InnoDB DEFAULT CHARSET=utf8; From 92911e8fb8473119729842e04f2d61ca46889b7e Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 1 Aug 2018 12:24:27 +0200 Subject: [PATCH 42/84] fixed js wizard template visual console --- .../visual_console_template_wizard.php | 447 +++++++++++++++++- 1 file changed, 446 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/visual_console_template_wizard.php b/pandora_console/godmode/reporting/visual_console_template_wizard.php index 76ac71b03d..2144ac6406 100644 --- a/pandora_console/godmode/reporting/visual_console_template_wizard.php +++ b/pandora_console/godmode/reporting/visual_console_template_wizard.php @@ -192,6 +192,12 @@ $table .= " \ No newline at end of file +?> + \ No newline at end of file From dd0d9e4fa50acb7d2aa88364c21f89134f2c29ef Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 1 Aug 2018 12:28:17 +0200 Subject: [PATCH 43/84] Fixed vconsole template name & group_id --- pandora_console/include/functions_visual_map.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 92bb93a735..8e692e1574 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -4101,7 +4101,7 @@ function visual_map_get_elements($id_layout) { * @param int $id_layout existing visual console * @return true OK, false not OK */ -function visual_map_create_template($id_layout, $name) { +function visual_map_create_template($id_layout, $name, $id_group) { global $config; $layout = visual_map_get_definition($id_layout); @@ -4113,6 +4113,13 @@ function visual_map_create_template($id_layout, $name) { // rm id unset($template_skel["id"]); + // Update fields + if (!empty($name)) { + $template_skel["name"] = $name; + } + + $template_skel["id_group"] = $id_group; + $template_id = db_process_sql_insert('tlayout_template', $template_skel); foreach ($layout_data as $item) { From e2e07f2724723c608382ba6f5bb5cb455399aa6a Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 1 Aug 2018 12:54:08 +0200 Subject: [PATCH 44/84] Added visual_map_get_user_layout_templates --- .../include/functions_visual_map.php | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 8e692e1574..acb1fae4a0 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -4161,4 +4161,104 @@ function visual_map_instanciate_template($id_layout_template, $name, $id_agent) } + +/** + * Get a list of layout templates for given user. + * + * @param int User id. + * @param bool Wheter to return all the fields or only the name (to use in + * html_print_select() directly) + * @param array Additional filters to filter the layouts. + * @param bool Whether to return All group or not. + * + * @return array A list of layouts the user can see. + */ +function visual_map_get_user_layout_templates ($id_user = 0, $only_names = false, $filter = false, + $returnAllGroup = true, $favourite = false) { + + if (! is_array ($filter)){ + $filter = array (); + } else { + if(!empty($filter['name'])){ + $where .= "name LIKE '%".io_safe_output($filter['name'])."%'"; + unset($filter['name']); + } + } + + if($favourite){ + if (empty($where)){ + $where = ""; + } + + if ($where != '') { + $where .= ' AND '; + } + + $where .= "is_favourite = 1"; + } + + if ($returnAllGroup) { + $groups = users_get_groups ($id_user, 'VR', true, true); + } else { + + if(!empty($filter['group'])) { + $permissions_group = users_get_groups ($id_user, 'VR', false, true); + if(empty($permissions_group)){ + $permissions_group = users_get_groups ($id_user, 'VM', false, true); + } + $groups = array_intersect_key($filter['group'], $permissions_group); + } else { + $groups = users_get_groups ($id_user, 'VR', true, true); + if(empty($groups)) { + $groups = users_get_groups ($id_user, 'VM', true, true); + } + } + + + unset($filter['group']); + } + + if (!empty($groups)) { + if (empty($where)) + $where = ""; + + if ($where != '') { + $where .= ' AND '; + } + $where .= sprintf ('id_group IN (%s)', implode (",", array_keys ($groups))); + } + + $where .= db_format_array_where_clause_sql ($filter); + + if ($where == '') { + $where = array(); + } + + $layouts = db_get_all_rows_filter ('tlayout_template', $where); + if ($layouts == false) + return array (); + + $retval = array (); + foreach ($layouts as $layout) { + if ($only_names) + $retval[$layout['id']] = $layout['name']; + else + $retval[$layout['id']] = $layout; + + //add_perms + if ($groups[$layout['id_group']]['vconsole_view']){ + $retval[$layout['id']]['vr'] = $groups[$layout['id_group']]['vconsole_view']; + } + if ($groups[$layout['id_group']]['vconsole_edit']){ + $retval[$layout['id']]['vw'] = $groups[$layout['id_group']]['vconsole_edit']; + } + if ($groups[$layout['id_group']]['vconsole_management']){ + $retval[$layout['id']]['vm'] = $groups[$layout['id_group']]['vconsole_management']; + } + } + + return $retval; +} + + ?> \ No newline at end of file From 8e52d9e18411ddc8bc0f9f1c375304027d200aa1 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 1 Aug 2018 13:05:27 +0200 Subject: [PATCH 45/84] added visual_map_instanciate_template --- .../include/functions_visual_map.php | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index acb1fae4a0..d1050fb16c 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -4146,7 +4146,6 @@ function visual_map_create_template($id_layout, $name, $id_group) { return $template_id; } - /** * Creates a new visual console based on target id_layout_template * @param int $id_layout_template target template @@ -4155,13 +4154,48 @@ function visual_map_create_template($id_layout, $name, $id_group) { * @return id_layout OK, null not OK */ function visual_map_instanciate_template($id_layout_template, $name, $id_agent) { + global $config; + + $layout_id = false; + if ($id_agent) { + // retrieve template data + $template = visual_map_template_get_template_definition($id_layout_template); + $template_data = visual_map_template_get_template_elements($id_layout_template); + if ($template === false) { + return false; + } + + $template["name"] = $name; + + unset($template["id"]); + + // insert template schema + $layout_id = db_process_sql_insert('tlayout', $template); + + foreach ($template_data as $item) { + + // update fields + $item["id_agente_modulo"] = modules_get_agentmodule_id($agent_id, $item["module_name"]); + $item["id_agent"] = $agent_id; + $item["id_layout"] = $layout_id; + + // remove useless fields + unset($item["id"]); + unset($item["id_layout_template"]); + unset($item["agent_name"]); + unset($item["module_name"]); + + $data_template_id = db_process_sql_insert('tlayout_data', $item); + } + } + + return $id_layout; } - /** * Get a list of layout templates for given user. * From 49aeb349eb31618a65f9128d2fef41a90ae2bc0b Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 1 Aug 2018 13:10:10 +0200 Subject: [PATCH 46/84] create form templates visual console --- .../reporting/visual_console_template.php | 54 +++++++++++++++++-- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_template.php b/pandora_console/godmode/reporting/visual_console_template.php index 074a8648b7..38e18f7d42 100644 --- a/pandora_console/godmode/reporting/visual_console_template.php +++ b/pandora_console/godmode/reporting/visual_console_template.php @@ -71,15 +71,28 @@ if (!defined('METACONSOLE')) { $id_layout = (int) get_parameter ('id_layout', 0); $name_template = (string) get_parameter ('name_template', ''); -$group = (int) get_parameter ('group'); +$group = (int) get_parameter ('group', 0); $action = (string) get_parameter ('action', ''); if($action == "create_template"){ + if(!$id_layout){ + ui_print_error_message(__('visual console has not been selected')); + } + $result = visual_map_create_template($id_layout, $name_template, $group); + + if(!$result){ + ui_print_error_message(__('Error. Error created template')); + } + else{ + ui_print_success_message(__('Successfully created template')); + } } if($action == "delete_template"){ - + if(!$id_layout){ + ui_print_error_message(__('visual console has not been selected')); + } } $visual_console_array = visual_map_get_user_layouts($config['id_user'], true); @@ -121,7 +134,7 @@ $table .= "
"; if (check_acl ($config['id_user'], 0, "RW")) { $table .= '
'; - $table .= html_print_input_hidden('action', 'create_template'); + $table .= html_print_input_hidden('action', 'create_template', true); $table .= html_print_submit_button (__('Create template'), 'apply', false, 'class="sub next"', true); $table .= '
'; } @@ -129,5 +142,40 @@ $table .= ''; echo ui_toggle($table, __('Create New Template'), '', false, true); +$array_template_visual_console = visual_map_get_user_layout_templates($config['id_user']); + +if($array_template_visual_console && is_array($array_template_visual_console)){ + $table = new stdClass(); + $table->width = '100%'; + $table->class = 'databox data'; + $table->data = array (); + $table->head = array (); + $table->head[0] = __('Name'); + $table->head[1] = __('Group'); + $table->head[2] = __('Fovourite'); + $table->head[3] = __('Delete'); + $table->size[3] = "6%"; + + $table->align = array (); + $table->align[0] = 'left'; + $table->align[1] = 'left'; + $table->align[2] = 'left'; + $table->align[3] = 'left'; + + foreach ($array_template_visual_console as $key => $value) { + $data = array (); + $data[0] = $value['name']; + $data[1] = $value['id_group']; + $data[2] = $value['is_favourite']; + $data[3] = ''.html_print_image ("images/cross.png", true).''; + array_push ($table->data, $data); + } + + html_print_table ($table); +} +else{ + ui_print_info_message(__('No data to show')); +} + ?> \ No newline at end of file From 11372e5b946b4c490cf889202b51f966c9c8e4da Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 1 Aug 2018 13:12:10 +0200 Subject: [PATCH 47/84] Delete vconsole template method --- .../include/functions_visual_map.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index d1050fb16c..d319891cba 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -4196,6 +4196,23 @@ function visual_map_instanciate_template($id_layout_template, $name, $id_agent) } +/** + * Erases given id_layout_template + * @param int $id_layout_template target template to be deleted + * @return true OK, false ERR + */ +function visual_map_delete_template($id_layout_template) { + global $config; + + if (!$id_layout_template) { + return false; + } + + // tlayout_template_data is erased using foreign key + return db_process_sql_delete('tlayout_template', array('id' => $id_layout_template)); + +} + /** * Get a list of layout templates for given user. * From 04cfbe4ef9ffa9d13d0989b0b28fd7708d6e994c Mon Sep 17 00:00:00 2001 From: fermin831 Date: Wed, 1 Aug 2018 13:16:21 +0200 Subject: [PATCH 48/84] Fixed acl in module graph view --- .../agentes/interface_traffic_graph_win.php | 25 +++---------------- .../operation/agentes/realtime_win.php | 4 +++ .../operation/agentes/stat_win.php | 8 +++--- 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index 7bd9499ff9..3273dc4069 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -30,6 +30,7 @@ require_once ($config['homedir'] . '/include/functions_custom_graphs.php'); require_once ($config['homedir'] . '/include/functions_modules.php'); require_once ($config['homedir'] . '/include/functions_agents.php'); require_once ($config['homedir'] . '/include/functions_tags.php'); +enterprise_include_once('include/functions_agents.php'); check_login(); @@ -108,28 +109,8 @@ $interface_traffic_modules = array( Date: Wed, 1 Aug 2018 13:20:20 +0200 Subject: [PATCH 49/84] delete template visual console --- .../godmode/reporting/visual_console_template.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_template.php b/pandora_console/godmode/reporting/visual_console_template.php index 38e18f7d42..5a88c43c00 100644 --- a/pandora_console/godmode/reporting/visual_console_template.php +++ b/pandora_console/godmode/reporting/visual_console_template.php @@ -60,7 +60,7 @@ $buttons['visual_console_template_wizard'] = array( if (!defined('METACONSOLE')) { ui_print_page_header( - __('Reporting') .' » ' . __('Visual Console'), + __('Visual Console') .' » ' . __('Template'), "images/op_reporting.png", false, "map_builder", @@ -93,6 +93,15 @@ if($action == "delete_template"){ if(!$id_layout){ ui_print_error_message(__('visual console has not been selected')); } + + $result = visual_map_delete_template($id_layout); + + if(!$result){ + ui_print_error_message(__('Error. Error delete template')); + } + else{ + ui_print_success_message(__('Successfully delete template')); + } } $visual_console_array = visual_map_get_user_layouts($config['id_user'], true); @@ -104,7 +113,7 @@ else{ $return_all_group = true; } -$table = '
'; +$table = ''; $table .= ""; $table .= ""; $table .= "
"; From 62d2b509adac2a873ffb5880281c3b5402dab9da Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 1 Aug 2018 13:21:04 +0200 Subject: [PATCH 50/84] fixed minor error --- .../godmode/reporting/visual_console_template_wizard.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_template_wizard.php b/pandora_console/godmode/reporting/visual_console_template_wizard.php index 2144ac6406..7683c6a447 100644 --- a/pandora_console/godmode/reporting/visual_console_template_wizard.php +++ b/pandora_console/godmode/reporting/visual_console_template_wizard.php @@ -60,7 +60,7 @@ $buttons['visual_console_template_wizard'] = array( if (!defined('METACONSOLE')) { ui_print_page_header( - __('Reporting') .' » ' . __('Visual Console'), + __('Visual Console') .' » ' . __('Wizard'), "images/op_reporting.png", false, "map_builder", @@ -69,7 +69,6 @@ if (!defined('METACONSOLE')) { ); } - $templates = reporting_enterprise_get_template_reports(array ('order' => 'id_group, name'), array('id_report', 'name'), true); $template_select = array(); From 2a7e710b9eab585698e2d20f24398100a94d335c Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 1 Aug 2018 13:51:45 +0200 Subject: [PATCH 51/84] fixed errors in template wizar visual console --- .../visual_console_template_wizard.php | 45 ++++++++++++------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_template_wizard.php b/pandora_console/godmode/reporting/visual_console_template_wizard.php index 7683c6a447..8de897c6e6 100644 --- a/pandora_console/godmode/reporting/visual_console_template_wizard.php +++ b/pandora_console/godmode/reporting/visual_console_template_wizard.php @@ -69,27 +69,38 @@ if (!defined('METACONSOLE')) { ); } -$templates = reporting_enterprise_get_template_reports(array ('order' => 'id_group, name'), array('id_report', 'name'), true); +$action = get_parameter ('action', ''); -$template_select = array(); -if ($templates === false) - $template_select = array(); -else { - $groups = array(__('All') => 0); - foreach ($templates as $template) { - $id_group = $template['id_group']; - $group_name = ''; +if ($action == 'apply') { + $agents_selected = (array) get_parameter('id_agents2'); + $id_layout_template = get_parameter('templates'); + $name = get_parameter('template_report_name', ''); + $group = get_parameter('template_report_group'); - if (!isset($groups[$id_group])) - $groups[$id_group] = groups_get_name($id_group, true); + if (empty($agents_selected) || empty($id_layout_template)) + $result = false; + else { + if($agents_selected && is_array($agents_selected)){ + foreach ($agents_selected as $key => $value) { + $result = visual_map_instanciate_template( + $id_layout_template, + $name, + $value + ); + } + } + } - if (!empty($groups[$id_group])) - $group_name = $groups[$id_group]; - - $template_select[$template['id_report']] = array('optgroup' => $group_name, 'name' => $template['name']); + if ($result){ + ui_print_success_message(__('Sucessfully applied')); + } + else{ + ui_print_error_message(__('Could not be applied')); } } +$templates = visual_map_get_user_layout_templates($config['id_user'], true); + if (is_metaconsole()) { $keys_field = 'nombre'; } @@ -107,7 +118,7 @@ $table .= ""; $table .= ""; $table .= ""; $table .= "
"; - $table .= html_print_select($template_select, 'templates', $template_selected, '', __('None'), '0', true, false, true, '', false, 'width:180px;'); + $table .= html_print_select($templates, 'templates', $id_layout_template, '', __('None'), '0', true, false, true, '', false, 'width:180px;'); $table .= ""; $table .= "" . __('Report name') . " " . @@ -199,7 +210,7 @@ html_print_input_hidden('agents_out_keys', implode($separator, $template_agents_ if (check_acl ($config['id_user'], 0, "RW")) { $table .= '
'; - $table .= html_print_input_hidden('action', 'create_template'); + $table .= html_print_input_hidden('action', 'apply', true); $table .= html_print_submit_button (__('Apply template'), 'apply', false, 'class="sub next"', true); $table .= '
'; } From 1369333ab86ad5fe47749ba515f740b92d816507 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 1 Aug 2018 13:52:34 +0200 Subject: [PATCH 52/84] Minor fix vconsole template --- pandora_console/include/functions_visual_map.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index d319891cba..b62d3b4dba 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -4073,7 +4073,7 @@ function visual_map_macro($label,$module){ function visual_map_template_get_template_definition($id_layout_template) { global $config; - return db_get_row ('tlayout_template', 'id_layout_template', $id_layout_template); + return db_get_row ('tlayout_template', 'id', $id_layout_template); } From e4e97fc8afc4648dc56190e0d05909e22393627f Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 1 Aug 2018 14:52:56 +0200 Subject: [PATCH 53/84] Minor fix vconsole templates --- pandora_console/include/functions_visual_map.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index b62d3b4dba..d5aef69f7e 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -4168,7 +4168,11 @@ function visual_map_instanciate_template($id_layout_template, $name, $id_agent) return false; } - $template["name"] = $name; + if (!empty($name)) { + $template["name"] = $name; + } else { + $template["name"] .= io_safe_input(' ') . agents_get_alias($id_agent); + } unset($template["id"]); @@ -4178,8 +4182,8 @@ function visual_map_instanciate_template($id_layout_template, $name, $id_agent) foreach ($template_data as $item) { // update fields - $item["id_agente_modulo"] = modules_get_agentmodule_id($agent_id, $item["module_name"]); - $item["id_agent"] = $agent_id; + $item["id_agente_modulo"] = modules_get_agentmodule_id($item["module_name"], $id_agent); + $item["id_agent"] = $id_agent; $item["id_layout"] = $layout_id; // remove useless fields From a709d0af9fd40b997c7ced99c2429cee3d481bd3 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 1 Aug 2018 14:52:56 +0200 Subject: [PATCH 54/84] Minor fix vconsole templates --- pandora_console/include/functions_visual_map.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index b62d3b4dba..4779f4e477 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -4168,7 +4168,11 @@ function visual_map_instanciate_template($id_layout_template, $name, $id_agent) return false; } - $template["name"] = $name; + if (!empty($name)) { + $template["name"] = $name; + } else { + $template["name"] .= io_safe_input(' ') . agents_get_alias($id_agent); + } unset($template["id"]); @@ -4178,8 +4182,8 @@ function visual_map_instanciate_template($id_layout_template, $name, $id_agent) foreach ($template_data as $item) { // update fields - $item["id_agente_modulo"] = modules_get_agentmodule_id($agent_id, $item["module_name"]); - $item["id_agent"] = $agent_id; + $item["id_agente_modulo"] = modules_get_agentmodule_id($item["module_name"], $id_agent); + $item["id_agent"] = $id_agent; $item["id_layout"] = $layout_id; // remove useless fields @@ -4192,7 +4196,7 @@ function visual_map_instanciate_template($id_layout_template, $name, $id_agent) } } - return $id_layout; + return $layout_id; } From 9924c7877a7139524b4a53f5a40dde740128e854 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 1 Aug 2018 15:17:58 +0200 Subject: [PATCH 55/84] Weird fix agentmodule retrieval proc. --- pandora_console/include/functions_visual_map.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 4779f4e477..733c428bb9 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -4182,10 +4182,14 @@ function visual_map_instanciate_template($id_layout_template, $name, $id_agent) foreach ($template_data as $item) { // update fields - $item["id_agente_modulo"] = modules_get_agentmodule_id($item["module_name"], $id_agent); + $item["id_agente_modulo"] = db_get_value_filter('id_agente_modulo', 'tagente_modulo', array('nombre' => $item["module_name"], 'id_agente' => $id_agent, 'delete_pending' => 0)); $item["id_agent"] = $id_agent; $item["id_layout"] = $layout_id; + // replace macro names + $item["label"] = str_replace('_agentalias_', agents_get_alias($id_agent), $item["label"]); + $item["label"] = str_replace('_agent_', agents_get_name($id_agent), $item["label"]); + // remove useless fields unset($item["id"]); unset($item["id_layout_template"]); From d06c0ebffe2fb56fc6e4d1a2c26ecc6362ed0ef7 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 2 Aug 2018 00:01:23 +0200 Subject: [PATCH 56/84] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index e2c58e4f81..303d31244c 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.725-180801 +Version: 7.0NG.725-180802 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 67edde8dd5..51851bbb59 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.725-180801" +pandora_version="7.0NG.725-180802" 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 4f0c54665c..ab52d5b0db 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.725'; -use constant AGENT_BUILD => '180801'; +use constant AGENT_BUILD => '180802'; # 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 1ae8669e9c..41e554020a 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.725 -%define release 180801 +%define release 180802 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 f65c65827b..6c40f61437 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.725 -%define release 180801 +%define release 180802 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 a027d020c2..2a6539aa15 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180801" +PI_BUILD="180802" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 3a0e72d40b..b2cbfaa99f 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180801} +{180802} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index dd9efa094b..ab8a5827ef 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.725(Build 180801)") +#define PANDORA_VERSION ("7.0NG.725(Build 180802)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index aaa0385f71..3a3acbb021 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.725(Build 180801))" + VALUE "ProductVersion", "(7.0NG.725(Build 180802))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index c69186b997..2583d101af 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.725-180801 +Version: 7.0NG.725-180802 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 b592028cb5..f25856ed6f 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.725-180801" +pandora_version="7.0NG.725-180802" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 22d931b8b0..8f9e840c88 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 = 'PC180801'; +$build_version = 'PC180802'; $pandora_version = 'v7.0NG.725'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index aa7dcc11fa..5bea2f8461 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 53ccdb3653..b24f79ad8d 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180801 +%define release 180802 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 411ccc7d3f..e13fa6d836 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180801 +%define release 180802 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index b735a55b59..5022764a47 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180801" +PI_BUILD="180802" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index ca2570a5dd..d0fd3bf0de 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.725 PS180801"; +my $version = "7.0NG.725 PS180802"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 5fd5213456..966350eba2 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.725 PS180801"; +my $version = "7.0NG.725 PS180802"; # save program name for logging my $progname = basename($0); From a51851cc79419d52880545880354c4de4e081f64 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 2 Aug 2018 09:35:16 +0200 Subject: [PATCH 57/84] Moved vconsole templates to enterprise --- .../include/functions_visual_map.php | 253 ------------------ 1 file changed, 253 deletions(-) diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 733c428bb9..0ab352842e 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -4066,258 +4066,5 @@ function visual_map_macro($label,$module){ return $label; } -/** - * Visual console templates - */ - -function visual_map_template_get_template_definition($id_layout_template) { - global $config; - - return db_get_row ('tlayout_template', 'id', $id_layout_template); -} - - -function visual_map_template_get_template_elements($id_layout_template) { - global $config; - - return db_get_all_rows_filter('tlayout_template_data', array('id_layout_template' => $id_layout_template)); -} - -function visual_map_get_definition($id_layout) { - global $config; - - return db_get_row ('tlayout', 'id', $id_layout); -} - - -function visual_map_get_elements($id_layout) { - global $config; - - return db_get_all_rows_filter('tlayout_data', array('id_layout' => $id_layout)); -} - -/** - * Creates a new template from existing visual console - * @param int $id_layout existing visual console - * @return true OK, false not OK - */ -function visual_map_create_template($id_layout, $name, $id_group) { - global $config; - - $layout = visual_map_get_definition($id_layout); - $layout_data = visual_map_get_elements($id_layout); - - // Create new template based on received information - $template_skel = $layout; - - // rm id - unset($template_skel["id"]); - - // Update fields - if (!empty($name)) { - $template_skel["name"] = $name; - } - - $template_skel["id_group"] = $id_group; - - $template_id = db_process_sql_insert('tlayout_template', $template_skel); - - foreach ($layout_data as $item) { - $data_template_skel = $item; - - // remove unwanted fields - unset($data_template_skel["id"]); - unset($data_template_skel["id_layout"]); - - // Update fields - $data_template_skel["id_layout_template"] = $template_id; - $data_template_skel["module_name"] = modules_get_agentmodule_name($item["id_agente_modulo"]); - $data_template_skel["agent_name"] = agents_get_name($item["id_agent"]); - - // remove unwanted fields - unset($data_template_skel["id_agente_modulo"]); - unset($data_template_skel["id_agent"]); - - $data_template_id = db_process_sql_insert('tlayout_template_data', $data_template_skel); - - } - - - return $template_id; -} - -/** - * Creates a new visual console based on target id_layout_template - * @param int $id_layout_template target template - * @param string $name name for new visual console - * @param int $id_agent target id_agent to customize template - * @return id_layout OK, null not OK - */ -function visual_map_instanciate_template($id_layout_template, $name, $id_agent) { - global $config; - - $layout_id = false; - - - if ($id_agent) { - // retrieve template data - $template = visual_map_template_get_template_definition($id_layout_template); - $template_data = visual_map_template_get_template_elements($id_layout_template); - - if ($template === false) { - return false; - } - - if (!empty($name)) { - $template["name"] = $name; - } else { - $template["name"] .= io_safe_input(' ') . agents_get_alias($id_agent); - } - - unset($template["id"]); - - // insert template schema - $layout_id = db_process_sql_insert('tlayout', $template); - - foreach ($template_data as $item) { - - // update fields - $item["id_agente_modulo"] = db_get_value_filter('id_agente_modulo', 'tagente_modulo', array('nombre' => $item["module_name"], 'id_agente' => $id_agent, 'delete_pending' => 0)); - $item["id_agent"] = $id_agent; - $item["id_layout"] = $layout_id; - - // replace macro names - $item["label"] = str_replace('_agentalias_', agents_get_alias($id_agent), $item["label"]); - $item["label"] = str_replace('_agent_', agents_get_name($id_agent), $item["label"]); - - // remove useless fields - unset($item["id"]); - unset($item["id_layout_template"]); - unset($item["agent_name"]); - unset($item["module_name"]); - - $data_template_id = db_process_sql_insert('tlayout_data', $item); - } - } - - return $layout_id; - -} - -/** - * Erases given id_layout_template - * @param int $id_layout_template target template to be deleted - * @return true OK, false ERR - */ -function visual_map_delete_template($id_layout_template) { - global $config; - - if (!$id_layout_template) { - return false; - } - - // tlayout_template_data is erased using foreign key - return db_process_sql_delete('tlayout_template', array('id' => $id_layout_template)); - -} - -/** - * Get a list of layout templates for given user. - * - * @param int User id. - * @param bool Wheter to return all the fields or only the name (to use in - * html_print_select() directly) - * @param array Additional filters to filter the layouts. - * @param bool Whether to return All group or not. - * - * @return array A list of layouts the user can see. - */ -function visual_map_get_user_layout_templates ($id_user = 0, $only_names = false, $filter = false, - $returnAllGroup = true, $favourite = false) { - - if (! is_array ($filter)){ - $filter = array (); - } else { - if(!empty($filter['name'])){ - $where .= "name LIKE '%".io_safe_output($filter['name'])."%'"; - unset($filter['name']); - } - } - - if($favourite){ - if (empty($where)){ - $where = ""; - } - - if ($where != '') { - $where .= ' AND '; - } - - $where .= "is_favourite = 1"; - } - - if ($returnAllGroup) { - $groups = users_get_groups ($id_user, 'VR', true, true); - } else { - - if(!empty($filter['group'])) { - $permissions_group = users_get_groups ($id_user, 'VR', false, true); - if(empty($permissions_group)){ - $permissions_group = users_get_groups ($id_user, 'VM', false, true); - } - $groups = array_intersect_key($filter['group'], $permissions_group); - } else { - $groups = users_get_groups ($id_user, 'VR', true, true); - if(empty($groups)) { - $groups = users_get_groups ($id_user, 'VM', true, true); - } - } - - - unset($filter['group']); - } - - if (!empty($groups)) { - if (empty($where)) - $where = ""; - - if ($where != '') { - $where .= ' AND '; - } - $where .= sprintf ('id_group IN (%s)', implode (",", array_keys ($groups))); - } - - $where .= db_format_array_where_clause_sql ($filter); - - if ($where == '') { - $where = array(); - } - - $layouts = db_get_all_rows_filter ('tlayout_template', $where); - if ($layouts == false) - return array (); - - $retval = array (); - foreach ($layouts as $layout) { - if ($only_names) - $retval[$layout['id']] = $layout['name']; - else - $retval[$layout['id']] = $layout; - - //add_perms - if ($groups[$layout['id_group']]['vconsole_view']){ - $retval[$layout['id']]['vr'] = $groups[$layout['id_group']]['vconsole_view']; - } - if ($groups[$layout['id_group']]['vconsole_edit']){ - $retval[$layout['id']]['vw'] = $groups[$layout['id_group']]['vconsole_edit']; - } - if ($groups[$layout['id_group']]['vconsole_management']){ - $retval[$layout['id']]['vm'] = $groups[$layout['id_group']]['vconsole_management']; - } - } - - return $retval; -} - ?> \ No newline at end of file From 4968ff38781d20a485e8f2b0c3db7032eec83dca Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 2 Aug 2018 10:07:47 +0200 Subject: [PATCH 58/84] Included library from enterprise --- pandora_console/godmode/reporting/visual_console_template.php | 2 ++ .../godmode/reporting/visual_console_template_wizard.php | 1 + 2 files changed, 3 insertions(+) diff --git a/pandora_console/godmode/reporting/visual_console_template.php b/pandora_console/godmode/reporting/visual_console_template.php index 5a88c43c00..58ae80ccce 100644 --- a/pandora_console/godmode/reporting/visual_console_template.php +++ b/pandora_console/godmode/reporting/visual_console_template.php @@ -17,6 +17,8 @@ global $config; require_once ($config['homedir'] . '/include/functions_visual_map.php'); +enterprise_include_once('/include/functions_visual_map.php'); + // ACL for the general permission $vconsoles_read = check_acl ($config['id_user'], 0, "VR"); $vconsoles_write = check_acl ($config['id_user'], 0, "VW"); diff --git a/pandora_console/godmode/reporting/visual_console_template_wizard.php b/pandora_console/godmode/reporting/visual_console_template_wizard.php index 8de897c6e6..d29fa19aa7 100644 --- a/pandora_console/godmode/reporting/visual_console_template_wizard.php +++ b/pandora_console/godmode/reporting/visual_console_template_wizard.php @@ -16,6 +16,7 @@ global $config; require_once ($config['homedir'] . '/include/functions_visual_map.php'); +enterprise_include_once('/include/functions_visual_map.php'); // ACL for the general permission $vconsoles_read = check_acl ($config['id_user'], 0, "VR"); From d5f042939091825cfdcdeb02e7ed7d33809b039b Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 2 Aug 2018 10:57:00 +0200 Subject: [PATCH 59/84] mv enterprise templates visual console --- .../godmode/reporting/map_builder.php | 26 +++++++++-------- .../reporting/visual_console_favorite.php | 28 +++++++++++-------- .../reporting/visual_console_template.php | 26 +++++++++-------- .../visual_console_template_wizard.php | 28 +++++++++++-------- 4 files changed, 62 insertions(+), 46 deletions(-) diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 9574354e2d..7942692421 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -22,6 +22,8 @@ $vconsoles_read = check_acl ($config['id_user'], 0, "VR"); $vconsoles_write = check_acl ($config['id_user'], 0, "VW"); $vconsoles_manage = check_acl ($config['id_user'], 0, "VM"); +$is_enterprise = enterprise_include_once('include/functions_policies.php'); + if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { db_pandora_audit("ACL Violation", "Trying to access map builder"); @@ -46,17 +48,19 @@ $buttons['visual_console_favorite'] = array( html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .'' ); -$buttons['visual_console_template'] = array( - 'active' => false, - 'text' => '' . - html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' -); +if($is_enterprise){ + $buttons['visual_console_template'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' + ); -$buttons['visual_console_template_wizard'] = array( - 'active' => false, - 'text' => '' . - html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' -); + $buttons['visual_console_template_wizard'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' + ); +} if (!defined('METACONSOLE')) { ui_print_page_header( @@ -87,7 +91,7 @@ if ($delete_layout || $copy_layout) { require ("general/noaccess.php"); exit; } - + $group_id = db_get_value("id_group", "tlayout", "id", $id_layout); if ($group_id === false) { db_pandora_audit("ACL Violation", diff --git a/pandora_console/godmode/reporting/visual_console_favorite.php b/pandora_console/godmode/reporting/visual_console_favorite.php index b753125375..b090f9dde5 100644 --- a/pandora_console/godmode/reporting/visual_console_favorite.php +++ b/pandora_console/godmode/reporting/visual_console_favorite.php @@ -17,10 +17,12 @@ global $config; require_once ($config['homedir'] . '/include/functions_visual_map.php'); // ACL for the general permission -$vconsoles_read = check_acl ($config['id_user'], 0, "VR"); -$vconsoles_write = check_acl ($config['id_user'], 0, "VW"); +$vconsoles_read = check_acl ($config['id_user'], 0, "VR"); +$vconsoles_write = check_acl ($config['id_user'], 0, "VW"); $vconsoles_manage = check_acl ($config['id_user'], 0, "VM"); +$is_enterprise = enterprise_include_once('include/functions_policies.php'); + if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { db_pandora_audit("ACL Violation", "Trying to access map builder"); @@ -40,17 +42,19 @@ $buttons['visual_console_favorite'] = array( html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .'' ); -$buttons['visual_console_template'] = array( - 'active' => false, - 'text' => '' . - html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' -); +if($is_enterprise){ + $buttons['visual_console_template'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' + ); -$buttons['visual_console_template_wizard'] = array( - 'active' => false, - 'text' => '' . - html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' -); + $buttons['visual_console_template_wizard'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' + ); +} if (!defined('METACONSOLE')) { ui_print_page_header( diff --git a/pandora_console/godmode/reporting/visual_console_template.php b/pandora_console/godmode/reporting/visual_console_template.php index 58ae80ccce..77f2693bf4 100644 --- a/pandora_console/godmode/reporting/visual_console_template.php +++ b/pandora_console/godmode/reporting/visual_console_template.php @@ -24,6 +24,8 @@ $vconsoles_read = check_acl ($config['id_user'], 0, "VR"); $vconsoles_write = check_acl ($config['id_user'], 0, "VW"); $vconsoles_manage = check_acl ($config['id_user'], 0, "VM"); +$is_enterprise = enterprise_include_once('include/functions_policies.php'); + if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { db_pandora_audit("ACL Violation", "Trying to access map builder"); @@ -48,17 +50,19 @@ $buttons['visual_console_favorite'] = array( html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .'' ); -$buttons['visual_console_template'] = array( - 'active' => true, - 'text' => '' . - html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' -); +if($is_enterprise){ + $buttons['visual_console_template'] = array( + 'active' => true, + 'text' => '' . + html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' + ); -$buttons['visual_console_template_wizard'] = array( - 'active' => false, - 'text' => '' . - html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' -); + $buttons['visual_console_template_wizard'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' + ); +} if (!defined('METACONSOLE')) { ui_print_page_header( @@ -178,7 +182,7 @@ if($array_template_visual_console && is_array($array_template_visual_console)){ $data[0] = $value['name']; $data[1] = $value['id_group']; $data[2] = $value['is_favourite']; - $data[3] = ''.html_print_image ("images/cross.png", true).''; + $data[3] = ''.html_print_image ("images/cross.png", true).''; array_push ($table->data, $data); } diff --git a/pandora_console/godmode/reporting/visual_console_template_wizard.php b/pandora_console/godmode/reporting/visual_console_template_wizard.php index d29fa19aa7..6351f4525d 100644 --- a/pandora_console/godmode/reporting/visual_console_template_wizard.php +++ b/pandora_console/godmode/reporting/visual_console_template_wizard.php @@ -19,10 +19,12 @@ require_once ($config['homedir'] . '/include/functions_visual_map.php'); enterprise_include_once('/include/functions_visual_map.php'); // ACL for the general permission -$vconsoles_read = check_acl ($config['id_user'], 0, "VR"); -$vconsoles_write = check_acl ($config['id_user'], 0, "VW"); +$vconsoles_read = check_acl ($config['id_user'], 0, "VR"); +$vconsoles_write = check_acl ($config['id_user'], 0, "VW"); $vconsoles_manage = check_acl ($config['id_user'], 0, "VM"); +$is_enterprise = enterprise_include_once('include/functions_policies.php'); + if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { db_pandora_audit("ACL Violation", "Trying to access map builder"); @@ -47,17 +49,19 @@ $buttons['visual_console_favorite'] = array( html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .'' ); -$buttons['visual_console_template'] = array( - 'active' => false, - 'text' => '' . - html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' -); +if($is_enterprise){ + $buttons['visual_console_template'] = array( + 'active' => false, + 'text' => '' . + html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' + ); -$buttons['visual_console_template_wizard'] = array( - 'active' => true, - 'text' => '' . - html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' -); + $buttons['visual_console_template_wizard'] = array( + 'active' => true, + 'text' => '' . + html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' + ); +} if (!defined('METACONSOLE')) { ui_print_page_header( From ef2ff495046c135045d9eb0dbe4288ac8435f42f Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 2 Aug 2018 11:03:13 +0200 Subject: [PATCH 60/84] mv enterprise visual console template --- .../reporting/visual_console_template.php | 196 ------ .../visual_console_template_wizard.php | 665 ------------------ 2 files changed, 861 deletions(-) delete mode 100644 pandora_console/godmode/reporting/visual_console_template.php delete mode 100644 pandora_console/godmode/reporting/visual_console_template_wizard.php diff --git a/pandora_console/godmode/reporting/visual_console_template.php b/pandora_console/godmode/reporting/visual_console_template.php deleted file mode 100644 index 77f2693bf4..0000000000 --- a/pandora_console/godmode/reporting/visual_console_template.php +++ /dev/null @@ -1,196 +0,0 @@ - false, - 'text' => '' . - html_print_image ("images/visual_console.png", true, array ("title" => __('Visual Console List'))) .'' -); - -$buttons['visual_console_favorite'] = array( - 'active' => false, - 'text' => '' . - html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .'' -); - -if($is_enterprise){ - $buttons['visual_console_template'] = array( - 'active' => true, - 'text' => '' . - html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' - ); - - $buttons['visual_console_template_wizard'] = array( - 'active' => false, - 'text' => '' . - html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' - ); -} - -if (!defined('METACONSOLE')) { - ui_print_page_header( - __('Visual Console') .' » ' . __('Template'), - "images/op_reporting.png", - false, - "map_builder", - false, - $buttons - ); -} - -$id_layout = (int) get_parameter ('id_layout', 0); -$name_template = (string) get_parameter ('name_template', ''); -$group = (int) get_parameter ('group', 0); -$action = (string) get_parameter ('action', ''); - -if($action == "create_template"){ - if(!$id_layout){ - ui_print_error_message(__('visual console has not been selected')); - } - - $result = visual_map_create_template($id_layout, $name_template, $group); - - if(!$result){ - ui_print_error_message(__('Error. Error created template')); - } - else{ - ui_print_success_message(__('Successfully created template')); - } -} - -if($action == "delete_template"){ - if(!$id_layout){ - ui_print_error_message(__('visual console has not been selected')); - } - - $result = visual_map_delete_template($id_layout); - - if(!$result){ - ui_print_error_message(__('Error. Error delete template')); - } - else{ - ui_print_success_message(__('Successfully delete template')); - } -} - -$visual_console_array = visual_map_get_user_layouts($config['id_user'], true); - -if (!check_acl ($config['id_user'], 0, "VR")){ - $return_all_group = false; -} -else{ - $return_all_group = true; -} - -$table = ''; -$table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; -$table .= "
"; - $table .= "" . __("Create From") . ":"; - $table .= ""; - $table .= html_print_select($visual_console_array, 'id_layout', $id_layout, '', __('none'), 0, true); - $table .= "
"; - $table .= "" . __("Name") . ":"; - $table .= ""; - $table .= html_print_input_text ('name_template', $name_template, '', 50, 255, true); - $table .= "
"; - $table .= '' . __("Group") . ':'; - $table .= ""; - $table .= html_print_select_groups(false, "AR", $return_all_group, "group", $group, 'this.form.submit();', '', 0, true, false, true, '', false); - $table .= "
"; - -if (check_acl ($config['id_user'], 0, "RW")) { - $table .= '
'; - $table .= html_print_input_hidden('action', 'create_template', true); - $table .= html_print_submit_button (__('Create template'), 'apply', false, 'class="sub next"', true); - $table .= '
'; -} -$table .= ''; - -echo ui_toggle($table, __('Create New Template'), '', false, true); - -$array_template_visual_console = visual_map_get_user_layout_templates($config['id_user']); - -if($array_template_visual_console && is_array($array_template_visual_console)){ - $table = new stdClass(); - $table->width = '100%'; - $table->class = 'databox data'; - $table->data = array (); - $table->head = array (); - $table->head[0] = __('Name'); - $table->head[1] = __('Group'); - $table->head[2] = __('Fovourite'); - $table->head[3] = __('Delete'); - $table->size[3] = "6%"; - - $table->align = array (); - $table->align[0] = 'left'; - $table->align[1] = 'left'; - $table->align[2] = 'left'; - $table->align[3] = 'left'; - - foreach ($array_template_visual_console as $key => $value) { - $data = array (); - $data[0] = $value['name']; - $data[1] = $value['id_group']; - $data[2] = $value['is_favourite']; - $data[3] = ''.html_print_image ("images/cross.png", true).''; - array_push ($table->data, $data); - } - - html_print_table ($table); -} -else{ - ui_print_info_message(__('No data to show')); -} - - -?> \ No newline at end of file diff --git a/pandora_console/godmode/reporting/visual_console_template_wizard.php b/pandora_console/godmode/reporting/visual_console_template_wizard.php deleted file mode 100644 index 6351f4525d..0000000000 --- a/pandora_console/godmode/reporting/visual_console_template_wizard.php +++ /dev/null @@ -1,665 +0,0 @@ - false, - 'text' => '' . - html_print_image ("images/visual_console.png", true, array ("title" => __('Visual Console List'))) .'' -); - -$buttons['visual_console_favorite'] = array( - 'active' => false, - 'text' => '' . - html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .'' -); - -if($is_enterprise){ - $buttons['visual_console_template'] = array( - 'active' => false, - 'text' => '' . - html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' - ); - - $buttons['visual_console_template_wizard'] = array( - 'active' => true, - 'text' => '' . - html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' - ); -} - -if (!defined('METACONSOLE')) { - ui_print_page_header( - __('Visual Console') .' » ' . __('Wizard'), - "images/op_reporting.png", - false, - "map_builder", - false, - $buttons - ); -} - -$action = get_parameter ('action', ''); - -if ($action == 'apply') { - $agents_selected = (array) get_parameter('id_agents2'); - $id_layout_template = get_parameter('templates'); - $name = get_parameter('template_report_name', ''); - $group = get_parameter('template_report_group'); - - if (empty($agents_selected) || empty($id_layout_template)) - $result = false; - else { - if($agents_selected && is_array($agents_selected)){ - foreach ($agents_selected as $key => $value) { - $result = visual_map_instanciate_template( - $id_layout_template, - $name, - $value - ); - } - } - } - - if ($result){ - ui_print_success_message(__('Sucessfully applied')); - } - else{ - ui_print_error_message(__('Could not be applied')); - } -} - -$templates = visual_map_get_user_layout_templates($config['id_user'], true); - -if (is_metaconsole()) { - $keys_field = 'nombre'; -} -else { - $keys_field = 'id_grupo'; -} - -$attr_available = array('id' => 'image-select_all_available', 'title' => __('Select all'), 'style' => 'cursor: pointer;'); -$attr_apply = array('id' => 'image-select_all_apply', 'title' => __('Select all'), 'style' => 'cursor: pointer;'); - -$table = '
'; -$table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; - $table .= ""; -$table .= "
"; - $table .= "" . __('Templates') . ":"; - $table .= ""; - $table .= html_print_select($templates, 'templates', $id_layout_template, '', __('None'), '0', true, false, true, '', false, 'width:180px;'); - $table .= ""; - $table .= "" . __('Report name') . " " . - ui_print_help_tip(__('Left in blank if you want to use default name: Template name - agents (num agents) - Date'), true) . ":"; - $table .= ""; - $table .= html_print_input_text ('template_report_name', '', '', 80, 150, true); - $table .= "
"; - $table .= '' . __('Filter group') . ':'; - $table .= ""; - $table .= html_print_select_groups( - false, "RR", users_can_manage_group_all("RR"), - 'group', '', '', '', 0, true, false, false, - '', false, false, false, false, $keys_field - ); - $table .= ""; - $table .= "" . __('Target group') . ":"; - $table .= ""; - $table .= html_print_select_groups( - false, "RR", users_can_manage_group_all("RR"), - 'template_report_group', '', '', '', 0, true, - false, false, '', false, false, false, false, - $keys_field - ); - $table .= "
"; - $table .= '' . __('Filter agent') . ':'; - $table .= ""; - $table .= html_print_input_text ('agent_filter', $agent_filter, '', 20, 150, true); - $table .= ""; - $table .= ''; - $table .= ""; - $table .= ''; - $table .= "
"; - $table .= "" . __('Agents available')."  " . - html_print_image ('images/tick.png', true, $attr_available, false, true); - $table .= ""; - $table .= "" . __('Agents to apply')."  " . - html_print_image ('images/tick.png', true, $attr_apply, false, true); - $table .= "
"; - $option_style = array(); - $template_agents_in = array(); - $template_agents_all = array(); - $template_agents_out = array(); - $template_agents_out = array_diff_key($template_agents_all, $template_agents_in); - $template_agents_in_keys = array_keys($template_agents_in); - $template_agents_out_keys = array_keys($template_agents_out); - - $table .= html_print_select ($template_agents_out, 'id_agents[]', 0, false, '', '', true, true, true, '', false, 'width: 100%;', $option_style); - $table .= ""; - $table .= html_print_image ('images/darrowright.png', true, array ('id' => 'right', 'title' => __('Add agents to template'))); - $table .= html_print_image ('images/darrowleft.png', true, array ('id' => 'left', 'title' => __('Undo agents to template'))); - $table .= ""; - $table .= $option_style = array(); - //Agents applied to the template - $table .= html_print_select ($template_agents_in, 'id_agents2[]', 0, false, '', '', true, true, true, '', false, 'width: 100%;', $option_style); - $table .= "
"; - -html_print_input_hidden('separator', $separator); -html_print_input_hidden('agents_in', implode($separator, $template_agents_in)); -html_print_input_hidden('agents_in_keys', implode($separator, $template_agents_in_keys)); -html_print_input_hidden('agents_out', implode($separator, $template_agents_out)); -html_print_input_hidden('agents_out_keys', implode($separator, $template_agents_out_keys)); - -if (check_acl ($config['id_user'], 0, "RW")) { - $table .= '
'; - $table .= html_print_input_hidden('action', 'apply', true); - $table .= html_print_submit_button (__('Apply template'), 'apply', false, 'class="sub next"', true); - $table .= '
'; -} -$table .= '
'; - -echo $table; - -?> - \ No newline at end of file From 9d5004efbf402b3489463a3440de103170d31c13 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 2 Aug 2018 11:07:22 +0200 Subject: [PATCH 61/84] fixed minor error --- pandora_console/godmode/reporting/map_builder.php | 4 ++-- pandora_console/godmode/reporting/visual_console_favorite.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 7942692421..5e9a64f75e 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -51,13 +51,13 @@ $buttons['visual_console_favorite'] = array( if($is_enterprise){ $buttons['visual_console_template'] = array( 'active' => false, - 'text' => '' . + 'text' => '' . html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' ); $buttons['visual_console_template_wizard'] = array( 'active' => false, - 'text' => '' . + 'text' => '' . html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' ); } diff --git a/pandora_console/godmode/reporting/visual_console_favorite.php b/pandora_console/godmode/reporting/visual_console_favorite.php index b090f9dde5..f447f76585 100644 --- a/pandora_console/godmode/reporting/visual_console_favorite.php +++ b/pandora_console/godmode/reporting/visual_console_favorite.php @@ -45,13 +45,13 @@ $buttons['visual_console_favorite'] = array( if($is_enterprise){ $buttons['visual_console_template'] = array( 'active' => false, - 'text' => '' . + 'text' => '' . html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' ); $buttons['visual_console_template_wizard'] = array( 'active' => false, - 'text' => '' . + 'text' => '' . html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' ); } From a9bb538e1a98e265e216c53c658fbb55ee0c8fd4 Mon Sep 17 00:00:00 2001 From: danielmaya Date: Thu, 2 Aug 2018 12:47:42 +0200 Subject: [PATCH 62/84] Fixed permissions in alert_actions --- pandora_console/godmode/alerts/alert_actions.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pandora_console/godmode/alerts/alert_actions.php b/pandora_console/godmode/alerts/alert_actions.php index b60388e6fa..3bad38b982 100644 --- a/pandora_console/godmode/alerts/alert_actions.php +++ b/pandora_console/godmode/alerts/alert_actions.php @@ -370,12 +370,8 @@ foreach ($actions as $action) { $data[0] = ''. $action['name'].''; $data[1] = ui_print_group_icon ($action["id_group"], true) .' '; - $hack_id_group_all = $action["id_group"]; - if ($hack_id_group_all == 0) { - //To avoid check all groups instead the pseudo-group all - $hack_id_group_all = -1; - } - if (check_acl($config['id_user'], $hack_id_group_all, "LM")) { + + if (check_acl($config['id_user'], $action["id_group"], "LM")) { $data[2] = '' . html_print_image("images/copy.png", true) . ''; From ca67bd632e9c0aaa9fea97c91e05fad678e7e1ec Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 2 Aug 2018 12:56:43 +0200 Subject: [PATCH 63/84] Removed Oracle and Posgre code --- pandora_console/include/functions_modules.php | 98 +++---------------- 1 file changed, 16 insertions(+), 82 deletions(-) diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 71d98a8d2e..f6d088067c 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -537,51 +537,20 @@ function modules_create_agent_module ($id_agent, $name, $values = false, $disabl // Sync modules start in unknown status $status = AGENT_MODULE_STATUS_NO_DATA; } - switch ($config["dbtype"]) { - case "mysql": - $result = db_process_sql_insert ('tagente_estado', - array ('id_agente_modulo' => $id_agent_module, - 'datos' => 0, - 'timestamp' => '01-01-1970 00:00:00', - 'estado' => $status, - 'known_status' => $status, - 'id_agente' => (int) $id_agent, - 'utimestamp' => 0, - 'status_changes' => 0, - 'last_status' => $status, - 'last_known_status' => $status - )); - break; - case "postgresql": - $result = db_process_sql_insert ('tagente_estado', - array ('id_agente_modulo' => $id_agent_module, - 'datos' => 0, - 'timestamp' => null, - 'estado' => $status, - 'known_status' => $status, - 'id_agente' => (int) $id_agent, - 'utimestamp' => 0, - 'status_changes' => 0, - 'last_status' => $status, - 'last_known_status' => $status - )); - break; - case "oracle": - $result = db_process_sql_insert ('tagente_estado', - array ('id_agente_modulo' => $id_agent_module, - 'datos' => 0, - 'timestamp' => '#to_date(\'1970-01-01 00:00:00\', \'YYYY-MM-DD HH24:MI:SS\')', - 'estado' => $status, - 'known_status' => $status, - 'id_agente' => (int) $id_agent, - 'utimestamp' => 0, - 'status_changes' => 0, - 'last_status' => $status, - 'last_known_status' => $status - )); - break; - } - + + $result = db_process_sql_insert ('tagente_estado', array ( + 'id_agente_modulo' => $id_agent_module, + 'datos' => 0, + 'timestamp' => '01-01-1970 00:00:00', + 'estado' => $status, + 'known_status' => $status, + 'id_agente' => (int) $id_agent, + 'utimestamp' => 0, + 'status_changes' => 0, + 'last_status' => $status, + 'last_known_status' => $status + )); + if ($result === false) { db_process_sql_delete ('tagente_modulo', array ('id_agente_modulo' => $id_agent_module)); @@ -758,34 +727,7 @@ function modules_format_delete_log4x($id) * @return array An array with module information */ function modules_get_agentmodule ($id_agentmodule) { - global $config; - - switch ($config['dbtype']) { - case "mysql": - case "postgresql": - return db_get_row ('tagente_modulo', 'id_agente_modulo', (int) $id_agentmodule); - break; - case "oracle": - $fields = db_get_all_rows_filter('USER_TAB_COLUMNS', - 'TABLE_NAME = \'TAGENTE_MODULO\' AND COLUMN_NAME <> \'MAX_CRITICAL\' AND COLUMN_NAME <> \'MIN_CRITICAL\' AND COLUMN_NAME <> \'POST_PROCESS\' AND COLUMN_NAME <> \'MAX_WARNING\' AND COLUMN_NAME <> \'MIN_WARNING\'', 'COLUMN_NAME'); - foreach ($fields as $field) { - $fields_[] = $field['column_name']; - } - $fields = implode(',', $fields_); - - $result = db_process_sql(" - SELECT TO_NUMBER(MAX_CRITICAL) as max_critical, - TO_NUMBER(MIN_CRITICAL) as min_critical, - TO_NUMBER(MAX_WARNING) as max_warning, - TO_NUMBER(MIN_WARNING) as min_warning, - TO_NUMBER(POST_PROCESS) as post_process, - " . $fields . " - FROM tagente_modulo - WHERE id_agente_modulo = " . $id_agentmodule); - - return $result[0]; - break; - } + return db_get_row ('tagente_modulo', 'id_agente_modulo', (int) $id_agentmodule); } function modules_get_table_data($id_agent_module) { @@ -1999,8 +1941,6 @@ function modules_get_status($id_agent_module, $db_status, $data, &$status, &$tit // Get unknown agents by using the status code in modules function modules_agents_unknown ($module_name) { - - //TODO REVIEW ORACLE AND POSTGRES return db_get_sql ("SELECT COUNT( DISTINCT tagente.id_agente) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.disabled = 0 @@ -2022,8 +1962,6 @@ function modules_agents_ok ($module_name) { //This query grouped all modules by agents and select the MAX value for status which has the value 0 //If MAX(estado) is 0 it means all modules has status 0 => OK //Then we count the agents of the group selected to know how many agents are in OK status - - //TODO REVIEW ORACLE AND POSTGRES return db_get_sql ("SELECT COUNT(max_estado) FROM ( SELECT MAX(tagente_estado.estado) as max_estado @@ -2046,9 +1984,7 @@ function modules_agents_critical ($module_name) { //The status values are: 0 OK; 1 Critical; 2 Warning; 3 Unkown //If estado = 1 it means at leas 1 module is in critical status so the agent is critical //Then we count the agents of the group selected to know how many agents are in critical status - - //TODO REVIEW ORACLE AND POSTGRES - + return db_get_sql ("SELECT COUNT( DISTINCT tagente_estado.id_agente) FROM tagente_estado, tagente, tagente_modulo WHERE tagente.disabled = 0 AND tagente_estado.utimestamp != 0 @@ -2070,8 +2006,6 @@ function modules_agents_warning ($module_name) { //If MIN(estado) is 2 it means at least one module is warning and there is no critical modules //Then we count the agents of the group selected to know how many agents are in warning status - //TODO REVIEW ORACLE AND POSTGRES - return db_get_sql ("SELECT COUNT(min_estado) FROM (SELECT MAX(tagente_estado.estado) as min_estado FROM tagente_estado, tagente, tagente_modulo From 18800feaae598ae5c1ce4e906cb0249c57cfd991 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 2 Aug 2018 13:02:33 +0200 Subject: [PATCH 64/84] Refactorized snapshot link on node --- pandora_console/include/class/Tree.class.php | 2 - .../include/functions_treeview.php | 39 +--- pandora_console/include/functions_ui.php | 79 ++++--- pandora_console/mobile/include/ui.class.php | 3 +- pandora_console/mobile/operation/modules.php | 71 ++---- .../operation/agentes/estado_agente.php | 25 +-- .../operation/agentes/snapshot_view.php | 40 ++-- .../operation/agentes/status_monitor.php | 206 ++++-------------- 8 files changed, 152 insertions(+), 313 deletions(-) diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 996eeaf07f..6d1a94ac66 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -1684,8 +1684,6 @@ class Tree { // Info to be able to open the snapshot image new page $module['snapshot'] = ui_get_snapshot_link(array( 'id_module' => $module['id'], - 'last_data' => $module['datos'], - 'timestamp' => $module['timestamp'], 'interval' => $module['current_interval'], 'module_name' => $module['name'] ), true); diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 5c50f853b8..0315509b0f 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -266,35 +266,18 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head = $last_data_str .= " "; $last_data_str .= html_print_image('images/clock2.png', true, array('title' => $last_data["timestamp"], 'width' => '18px')); - - $is_snapshot = is_snapshot_data ( $last_data["datos"] ); - if (($config['command_snapshot']) && ($is_snapshot)) { - $link = ui_get_snapshot_link( array( - 'id_module' => $module['id_agente_modulo'], - 'last_data' => $last_data['datos'], - 'timestamp' => $last_data['timestamp'], - 'interval' => $module['current_interval'], - 'module_name' => $module['module_name'] - )); - if(!is_image_data($last_data["datos"])){ - $salida = '' . - html_print_image('images/default_list.png', true, - array('border' => '0', - 'alt' => '', - 'title' => __('Snapshot view'))) . '   '; - } - else { - $salida = '' . - html_print_image('images/photo.png', true, - array('border' => '0', - 'alt' => '', - 'title' => __('Snapshot view'))) . '   '; - } - } - - - $last_data_str .= $salida; + $is_snapshot = is_snapshot_data ( $last_data["datos"] ); + $is_large_image = is_text_to_black_string ($last_data["datos"]); + if (($config['command_snapshot']) && ($is_snapshot || $is_large_image)) { + $link = ui_get_snapshot_link( array( + 'id_module' => $module['id_agente_modulo'], + 'interval' => $module['current_interval'], + 'module_name' => $module['module_name'] + )); + $salida = ui_get_snapshot_image($link, $is_snapshot) . '  '; + } + $last_data_str .= $salida; } else { $last_data_str = '' . __('No data') . ''; diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 0cb9e10cdd..279542edca 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3791,36 +3791,27 @@ function ui_print_module_string_value($value, $id_agente_module, $value = io_safe_input($value); } + + $is_snapshot = is_snapshot_data ($module["datos"]); + $is_large_image = is_text_to_black_string ($module["datos"]); + if (($config['command_snapshot']) && ($is_snapshot || $is_large_image)) { + + + $row[7] = ui_get_snapshot_image($link, $is_snapshot) . '  '; + } + $is_snapshot = is_snapshot_data($value); $is_large_image = is_text_to_black_string ($value); - if (($config['command_snapshot']) && ($is_snapshot || $is_large_image)) { - $handle = "snapshot" . "_" . $id_agente_module; - $url = 'include/procesos.php?agente=' . $id_agente_module; - $win_handle = dechex(crc32($handle)); - - $link = "winopeng_var('operation/agentes/snapshot_view.php?" . - "id=" . $id_agente_module . - "&refr=" . $current_interval . - "&label=" . rawurlencode(urlencode(io_safe_output($module_name))) . "','" . $win_handle . "', 700,480)"; - if ($is_snapshot) { - $salida = '' . - html_print_image("images/photo.png", true, - array("border" => '0', - "alt" => "", - "title" => __("Snapshot view"))) . '   '; - } - else { - $salida = '' . - html_print_image("images/default_list.png", true, - array("border" => '0', - "alt" => "", - "title" => __("Snapshot view"))) . '   '; - - } - } - else { - + $link = ui_get_snapshot_link( array( + 'id_module' => $id_agente_module, + 'last_data' => $value, + 'interval' => $current_interval, + 'module_name' => $module_name, + 'timestamp' => db_get_value('timestamp', 'tagente_estado', 'id_agente_modulo', $id_agente_module) + )); + $salida = ui_get_snapshot_image($link, $is_snapshot) . '  '; + } else { $sub_string = substr(io_safe_output($value), 0, 12); if ($value == $sub_string) { if ($value == 0 && !$sub_string) { @@ -3921,8 +3912,8 @@ function ui_get_snapshot_link($params, $only_params = false) { 'id_module' => 0, //id_agente_modulo 'module_name' => '', 'interval' => 300, - 'last_data' => '', - 'timestamp' => '0' + 'timestamp' => 0, + 'id_node' => 0 ); // Merge default params with passed params @@ -3933,10 +3924,10 @@ function ui_get_snapshot_link($params, $only_params = false) { $url = "$page?" . "id=" . $params['id_module'] . - "&refr=" . $parms['interval'] . - "×tamp=" . $params['timestamp'] . - "&last_data=" . rawurlencode(urlencode(io_safe_output($params['last_data']))) . - "&label=" . rawurlencode(urlencode(io_safe_output($params['module_name']))); + "&label=" . rawurlencode(urlencode(io_safe_output($params['module_name']))). + "&id_node=" . $params['id_node']; + if ($params['timestamp'] != 0) $url .= "×tamp=" . $parms['timestamp']; + if ($params['timestamp'] != 0) $url .= "&refr=" . $parms['interval']; // Second parameter of js winopeng_var $win_handle = dechex(crc32('snapshot_' . $params['id_module'])); @@ -3950,6 +3941,28 @@ function ui_get_snapshot_link($params, $only_params = false) { return "winopeng_var('" . implode("', '", $link_parts) . "')"; } +/** + * @brief Get the snapshot image with the link to open a snapshot into a new page + * + * @param string Built link + * @param bool Picture image or list image + * + * @return string HTML anchor link with image + */ +function ui_get_snapshot_image ($link, $is_image) { + $image_name = $is_image ? 'photo.png' : 'default_list.png'; + + $link = '' . + html_print_image("images/$image_name", true, + array('border' => '0', + 'alt' => '', + 'title' => __('Snapshot view')) + ) . + ''; + + return $link; +} + function ui_get_using_system_timezone_warning ($tag = "h3", $return = true) { global $config; diff --git a/pandora_console/mobile/include/ui.class.php b/pandora_console/mobile/include/ui.class.php index c1525e8722..29505c8956 100755 --- a/pandora_console/mobile/include/ui.class.php +++ b/pandora_console/mobile/include/ui.class.php @@ -655,10 +655,9 @@ class Ui { echo " \n"; echo " \n"; - //echo " \n"; echo " \n"; echo " \n"; - //echo " \n"; + echo " \n"; echo " \n"; echo " \n"; diff --git a/pandora_console/mobile/operation/modules.php b/pandora_console/mobile/operation/modules.php index 5dd89b9aec..8971334eea 100644 --- a/pandora_console/mobile/operation/modules.php +++ b/pandora_console/mobile/operation/modules.php @@ -270,6 +270,7 @@ class Modules { } private function getListModules($page = 0, $ajax = false) { + global $config; $system = System::getInstance(); $user = User::getInstance(); @@ -590,34 +591,17 @@ class Modules { $output = $sub_string; } } - - - $is_snapshot = is_snapshot_data($module["datos"]); - - $handle = "snapshot" . "_" . $module["id_agente_modulo"]; - $url = 'include/procesos.php?agente=' . $module["id_agente_modulo"]; - - $link = "window.open('../operation/agentes/snapshot_view.php?" . - "id=" . $module["id_agente_modulo"] . - "&refr=" . $module["module_interval"]."','".$handle."','width=700, height=480')"; - - if ($is_snapshot) { - if (is_image_data($module["datos"])) { - $row[7] = $row[__('Data')] = '' . - html_print_image("images/photo.png", true, - array("border" => '0', - "alt" => "", - "title" => __("Snapshot view"))) . '   '; - } - else { - $row[7] = $row[__('Data')] = '' . - html_print_image("images/default_list.png", true, - array("border" => '0', - "alt" => "", - "title" => __("Snapshot view"))) . '   '; - } - } - else { + + $is_snapshot = is_snapshot_data ($module["datos"]); + $is_large_image = is_text_to_black_string ($module["datos"]); + if (($config['command_snapshot']) && ($is_snapshot || $is_large_image)) { + $link = ui_get_snapshot_link( array( + 'id_module' => $module['id_agente_modulo'], + 'module_name' => $module['module_name'] + )); + + $row[7] = ui_get_snapshot_image($link, $is_snapshot) . '  '; + } else { $row[7] = $row[__('Data')] = '' . '' . @@ -626,18 +610,7 @@ class Modules { $module['id_agente_modulo'] . '&id_agent=' . $this->id_agent . '">' . $output . '' . ''; } - - - /* - - '' . - '' . - '' . $output . '' . '';*/ - + if (!$ajax) { unset($row[0]); if ($this->columns['agent']) { @@ -814,23 +787,9 @@ class Modules { $filters_to_serialize[] = sprintf(__("Tag: %s"), $tag_name); } - + $string = '(' . implode(' - ', $filters_to_serialize) . ')'; - - - - //~ $status = $this->list_status[$this->status]; - //~ - //~ $group = groups_get_name($this->group, true); - //~ - //~ $module_group = db_get_value('name', - //~ 'tmodule_group', 'id_mg', $this->module_group); - //~ $module_group = io_safe_output($module_group); - //~ - //~ $string = sprintf( - //~ __("(Status: %s - Group: %s - Module group: %s - Free Search: %s)"), - //~ $status, $group, $module_group, $this->free_search); - + return $string; } } diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 1632242dec..d37cc9396c 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -108,21 +108,18 @@ if (is_ajax ()) { $value = $module_value; } else{ - // If carriage returns present... then is a "Snapshot" data (full command output) - $is_snapshot = is_snapshot_data ( $module_value ); - $module = modules_get_agentmodule($id_module); - - if (($config['command_snapshot']) && ($is_snapshot)){ - $handle = "snapshot"."_".$module["id_agente_modulo"]; - $url = 'include/procesos.php?agente='.$module["id_agente_modulo"]; - $win_handle = dechex(crc32($handle)); - - $link ="winopeng_var('operation/agentes/snapshot_view.php?id=".$module["id_agente_modulo"]."&refr=".$module["current_interval"]."&label=".$module["nombre"]."','".$win_handle."', 700,480)"; - - $value = '' . html_print_image("images/default_list.png", true, array("border" => '0', "alt" => "", "title" => __("Snapshot view"))) . '   '; - } - else { + + $is_snapshot = is_snapshot_data ($module_value); + $is_large_image = is_text_to_black_string ($module_value); + if (($config['command_snapshot']) && ($is_snapshot || $is_large_image)) { + $link = ui_get_snapshot_link( array( + 'id_module' => $module["id_agente_modulo"], + 'interval' => $module["current_interval"], + 'module_name' => $module["nombre"] + )); + $value = ui_get_snapshot_image($link, $is_snapshot) . '  '; + } else { $value = ui_print_module_string_value( $module_value, $module["id_agente_modulo"], $module["current_interval"], $module["module_name"]); diff --git a/pandora_console/operation/agentes/snapshot_view.php b/pandora_console/operation/agentes/snapshot_view.php index c5d09a0f1c..07eda62a3e 100644 --- a/pandora_console/operation/agentes/snapshot_view.php +++ b/pandora_console/operation/agentes/snapshot_view.php @@ -28,6 +28,7 @@ require_once ($config['homedir'] . '/include/functions_graph.php'); require_once ($config['homedir'] . '/include/functions_modules.php'); require_once ($config['homedir'] . '/include/functions_agents.php'); require_once ($config['homedir'] . '/include/functions_tags.php'); +enterprise_include_once ('include/functions_metaconsole'); check_login (); @@ -38,17 +39,27 @@ if (file_exists ('../../include/languages/'.$user_language.'.mo')) { } $id = get_parameter('id'); -$label = get_parameter ("label"); -$last_data = get_parameter("last_data", ''); -$last_timestamp = get_parameter("timestamp", ''); -// FIXME: Support to old call snapshow_view calls. Remove it when all are migrated -if (empty($last_data)) { - $row = db_get_row_sql("SELECT * - FROM tagente_estado - WHERE id_agente_modulo = $id"); - $last_data = io_safe_output($row["datos"]); - $last_timestamp = $row["timestamp"]; +$id_node = get_parameter("id_node", 0); + +// Get the data +if ($id_node > 0) { + $connection = metaconsole_get_connection_by_id($server_name); + if (metaconsole_load_external_db($connection) != NOERR) { + echo "Node connection fail"; + exit; + } } +$row_module = modules_get_agentmodule($id); +$row_state = db_get_row('tagente_estado', 'id_agente_modulo', $id); +if ($id_node > 0) { + metaconsole_restore_db(); +} + +// Build the info +$label = get_parameter ("label", io_safe_output($row_module['module_name'])); +$last_timestamp = get_parameter("timestamp", $row_state['timestamp']); +$last_data = io_safe_output($row_state["datos"]); +$refresh = (int) get_parameter ("refr", $row_state['current_interval']); // TODO - Put ACL here ?> @@ -56,7 +67,6 @@ if (empty($last_data)) { 0) { $query = ui_get_url_refresh (false); echo ''; @@ -68,14 +78,8 @@ if (empty($last_data)) { "; - echo __("Current data at"); - echo " "; - echo $last_timestamp; + echo __("Current data at %s", $last_timestamp); echo ""; if (is_image_data($last_data)) { echo '
image
'; diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 8d0a703584..e083cf4cc8 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -732,146 +732,50 @@ switch ($sortField) { break; } -switch ($config['dbtype']) { - case 'mysql': - $sql = 'SELECT - (SELECT GROUP_CONCAT(ttag.name SEPARATOR \',\') - FROM ttag - WHERE ttag.id_tag IN ( - SELECT ttag_module.id_tag - FROM ttag_module - WHERE ttag_module.id_agente_modulo = tagente_modulo.id_agente_modulo)) - AS tags, - tagente_modulo.id_agente_modulo, - tagente_modulo.id_modulo, - tagente.intervalo AS agent_interval, - tagente.alias AS agent_alias, - tagente.nombre AS agent_name, - tagente_modulo.nombre AS module_name, - tagente_modulo.history_data, - tagente_modulo.flag AS flag, - tagente.id_grupo AS id_group, - tagente.id_agente AS id_agent, - tagente_modulo.id_tipo_modulo AS module_type, - tagente_modulo.module_interval, - tagente_modulo.tcp_send, - tagente_modulo.ip_target, - tagente_modulo.snmp_community, - tagente_modulo.snmp_oid, - tagente_estado.datos, - tagente_estado.estado, - tagente_modulo.min_warning, - tagente_modulo.max_warning, - tagente_modulo.str_warning, - tagente_modulo.unit, - tagente_modulo.min_critical, - tagente_modulo.max_critical, - tagente_modulo.str_critical, - tagente_modulo.extended_info, - tagente_modulo.critical_inverse, - tagente_modulo.warning_inverse, - tagente_modulo.critical_instructions, - tagente_modulo.warning_instructions, - tagente_modulo.unknown_instructions, - tagente_estado.utimestamp AS utimestamp' . - $sql_from . $sql_conditions_all . ' - GROUP BY tagente_modulo.id_agente_modulo - ORDER BY ' . $order['field'] . " " . $order['order'] . ' - LIMIT '.$offset.",".$limit_sql; - break; - case 'postgresql': - if (strstr($config['dbversion'], "8.4") !== false) { - $string_agg = 'array_to_string(array_agg(ttag.name), \',\')'; - } - else { - $string_agg = 'STRING_AGG(ttag.name, \',\')'; - } - - $sql = 'SELECT - (SELECT ' . $string_agg . ' - FROM ttag - WHERE ttag.id_tag IN ( - SELECT ttag_module.id_tag - FROM ttag_module - WHERE ttag_module.id_agente_modulo = tagente_modulo.id_agente_modulo)) - AS tags, - tagente_modulo.id_agente_modulo, - tagente_modulo.id_modulo, - tagente.intervalo AS agent_interval, - tagente.alias AS agent_alias, - tagente.nombre AS agent_name, - tagente_modulo.nombre AS module_name, - tagente_modulo.history_data, - tagente_modulo.flag AS flag, - tagente.id_grupo AS id_group, - tagente.id_agente AS id_agent, - tagente_modulo.id_tipo_modulo AS module_type, - tagente_modulo.module_interval, - tagente_estado.datos, - tagente_estado.estado, - tagente_modulo.min_warning, - tagente_modulo.max_warning, - tagente_modulo.str_warning, - tagente_modulo.min_critical, - tagente_modulo.unit, - tagente_modulo.max_critical, - tagente_modulo.str_critical, - tagente_modulo.extended_info, - tagente_modulo.critical_inverse, - tagente_modulo.warning_inverse, - tagente_modulo.critical_instructions, - tagente_modulo.warning_instructions, - tagente_modulo.unknown_instructions, - tagente_estado.utimestamp AS utimestamp' . - $sql_from . - $sql_conditions_all . - ' LIMIT ' . $limit_sql . ' OFFSET ' . $offset; - break; - case 'oracle': - $set = array(); - $set['limit'] = $limit_sql; - $set['offset'] = $offset; - $sql = 'SELECT - (SELECT LISTAGG(ttag.name, \',\') WITHIN GROUP (ORDER BY ttag.name) - FROM ttag - WHERE ttag.id_tag IN ( - SELECT ttag_module.id_tag - FROM ttag_module - WHERE ttag_module.id_agente_modulo = tagente_modulo.id_agente_modulo)) - AS tags, - tagente_modulo.id_agente_modulo, - tagente_modulo.id_modulo, - tagente.intervalo AS agent_interval, - tagente.alias AS agent_alias, - tagente.nombre AS agent_name, - tagente_modulo.nombre AS module_name, - tagente_modulo.history_data, - tagente_modulo.flag AS flag, - tagente.id_grupo AS id_group, - tagente.id_agente AS id_agent, - tagente_modulo.id_tipo_modulo AS module_type, - tagente_modulo.module_interval, - tagente_estado.datos, - tagente_estado.estado, - tagente_modulo.min_warning, - tagente_modulo.max_warning, - tagente_modulo.str_warning, - tagente_modulo.unit, - tagente_modulo.min_critical, - tagente_modulo.max_critical, - tagente_modulo.str_critical, - tagente_modulo.extended_info, - tagente_modulo.critical_inverse, - tagente_modulo.warning_inverse, - tagente_modulo.critical_instructions, - tagente_modulo.warning_instructions, - tagente_modulo.unknown_instructions, - tagente_estado.utimestamp AS utimestamp' . - $sql_from . - $sql_conditions_all; - $sql = oracle_recode_query ($sql, $set); - break; -} +$sql = 'SELECT + (SELECT GROUP_CONCAT(ttag.name SEPARATOR \',\') + FROM ttag + WHERE ttag.id_tag IN ( + SELECT ttag_module.id_tag + FROM ttag_module + WHERE ttag_module.id_agente_modulo = tagente_modulo.id_agente_modulo)) + AS tags, + tagente_modulo.id_agente_modulo, + tagente_modulo.id_modulo, + tagente.intervalo AS agent_interval, + tagente.alias AS agent_alias, + tagente.nombre AS agent_name, + tagente_modulo.nombre AS module_name, + tagente_modulo.history_data, + tagente_modulo.flag AS flag, + tagente.id_grupo AS id_group, + tagente.id_agente AS id_agent, + tagente_modulo.id_tipo_modulo AS module_type, + tagente_modulo.module_interval, + tagente_modulo.tcp_send, + tagente_modulo.ip_target, + tagente_modulo.snmp_community, + tagente_modulo.snmp_oid, + tagente_estado.datos, + tagente_estado.estado, + tagente_modulo.min_warning, + tagente_modulo.max_warning, + tagente_modulo.str_warning, + tagente_modulo.unit, + tagente_modulo.min_critical, + tagente_modulo.max_critical, + tagente_modulo.str_critical, + tagente_modulo.extended_info, + tagente_modulo.critical_inverse, + tagente_modulo.warning_inverse, + tagente_modulo.critical_instructions, + tagente_modulo.warning_instructions, + tagente_modulo.unknown_instructions, + tagente_estado.utimestamp AS utimestamp' . + $sql_from . $sql_conditions_all . ' + GROUP BY tagente_modulo.id_agente_modulo + ORDER BY ' . $order['field'] . " " . $order['order'] . ' + LIMIT '.$offset.",".$limit_sql; if (! defined ('METACONSOLE')) { $result = db_get_all_rows_sql ($sql); @@ -1400,29 +1304,11 @@ if (!empty($result)) { if (($config['command_snapshot']) && ($is_snapshot || $is_large_image)) { $link = ui_get_snapshot_link( array( 'id_module' => $row['id_agente_modulo'], - 'last_data' => $row['datos'], - 'timestamp' => $row['timestamp'], 'interval' => $row['current_interval'], 'module_name' => $row['module_name'] )); - - if($is_large_image){ - $salida = '' . - html_print_image('images/default_list.png', true, - array('border' => '0', - 'alt' => '', - 'title' => __('Snapshot view'))) . '   '; - } - else { - $salida = '' . - html_print_image('images/photo.png', true, - array('border' => '0', - 'alt' => '', - 'title' => __('Snapshot view'))) . '   '; - } - } - else { - + $salida = ui_get_snapshot_image($link, $is_snapshot) . '  '; + } else { $sub_string = substr(io_safe_output($row['datos']), 0, 12); if ($module_value == $sub_string) { if ($module_value == 0 && !$sub_string) { From c3413bbf62279590b8f0fc54432c42c761bd0415 Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 2 Aug 2018 13:06:43 +0200 Subject: [PATCH 65/84] fixed minor error --- .../reporting/visual_console_favorite.php | 52 ++++++++++++++----- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_favorite.php b/pandora_console/godmode/reporting/visual_console_favorite.php index f447f76585..b04d06b028 100644 --- a/pandora_console/godmode/reporting/visual_console_favorite.php +++ b/pandora_console/godmode/reporting/visual_console_favorite.php @@ -22,6 +22,7 @@ $vconsoles_write = check_acl ($config['id_user'], 0, "VW"); $vconsoles_manage = check_acl ($config['id_user'], 0, "VM"); $is_enterprise = enterprise_include_once('include/functions_policies.php'); +$is_metaconsole = is_metaconsole(); if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { db_pandora_audit("ACL Violation", @@ -30,37 +31,55 @@ if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { exit; } +if(!$is_metaconsole){ + $url_visual_console = 'index.php?sec=network&sec2=godmode/reporting/map_builder'; + $url_visual_console_favorite = 'index.php?sec=network&sec2=godmode/reporting/visual_console_favorite'; + $url_visual_console_template = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template'; + $url_visual_console_template_wizard = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template_wizard'; +} +else{ + $url_visual_console = 'index.php?sec=screen&sec2=screens/screens&action=visualmap'; + $url_visual_console_favorite = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_favorite'; + $url_visual_console_template = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_template'; + $url_visual_console_template_wizard = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_wizard'; +} + $buttons['visual_console'] = array( 'active' => false, - 'text' => '' . + 'text' => '' . html_print_image ("images/visual_console.png", true, array ("title" => __('Visual Console List'))) .'' ); $buttons['visual_console_favorite'] = array( 'active' => true, - 'text' => '' . + 'text' => '' . html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .'' ); if($is_enterprise){ $buttons['visual_console_template'] = array( 'active' => false, - 'text' => '' . + 'text' => '' . html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' ); $buttons['visual_console_template_wizard'] = array( 'active' => false, - 'text' => '' . + 'text' => '' . html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' ); } -if (!defined('METACONSOLE')) { +if (!$is_metaconsole) { ui_print_page_header( __('Reporting') .' » ' . __('Visual Favourite Console'), "images/op_reporting.png", false, "map_builder", false, $buttons); } +else{ + ui_meta_print_header( + __('Visual console') . " » " . $visualConsoleName, "", + $buttons); +} $search = (string) get_parameter("search",""); $ag_group = (int) get_parameter("ag_group",0); @@ -72,7 +91,7 @@ if(!is_metaconsole()){ action='index.php?sec=network&sec2=godmode/reporting/visual_console_favorite'>"; } else { echo "
"; + action='index.php?sec=screen&sec2=screens/screens&action=visualmap_favorite'>"; } echo "
  • "; echo "
    • "; @@ -85,14 +104,14 @@ if(!is_metaconsole()){ $return_all_group = false; else $return_all_group = true; - html_print_select_groups(false, "AR", $return_all_group, "ag_group", - $ag_group, 'this.form.submit();', '', 0, false, + html_print_select_groups(false, "AR", $return_all_group, "ag_group", + $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false ); echo "
    • "; echo __('Group Recursion'); html_print_checkbox ("recursion", 1, $recursion, false, false, 'this.form.submit()'); - echo "
    • "; + echo "
    • "; echo ""; echo "
"; echo "
"; @@ -127,12 +146,17 @@ echo "
"; } else{ echo "
    "; - foreach( $favorite_array as $favorite_k => $favourite_v ){ - echo "
  • "; + foreach( $favorite_array as $favorite_k => $favourite_v ){ + if($is_metaconsole){ + $url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=0&id_visualmap='. $favourite_v["id"]; + } + else{ + $url = 'index.php?sec=network&sec2=operation/visual_console/render_view&id='. $favourite_v["id"]; + } + echo "
  • "; echo "
    "; - echo html_print_image ("images/groups_small/" . groups_get_icon($favourite_v["id_group"]).".png", - true, + echo html_print_image ("images/groups_small/" . groups_get_icon($favourite_v["id_group"]).".png", + true, array ("style" => '') ); echo "
    "; From c78ac2f4d54d26efea7bef6e1f759721f5afc0eb Mon Sep 17 00:00:00 2001 From: daniel Date: Thu, 2 Aug 2018 13:07:40 +0200 Subject: [PATCH 66/84] fixed minor error --- .../godmode/reporting/map_builder.php | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 5e9a64f75e..03e49e2769 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -23,6 +23,7 @@ $vconsoles_write = check_acl ($config['id_user'], 0, "VW"); $vconsoles_manage = check_acl ($config['id_user'], 0, "VM"); $is_enterprise = enterprise_include_once('include/functions_policies.php'); +$is_metaconsole = is_metaconsole(); if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { db_pandora_audit("ACL Violation", @@ -31,6 +32,19 @@ if (!$vconsoles_read && !$vconsoles_write && !$vconsoles_manage) { exit; } +if(!$is_metaconsole){ + $url_visual_console = 'index.php?sec=network&sec2=godmode/reporting/map_builder'; + $url_visual_console_favorite = 'index.php?sec=network&sec2=godmode/reporting/visual_console_favorite'; + $url_visual_console_template = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template'; + $url_visual_console_template_wizard = 'index.php?sec=network&sec2=enterprise/godmode/reporting/visual_console_template_wizard'; +} +else{ + $url_visual_console = 'index.php?sec=screen&sec2=screens/screens&action=visualmap'; + $url_visual_console_favorite = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_favorite'; + $url_visual_console_template = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_template'; + $url_visual_console_template_wizard = 'index.php?sec=screen&sec2=screens/screens&action=visualmap_wizard'; +} + $pure = (int)get_parameter('pure', 0); $hack_metaconsole = ''; if (defined('METACONSOLE')) @@ -38,31 +52,31 @@ if (defined('METACONSOLE')) $buttons['visual_console'] = array( 'active' => true, - 'text' => '
    ' . + 'text' => '' . html_print_image ("images/visual_console.png", true, array ("title" => __('Visual Console List'))) .'' ); $buttons['visual_console_favorite'] = array( 'active' => false, - 'text' => '' . + 'text' => '' . html_print_image ("images/list.png", true, array ("title" => __('Visual Favourite Console'))) .'' ); if($is_enterprise){ $buttons['visual_console_template'] = array( 'active' => false, - 'text' => '' . + 'text' => '' . html_print_image ("images/templates.png", true, array ("title" => __('Visual Console Template'))) .'' ); $buttons['visual_console_template_wizard'] = array( 'active' => false, - 'text' => '' . + 'text' => '' . html_print_image ("images/wand.png", true, array ("title" => __('Visual Console Template Wizard'))) .'' ); } -if (!defined('METACONSOLE')) { +if (!$is_metaconsole) { ui_print_page_header( __('Reporting') .' » ' . __('Visual Console'), "images/op_reporting.png", @@ -72,6 +86,11 @@ if (!defined('METACONSOLE')) { $buttons ); } +else{ + ui_meta_print_header( + __('Visual console') . " » " . $visualConsoleName, "", + $buttons); +} $id_layout = (int) get_parameter ('id_layout'); $copy_layout = (bool) get_parameter ('copy_layout'); From 7b22caaea8182f094ff5ebde228972d9efa30b76 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 2 Aug 2018 13:41:56 +0200 Subject: [PATCH 67/84] Fixed warning --- pandora_console/include/functions_agents.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index a5e61f6d07..c80f1a634a 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -1739,7 +1739,8 @@ function agents_get_status($id_agent = 0, $noACLs = false) { // Get all non disabled modules of the agent $all_modules = db_get_all_rows_filter('tagente_modulo', $filter_modules, 'id_agente_modulo'); - + if ($all_modules === false) $all_modules = array(); + $result_modules = array(); // Skip non init modules foreach ($all_modules as $module) { From c1269ca23fc5eee7d3e77add4c16d891bf834327 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 2 Aug 2018 13:42:39 +0200 Subject: [PATCH 68/84] Refactorized snapshot link on meta --- pandora_console/include/functions_treeview.php | 3 ++- pandora_console/operation/agentes/snapshot_view.php | 2 +- pandora_console/operation/agentes/status_monitor.php | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 0315509b0f..20d1f577bc 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -273,7 +273,8 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head = $link = ui_get_snapshot_link( array( 'id_module' => $module['id_agente_modulo'], 'interval' => $module['current_interval'], - 'module_name' => $module['module_name'] + 'module_name' => $module['module_name'], + 'id_node' => empty($server_id) ? 0 : $server_id )); $salida = ui_get_snapshot_image($link, $is_snapshot) . '  '; } diff --git a/pandora_console/operation/agentes/snapshot_view.php b/pandora_console/operation/agentes/snapshot_view.php index 07eda62a3e..a707aaab5e 100644 --- a/pandora_console/operation/agentes/snapshot_view.php +++ b/pandora_console/operation/agentes/snapshot_view.php @@ -43,7 +43,7 @@ $id_node = get_parameter("id_node", 0); // Get the data if ($id_node > 0) { - $connection = metaconsole_get_connection_by_id($server_name); + $connection = metaconsole_get_connection_by_id($id_node); if (metaconsole_load_external_db($connection) != NOERR) { echo "Node connection fail"; exit; diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index e083cf4cc8..a8b2982e37 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -1305,7 +1305,8 @@ if (!empty($result)) { $link = ui_get_snapshot_link( array( 'id_module' => $row['id_agente_modulo'], 'interval' => $row['current_interval'], - 'module_name' => $row['module_name'] + 'module_name' => $row['module_name'], + 'id_node' => $row['server_id'] )); $salida = ui_get_snapshot_image($link, $is_snapshot) . '  '; } else { From 5e6eca8e5109f5a29bcc20331fc6e40ff839f58a Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 2 Aug 2018 14:32:12 +0200 Subject: [PATCH 69/84] Added ACL to snapshot view --- pandora_console/operation/agentes/snapshot_view.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/agentes/snapshot_view.php b/pandora_console/operation/agentes/snapshot_view.php index a707aaab5e..497c2dc803 100644 --- a/pandora_console/operation/agentes/snapshot_view.php +++ b/pandora_console/operation/agentes/snapshot_view.php @@ -28,7 +28,7 @@ require_once ($config['homedir'] . '/include/functions_graph.php'); require_once ($config['homedir'] . '/include/functions_modules.php'); require_once ($config['homedir'] . '/include/functions_agents.php'); require_once ($config['homedir'] . '/include/functions_tags.php'); -enterprise_include_once ('include/functions_metaconsole'); +enterprise_include_once('include/functions_agents.php'); check_login (); @@ -45,12 +45,13 @@ $id_node = get_parameter("id_node", 0); if ($id_node > 0) { $connection = metaconsole_get_connection_by_id($id_node); if (metaconsole_load_external_db($connection) != NOERR) { - echo "Node connection fail"; + ui_print_error_message(__('Cannot connect with node to display the module data.')); exit; } } $row_module = modules_get_agentmodule($id); $row_state = db_get_row('tagente_estado', 'id_agente_modulo', $id); + if ($id_node > 0) { metaconsole_restore_db(); } @@ -61,7 +62,12 @@ $last_timestamp = get_parameter("timestamp", $row_state['timestamp']); $last_data = io_safe_output($row_state["datos"]); $refresh = (int) get_parameter ("refr", $row_state['current_interval']); -// TODO - Put ACL here +// ACL check +$all_groups = agents_get_all_groups_agent ($row_state['id_agente']); +if (!check_acl_one_of_groups($config['id_user'], $all_groups, "AR")) { + require ($config['homedir'] . "/general/noaccess.php"); + exit; +} ?> From 568484cf6eb6552eb45f28089c3053698d44cfa7 Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Thu, 2 Aug 2018 14:59:10 +0200 Subject: [PATCH 70/84] Fixed the incremental mode of the realtime charts and overall improvements --- .../extensions/realtime_graphs.php | 6 +- .../realtime_graphs/realtime_graphs.js | 354 +++++++++--------- 2 files changed, 177 insertions(+), 183 deletions(-) diff --git a/pandora_console/extensions/realtime_graphs.php b/pandora_console/extensions/realtime_graphs.php index 1a8e17965d..5f6bca2c93 100644 --- a/pandora_console/extensions/realtime_graphs.php +++ b/pandora_console/extensions/realtime_graphs.php @@ -125,7 +125,7 @@ function pandora_realtime_graphs () { if ($graph != 'snmp_module') { $data['incremental'] = __('Incremental') . '  ' . html_print_checkbox ('incremental', 1, 0, true); } - $data['reset'] = html_print_button(__('Clear graph'), 'reset', false, 'clearGraph()', 'class="sub delete" style="margin-top:0px;"', true); + $data['reset'] = html_print_button(__('Clear graph'), 'reset', false, 'javascript:realtimeGraphs.clearGraph();', 'class="sub delete" style="margin-top:0px;"', true); $table->data[] = $data; if ($graph == 'snmp_interface' || $graph == 'snmp_module') { @@ -154,7 +154,7 @@ function pandora_realtime_graphs () { $table->colspan[2]['snmp_oid'] = 2; $data['snmp_ver'] = __('Version') . '  ' . html_print_select ($snmp_versions, 'snmp_version', $snmp_ver, '', '', 0, true); - $data['snmp_ver'] .= '  ' . html_print_button (__('SNMP walk'), 'snmp_walk', false, 'snmpBrowserWindow()', 'class="sub next"', true); + $data['snmp_ver'] .= '  ' . html_print_button (__('SNMP walk'), 'snmp_walk', false, 'javascript:realtimeGraphs.snmpBrowserWindow();', 'class="sub next"', true); $table->colspan[2]['snmp_ver'] = 2; $table->data[] = $data; @@ -176,7 +176,7 @@ function pandora_realtime_graphs () { echo ''; // Define a custom action to save the OID selected in the SNMP browser to the form - html_print_input_hidden ('custom_action', urlencode (base64_encode(' ')), false); + html_print_input_hidden ('custom_action', urlencode (base64_encode(' ')), false); html_print_input_hidden ('incremental_base', '0'); echo ''; diff --git a/pandora_console/extensions/realtime_graphs/realtime_graphs.js b/pandora_console/extensions/realtime_graphs/realtime_graphs.js index 6c535f2e5d..c909fc5b01 100644 --- a/pandora_console/extensions/realtime_graphs/realtime_graphs.js +++ b/pandora_console/extensions/realtime_graphs/realtime_graphs.js @@ -1,192 +1,186 @@ -var max_data_plot = 100; +(function () { + var numberOfPoints = 100; + var refresh = parseInt($('#refresh').val()); + var incremental = $('#checkbox-incremental').is(':checked') || $('#hidden-incremental').val() == 1; + var lastIncVal = null; + var intervalRef = null; + var currentXHR = null; -var options = { - legend: { container: $("#chartLegend") }, - xaxis: { - tickFormatter: function (timestamp, axis) { - var date = new Date(timestamp * 1000); - - var server_timezone_offset = get_php_value('timezone_offset'); - var local_timezone_offset = date.getTimezoneOffset()*60*-1; - - if (server_timezone_offset != local_timezone_offset) { - // If timezone of server and client is different, adjust the time to the server - date = new Date((timestamp + (server_timezone_offset - local_timezone_offset)) * 1000); + var plot; + var plotOptions = { + legend: { container: $("#chartLegend") }, + xaxis: { + tickFormatter: function (timestamp, axis) { + var date = new Date(timestamp * 1000); + + var server_timezone_offset = get_php_value('timezone_offset'); + var local_timezone_offset = date.getTimezoneOffset()*60*-1; + + if (server_timezone_offset != local_timezone_offset) { + // If timezone of server and client is different, adjust the time to the server + date = new Date((timestamp + (server_timezone_offset - local_timezone_offset)) * 1000); + } + + var hours = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()); + var minutes = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()); + var seconds = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()); + var formattedTime = hours + ':' + minutes + ':' + seconds; + return formattedTime; + } + }, + series: { + lines: { + lineWidth: 2, + fill: true + } + }, + colors: ['#6db431'] + }; + + function updatePlot (data) { + plot = $.plot($('.graph'), data, plotOptions); + } + + function requestData () { + var rel_path = $("#hidden-rel_path").val(); + + currentXHR = $.ajax({ + url: rel_path + "extensions/realtime_graphs/ajax.php", + type: "POST", + dataType: "json", + data: { + graph: $('#graph :selected').val(), + graph_title: $('#graph :selected').html(), + snmp_community: $('#text-snmp_community').val(), + snmp_oid: $('#text-snmp_oid').val(), + snmp_ver: $('#snmp_version :selected').val(), + snmp_address: $('#text-ip_target').val(), + refresh: refresh + }, + success: function (serie) { + var timestamp = serie.data[0][0]; + var data = plot.getData(); + + if (data.length === 0) { + for (i = 0; i < numberOfPoints; i++) { + var step = i * (refresh / 1000); + serie.data.unshift([timestamp - step, 0]); } - var hours = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()); - var minutes = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()); - var seconds = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()); - var formattedTime = hours + ':' + minutes + ':' + seconds; - return formattedTime; + serie = [serie]; + updatePlot(serie); + return; } + + data[0].label = serie.label; + if (data[0].data.length >= numberOfPoints) { + data[0].data.shift(); + } + + if (incremental) { + var currentVal = serie.data[0][1]; + // Try to avoid the first value, cause we need at least two values to get the increment + serie.data[0][1] = lastIncVal == null ? 0 : currentVal - lastIncVal; + // Incremental is always positive + if (serie.data[0][1] < 0) serie.data[0][1] = 0; + // Store the current value to use it into the next request + lastIncVal = currentVal; + } + + data[0].data.push(serie.data[0]); + updatePlot(data); + } + }); + } + + function startDataPooling () { + intervalRef = window.setInterval(requestData, refresh); + } + + function resetDataPooling () { + if (currentXHR !== null) currentXHR.abort(); + // Stop and start the interval + window.clearInterval(intervalRef); + startDataPooling(); + } + + function clearGraph () { + var data = plot.getData(); + if (data.length === 0) return; + + for (i = 0; i < data[0].data.length; i ++) { + data[0].data[i][1] = 0; + } + if (incremental) lastIncVal = null; + + updatePlot(data); + + resetDataPooling(); + } + + // Set the form OID to the value selected in the SNMP browser + function setOID () { + if ($('#snmp_browser_version').val() == '3') { + $('#text-snmp_oid').val($('#table1-0-1').text()); + } else { + $('#text-snmp_oid').val($('#snmp_selected_oid').text()); + } + + // Close the SNMP browser + $('.ui-dialog-titlebar-close').trigger('click'); + } + + // Show the SNMP browser window + function snmpBrowserWindow () { + + // Keep elements in the form and the SNMP browser synced + $('#text-target_ip').val($('#text-ip_target').val()); + $('#text-community').val($('#text-snmp_community').val()); + $('#snmp_browser_version').val($('#snmp_version').val()); + $('#snmp3_browser_auth_user').val($('#snmp3_auth_user').val()); + $('#snmp3_browser_security_level').val($('#snmp3_security_level').val()); + $('#snmp3_browser_auth_method').val($('#snmp3_auth_method').val()); + $('#snmp3_browser_auth_pass').val($('#snmp3_auth_pass').val()); + $('#snmp3_browser_privacy_method').val($('#snmp3_privacy_method').val()); + $('#snmp3_browser_privacy_pass').val($('#snmp3_privacy_pass').val()); + + $("#snmp_browser_container").show().dialog ({ + title: '', + resizable: true, + draggable: true, + modal: true, + overlay: { + opacity: 0.5, + background: "black" }, - series: { - lines: { - lineWidth: 2, - fill: true - } - }, - colors: ['#6db431'] - } + width: 920, + height: 500 + }); + } -var data = []; - -var id = $('.graph').attr('id'); -var plot = $.plot("#" + id, data, options); - - -var refresh = parseInt($('#refresh').val()); -var incremental = $('#checkbox-incremental').is(':checked') || $('#hidden-incremental').val() == 1; -var incremental_base = 0; -var last_inc = 0; -var to; - -refresh_graph(); - -function refresh_graph () { - var refresh = parseInt($('#refresh').val()); - - var postvars = new Array(); - var postvars = {}; - postvars['graph'] = $('#graph :selected').val(); - postvars['graph_title'] = $('#graph :selected').html(); - - postvars['snmp_community'] = $('#text-snmp_community').val(); - postvars['snmp_oid'] = $('#text-snmp_oid').val(); - postvars['snmp_ver'] = $('#snmp_version :selected').val(); - postvars['snmp_address'] = $('#text-ip_target').val(); - - postvars['refresh'] = refresh; - - var rel_path = $("#hidden-rel_path").val(); - - $.ajax({ - url: rel_path + "extensions/realtime_graphs/ajax.php", - type: "POST", - dataType: "json", - data: postvars, - success: function(serie) { - var timestamp = serie.data[0][0]; - data = plot.getData(); - if (data.length == 0) { - for(i = 0; i < max_data_plot; i ++) { - step = i * (refresh/1000); - serie.data.unshift([timestamp-step, 0]); - } - - serie = [serie]; - plot = $.plot("#" + id, serie, options); - return; - } - data[0].label = serie.label; - if (data[0].data.length >= max_data_plot) { - data[0].data.shift(); - } - - if (incremental) { - var last_item = parseInt(data[0].data.length)-1; - var last_value = data[0].data[last_item][1]; - - var current_value = serie.data[0][1]; - - serie.data[0][1] = current_value - last_inc; - - last_inc = current_value; - - // Incremental is always positive - if (serie.data[0][1] < 0) { - serie.data[0][1] = 0; - } - } - - data[0].data.push(serie.data[0]); - $.plot("#" + id, data, options); - } + $('#graph').change(function() { + $('form#realgraph').submit(); }); - to = window.setTimeout(refresh_graph, refresh); -} -$('#graph').change(function() { - $('form#realgraph').submit(); -}); - -$('#refresh').change(function() { - var refresh = parseInt($('#refresh').val()); - - // Stop and start the Timeout - clearTimeout(to); - to = window.setTimeout(refresh_graph, refresh); -}); - -// Show the SNMP browser window -function snmpBrowserWindow () { - - // Keep elements in the form and the SNMP browser synced - $('#text-target_ip').val($('#text-ip_target').val()); - $('#text-community').val($('#text-snmp_community').val()); - $('#snmp_browser_version').val($('#snmp_version').val()); - $('#snmp3_browser_auth_user').val($('#snmp3_auth_user').val()); - $('#snmp3_browser_security_level').val($('#snmp3_security_level').val()); - $('#snmp3_browser_auth_method').val($('#snmp3_auth_method').val()); - $('#snmp3_browser_auth_pass').val($('#snmp3_auth_pass').val()); - $('#snmp3_browser_privacy_method').val($('#snmp3_privacy_method').val()); - $('#snmp3_browser_privacy_pass').val($('#snmp3_privacy_pass').val()); - - $("#snmp_browser_container").show().dialog ({ - title: '', - resizable: true, - draggable: true, - modal: true, - overlay: { - opacity: 0.5, - background: "black" - }, - width: 920, - height: 500 + $('#refresh').change(function () { + refresh = parseInt($('#refresh').val()); + resetDataPooling(); }); -} -// Set the form OID to the value selected in the SNMP browser -function setOID () { - - if($('#snmp_browser_version').val() == '3'){ - $('#text-snmp_oid').val($('#table1-0-1').text()); - } else { - $('#text-snmp_oid').val($('#snmp_selected_oid').text()); + $('#checkbox-incremental').change(function() { + incremental = $('#checkbox-incremental').is(':checked'); + clearGraph(); + }); + + updatePlot([]); + requestData(); + startDataPooling(); + + // Expose this functions + window.realtimeGraphs = { + clearGraph: clearGraph, + setOID: setOID, + snmpBrowserWindow: snmpBrowserWindow } - - // Close the SNMP browser - $('.ui-dialog-titlebar-close').trigger('click'); -} -$('#checkbox-incremental').change(function() { - incremental = $('#checkbox-incremental').is(':checked'); - clearGraph(); -}); - -function firstNotZero(data) { - var notZero = 0; - for(i = 0; i < data[0].data.length; i ++) { - if (data[0].data[i][1] != 0) { - return data[0].data[i][1]; - } - } -} - -function setOnIncremental() { - -} - -function clearGraph() { - data = plot.getData(); - if (data.length == 0) { - return; - } - - for(i = 0; i < data[0].data.length; i ++) { - data[0].data[i][1] = 0; - } - - $.plot("#" + id, data, options); -} +})(); \ No newline at end of file From d0b5d6ae2967024972bde0da30fc8711345ebcf8 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Thu, 2 Aug 2018 14:59:52 +0200 Subject: [PATCH 71/84] Fixed XML inside logs in grep_log plugins --- pandora_agents/unix/plugins/grep_log | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pandora_agents/unix/plugins/grep_log b/pandora_agents/unix/plugins/grep_log index ad45ab2943..2e17210a51 100755 --- a/pandora_agents/unix/plugins/grep_log +++ b/pandora_agents/unix/plugins/grep_log @@ -325,7 +325,9 @@ sub print_log ($) { $output .= "\n"; $output .= "{$line}; + my $processed_line = $line; + $processed_line =~ s/\]\]/]]]]>"; $output .= "\n"; @@ -343,7 +345,9 @@ sub print_log ($) { foreach my $line (@kdata) { $output .= "{$line}}) { - $output .= $content; + my $processed_line = $content; + $processed_line =~ s/\]\]/]]]]>\n"; } From f5304af062ab12d18f908712a1ab1f2ec4e072cd Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Thu, 2 Aug 2018 14:59:56 +0200 Subject: [PATCH 72/84] Removed unused code which was causing an error --- pandora_console/include/graphs/flot/pandora.flot.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index 226d911d6d..9cd3636561 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -2342,8 +2342,6 @@ function pandoraFlotArea( graph_id, values, legend, // Add bottom margin in the legend // Estimated height of 24 (works fine with this data in all browsers) menu_height = 24; - var legend_margin_bottom = parseInt( - $('#legend_'+graph_id).css('margin-bottom').split('px')[0]); $('#legend_'+graph_id).css('margin-bottom', '10px'); parent_height = parseInt($('#menu_'+graph_id).parent().css('height').split('px')[0]); adjust_menu(graph_id, plot, parent_height, width, show_legend); From 392b5bc93545a1e66eac0d35eec5afea000b23bb Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 3 Aug 2018 00:01:25 +0200 Subject: [PATCH 73/84] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 303d31244c..1ea68c6c86 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.725-180802 +Version: 7.0NG.725-180803 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 51851bbb59..b1bf94ff72 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.725-180802" +pandora_version="7.0NG.725-180803" 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 ab52d5b0db..eecbdc4db9 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.725'; -use constant AGENT_BUILD => '180802'; +use constant AGENT_BUILD => '180803'; # 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 41e554020a..eef9535ce5 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.725 -%define release 180802 +%define release 180803 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 6c40f61437..c581cc3f99 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.725 -%define release 180802 +%define release 180803 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 2a6539aa15..2d324e6ef9 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180802" +PI_BUILD="180803" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index b2cbfaa99f..65db3b1ffb 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180802} +{180803} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index ab8a5827ef..7897437210 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.725(Build 180802)") +#define PANDORA_VERSION ("7.0NG.725(Build 180803)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 3a3acbb021..558dc27d0d 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.725(Build 180802))" + VALUE "ProductVersion", "(7.0NG.725(Build 180803))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 2583d101af..fec3f52d7a 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.725-180802 +Version: 7.0NG.725-180803 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 f25856ed6f..204d5a23d5 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.725-180802" +pandora_version="7.0NG.725-180803" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 8f9e840c88..d7dec7ab36 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 = 'PC180802'; +$build_version = 'PC180803'; $pandora_version = 'v7.0NG.725'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 5bea2f8461..e25f835183 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index b24f79ad8d..2e5c073341 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180802 +%define release 180803 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index e13fa6d836..15d449f8d9 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180802 +%define release 180803 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 5022764a47..3be6386e3e 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180802" +PI_BUILD="180803" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index d0fd3bf0de..916c20e41b 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.725 PS180802"; +my $version = "7.0NG.725 PS180803"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 966350eba2..cb2651b79d 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.725 PS180802"; +my $version = "7.0NG.725 PS180803"; # save program name for logging my $progname = basename($0); From 06c436e5bf9ee5d89e86e861d027d1736fabe287 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 3 Aug 2018 10:01:04 +0200 Subject: [PATCH 74/84] add new tocken zoom graph visual styles --- pandora_console/godmode/setup/setup_visuals.php | 12 ++++++++++++ pandora_console/include/functions_config.php | 3 +++ pandora_console/include/functions_graph.php | 2 +- .../agentes/interface_traffic_graph_win.php | 2 +- pandora_console/operation/agentes/stat_win.php | 2 +- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/pandora_console/godmode/setup/setup_visuals.php b/pandora_console/godmode/setup/setup_visuals.php index 5d4f0f664a..bdca26e56d 100755 --- a/pandora_console/godmode/setup/setup_visuals.php +++ b/pandora_console/godmode/setup/setup_visuals.php @@ -696,6 +696,18 @@ $options_soft_graphs[1] = __('Classic mode'); $table_chars->data[$row][1] = html_print_select($options_soft_graphs, 'type_mode_graph', $config["type_mode_graph"], '', '', 0, true, false, false); $row++; +$table_chars->data[$row][0] = __('Zoom graphs:'); + +$options_zoom_graphs = array(); +$options_zoom_graphs[1] = 'x1'; +$options_zoom_graphs[2] = 'x2'; +$options_zoom_graphs[3] = 'x3'; +$options_zoom_graphs[4] = 'x4'; +$options_zoom_graphs[5] = 'x5'; + +$table_chars->data[$row][1] = html_print_select($options_zoom_graphs, 'zoom_graph', $config["zoom_graph"], '', '', 0, true, false, false); +$row++; + $table_chars->data[$row][0] = __('Graph image height'); $table_chars->data[$row][1] = html_print_input_text ('graph_image_height', $config['graph_image_height'], '', 20, 20, true); $row++; diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index fcfdf925c8..7fcee364f3 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -631,6 +631,9 @@ function config_update_config () { if (!config_update_value ('type_mode_graph', (int) get_parameter('type_mode_graph', 0))) $error_update[] = __('Default soft graphs'); + if (!config_update_value ('zoom_graph', (int) get_parameter('zoom_graph', 0))) + $error_update[] = __('Default zoom graphs'); + if (!config_update_value ('graph_image_height', (int) get_parameter('graph_image_height', 0))) $error_update[] = __('Default height of the chart image'); diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index cbee30c35f..9af0c620cf 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -892,7 +892,7 @@ function grafico_modulo_sparse ($params) { } if(!isset($params['zoom'])){ - $params['zoom'] = 1; + $params['zoom'] = $config['zoom_graph']; } if(!isset($params['type_mode_graph'])){ diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index 3273dc4069..94251a380a 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -121,7 +121,7 @@ $interface_traffic_modules = array( $height = (int) get_parameter("height", 245); $start_date = (string) get_parameter("start_date", date("Y-m-d")); $start_time = get_parameter ("start_time", date("H:i:s")); - $zoom = (int) get_parameter ("zoom", 1); + $zoom = (int) get_parameter ("zoom", $config['zoom_graph']); $baseline = get_parameter ("baseline", 0); $show_percentil = get_parameter ("show_percentil", 0); $fullscale = get_parameter("fullscale"); diff --git a/pandora_console/operation/agentes/stat_win.php b/pandora_console/operation/agentes/stat_win.php index 54bfbe716c..6b98cc931c 100644 --- a/pandora_console/operation/agentes/stat_win.php +++ b/pandora_console/operation/agentes/stat_win.php @@ -129,7 +129,7 @@ $alias = db_get_value ("alias","tagente","id_agente",$id_agent); $start_time = get_parameter ("start_time", date("H:i:s")); $draw_events = get_parameter ("draw_events", 0); $graph_type = get_parameter ("type", "sparse"); - $zoom = get_parameter ("zoom", 1); + $zoom = get_parameter ("zoom", $config['zoom_graph']); $baseline = get_parameter ("baseline", 0); $show_events_graph = get_parameter ("show_events_graph", 0); $show_percentil = get_parameter ("show_percentil", 0); From 097661d82bf1318aaf967e5fb71446cfea26938d Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Fri, 3 Aug 2018 10:38:53 +0200 Subject: [PATCH 75/84] implemented sort filter to event view custom fields --- pandora_console/include/functions_events.php | 93 ++++++++++++++++++- .../operation/events/events.build_table.php | 45 ++++----- 2 files changed, 116 insertions(+), 22 deletions(-) diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 3a4b5eeebf..e8955d2c81 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -161,7 +161,8 @@ function events_get_events_grouped($sql_post, $offset = 0, (SELECT id_usuario FROM $table WHERE id_evento = MAX(te.id_evento)) id_usuario, (SELECT id_agente FROM $table WHERE id_evento = MAX(te.id_evento)) id_agente, (SELECT criticity FROM $table WHERE id_evento = MAX(te.id_evento)) AS criticity, - (SELECT ack_utimestamp FROM $table WHERE id_evento = MAX(te.id_evento)) AS ack_utimestamp + (SELECT ack_utimestamp FROM $table WHERE id_evento = MAX(te.id_evento)) AS ack_utimestamp, + (SELECT nombre FROM tagente_modulo WHERE id_agente_modulo = te.id_agentmodule) AS module_name FROM $table te LEFT JOIN tagent_secondary_group tasg ON te.id_grupo = tasg.id_group WHERE 1=1 " . $sql_post . " GROUP BY estado, evento, id_agente, id_agentmodule" . $groupby_extra . " @@ -181,6 +182,12 @@ function events_get_events_grouped($sql_post, $offset = 0, if ($order=='down') $sql .= "evento" . " DESC"; break; + case 'event_id': + if ($order=='up') + $sql .= "id_evento" . " ASC"; + if ($order=='down') + $sql .= "id_evento" . " DESC"; + break; case 'status': if ($order=='up') $sql .= "estado" . " ASC"; @@ -199,6 +206,90 @@ function events_get_events_grouped($sql_post, $offset = 0, if ($order=='down') $sql .= "timestamp_rep" . " DESC"; break; + case 'user_id': + if ($order=='up') + $sql .= "id_usuario" . " ASC"; + if ($order=='down') + $sql .= "id_usuario" . " DESC"; + break; + case 'owner': + if ($order=='up') + $sql .= "owner_user" . " ASC"; + if ($order=='down') + $sql .= "owner_user" . " DESC"; + break; + case 'group_id': + if ($order=='up') + $sql .= "id_grupo" . " ASC"; + if ($order=='down') + $sql .= "id_grupo" . " DESC"; + break; + case 'module_name': + if ($order=='up') + $sql .= "module_name" . " ASC"; + if ($order=='down') + $sql .= "module_name" . " DESC"; + break; + case 'event_type': + if ($order=='up') + $sql .= "event_type" . " ASC"; + if ($order=='down') + $sql .= "event_type" . " DESC"; + break; + case 'alert_id': + if ($order=='up') + $sql .= "id_alert_am" . " ASC"; + if ($order=='down') + $sql .= "id_alert_am" . " DESC"; + break; + case 'criticity': + if ($order=='up') + $sql .= "criticity" . " ASC"; + if ($order=='down') + $sql .= "criticity" . " DESC"; + break; + case 'comment': + if ($order=='up') + $sql .= "user_comment" . " ASC"; + if ($order=='down') + $sql .= "user_comment" . " DESC"; + break; + case 'tags': + if ($order=='up') + $sql .= "tags" . " ASC"; + if ($order=='down') + $sql .= "tags" . " DESC"; + break; + case 'source': + if ($order=='up') + $sql .= "source" . " ASC"; + if ($order=='down') + $sql .= "source" . " DESC"; + break; + case 'extra_id': + if ($order=='up') + $sql .= "id_extra" . " ASC"; + if ($order=='down') + $sql .= "id_extra" . " DESC"; + break; + case 'ack_timestamp': + if ($order=='up') + $sql .= "ack_utimestamp" . " ASC"; + if ($order=='down') + $sql .= "ack_utimestamp" . " DESC"; + break; + case 'data': + if ($order=='up') + $sql .= "data" . " ASC"; + if ($order=='down') + $sql .= "data" . " DESC"; + break; + case 'module_status': + if ($order=='up') + $sql .= "module_status" . " ASC"; + if ($order=='down') + $sql .= "module_status" . " DESC"; + break; default: $sql .= "timestamp_rep" . " DESC"; } diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index 55e6e748ef..ff2c030e80 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -17,6 +17,9 @@ global $config; require_once ($config["homedir"] . "/include/functions_ui.php"); +$sort_field = get_parameter("sort_field", "timestamp"); +$sort = get_parameter("sort", "down"); + $table = new stdClass(); if(!isset($table->width)) { @@ -130,7 +133,7 @@ else { //headers $i = 0; - $table->head[$i] = __('ID') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('ID') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; @@ -141,104 +144,104 @@ else { $i++; } if (in_array('estado', $show_fields)) { - $table->head[$i] = __('Status') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Status') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } if (in_array('id_evento', $show_fields)) { - $table->head[$i] = __('Event ID'); + $table->head[$i] = __('Event ID') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } if (in_array('evento', $show_fields)) { - $table->head[$i] = __('Event Name') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Event Name') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $table->style[$i] = 'min-width: 200px; max-width: 350px; word-break: break-all;'; $i++; } if (in_array('id_agente', $show_fields)) { - $table->head[$i] = __('Agent name') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Agent name') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $table->style[$i] = 'max-width: 350px; word-break: break-all;'; $i++; } if (in_array('timestamp', $show_fields)) { - $table->head[$i] = __('Timestamp') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; + $table->head[$i] = __('Timestamp') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } if (in_array('id_usuario', $show_fields)) { - $table->head[$i] = __('User'); + $table->head[$i] = __('User') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } if (in_array('owner_user', $show_fields)) { - $table->head[$i] = __('Owner'); + $table->head[$i] = __('Owner') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } if (in_array('id_grupo', $show_fields)) { - $table->head[$i] = __('Group'); + $table->head[$i] = __('Group') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } if (in_array('event_type', $show_fields)) { - $table->head[$i] = __('Event Type'); + $table->head[$i] = __('Event Type') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $table->style[$i] = 'min-width: 85px;'; $i++; } if (in_array('id_agentmodule', $show_fields)) { - $table->head[$i] = __('Module Name'); + $table->head[$i] = __('Module Name') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } if (in_array('id_alert_am', $show_fields)) { - $table->head[$i] = __('Alert'); + $table->head[$i] = __('Alert') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } if (in_array('criticity', $show_fields)) { - $table->head[$i] = __('Severity'); + $table->head[$i] = __('Severity') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } if (in_array('user_comment', $show_fields)) { - $table->head[$i] = __('Comment'); + $table->head[$i] = __('Comment') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } if (in_array('tags', $show_fields)) { - $table->head[$i] = __('Tags'); + $table->head[$i] = __('Tags') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } if (in_array('source', $show_fields)) { - $table->head[$i] = __('Source'); + $table->head[$i] = __('Source') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } if (in_array('id_extra', $show_fields)) { - $table->head[$i] = __('Extra ID'); + $table->head[$i] = __('Extra ID') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } if (in_array('ack_utimestamp', $show_fields)) { - $table->head[$i] = __('ACK Timestamp'); + $table->head[$i] = __('ACK Timestamp') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; @@ -250,13 +253,13 @@ else { $i++; } if (in_array('data', $show_fields)) { - $table->head[$i] = __('Data'); + $table->head[$i] = __('Data') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . ''; $table->align[$i] = 'left'; $i++; } if (in_array('module_status', $show_fields)) { - $table->head[$i] = __('Module Status'); + $table->head[$i] = __('Module Status') . ' ' . '' . html_print_image("images/sort_up.png", true, array("style" => $selectNameUp)) . '' . '' . html_print_image("images/sort_down.png", true, array("style" => $selectNameDown)) . '';; $table->align[$i] = 'left'; $i++; @@ -769,7 +772,7 @@ else { if (!empty ($table->data)) { if ($allow_pagination) { - ui_pagination ($total_events, $url, $offset, $pagination); + ui_pagination ($total_events, "index.php?sec=eventos&sec2=operation/events/events&sort_field=$sort_field&sort=$sort&disabled=$disabled", $offset, $pagination); } if ($allow_action) { From a9e162a199080c7eae46ebb965acb174102e009e Mon Sep 17 00:00:00 2001 From: danielmaya Date: Fri, 3 Aug 2018 10:49:01 +0200 Subject: [PATCH 76/84] Fixed create services --- pandora_console/include/functions_modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 71d98a8d2e..58b66ffee1 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -476,7 +476,7 @@ function modules_create_agent_module ($id_agent, $name, $values = false, $disabl global $config; if (!$disableACL) { - if (empty ($id_agent) || ! users_access_to_agent ($id_agent, 'AW')) + if (!users_is_admin() && (empty ($id_agent) || ! users_access_to_agent ($id_agent, 'AW'))) return false; } From 4bab741454b5a8d999f63c7056272aae2590c4c3 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 3 Aug 2018 11:58:45 +0200 Subject: [PATCH 77/84] fixed error in visual console width and heigth custom graph --- pandora_console/include/functions_graph.php | 37 ++++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 9af0c620cf..24b3693533 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1501,7 +1501,6 @@ function graphic_combined_module ( //XXX arreglar estas $long_index = ''; - switch ($params_combined['stacked']) { default: case CUSTOM_GRAPH_STACKED_LINE: @@ -1734,6 +1733,8 @@ function graphic_combined_module ( break; case CUSTOM_GRAPH_BULLET_CHART_THRESHOLD: case CUSTOM_GRAPH_BULLET_CHART: + $number_elements = count($module_list); + if($params_combined['stacked'] == CUSTOM_GRAPH_BULLET_CHART_THRESHOLD){ $acumulador = 0; foreach ($module_list as $module_item) { @@ -1823,8 +1824,13 @@ function graphic_combined_module ( $graph_values = $temp; - $width = 1024; - $height = 50; + if(!$params['vconsole']){ + $width = 1024; + $height = 50; + } + else{ + $height = $height/$number_elements; + } $color = color_graph_array(); @@ -1851,6 +1857,7 @@ function graphic_combined_module ( case CUSTOM_GRAPH_GAUGE: $i = 0; + $number_elements = count($module_list); foreach ($module_list as $module_item) { $automatic_custom_graph_meta = false; if ($config['metaconsole']) { @@ -1918,8 +1925,14 @@ function graphic_combined_module ( $color = color_graph_array(); - $width = 200; - $height = 200; + if(!$params['vconsole']){ + $width = 200; + $height = 200; + } + else{ + $width = $width/$number_elements; + $height = $height/$number_elements; + } $output = stacked_gauge( $graph_values, @@ -1988,8 +2001,11 @@ function graphic_combined_module ( $graph_values = $temp; - $width = 1024; - $height = 500; + if(!$params['vconsole']){ + $width = 1024; + $height = 500; + } + $flash_charts = true; if($params_combined['stacked'] == CUSTOM_GRAPH_HBARS){ @@ -2102,8 +2118,11 @@ function graphic_combined_module ( $graph_values = $temp; - $width = 1024; - $height = 500; + + if(!$params['vconsole']){ + $width = 1024; + $height = 500; + } $color = color_graph_array(); From d8d18e422ea18a2f0137fe294d4a2b1da4082745 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Fri, 3 Aug 2018 14:22:26 +0200 Subject: [PATCH 78/84] Fixed ACL enterprise in home screen --- pandora_console/index.php | 76 +++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 30 deletions(-) diff --git a/pandora_console/index.php b/pandora_console/index.php index d7d7baba3e..84f53d6e95 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -447,21 +447,23 @@ if (! isset ($config['id_user'])) { $_GET["sec"] = "general/logon_ok"; break; case 'Dashboard': - $_GET["sec"] = "dashboard"; + $_GET["sec"] = "reporting"; $_GET["sec2"] = ENTERPRISE_DIR.'/dashboard/main_dashboard'; $id_dashboard_select = db_get_value('id', 'tdashboard', 'name', $home_url); $_GET['id_dashboard_select'] = $id_dashboard_select; break; case 'Visual console': - $_GET["sec"] = "visualc"; + $_GET["sec"] = "network"; $_GET["sec2"] = "operation/visual_console/index"; break; case 'Other': $home_url = io_safe_output($home_url); - parse_str ($home_url, $res); - $_GET["sec"] = $res["sec"]; - $_GET["sec2"] = $res["sec2"]; + $url_array = parse_url($home_url); + parse_str ($url_array['query'], $res); + foreach ($res as $key => $param) { + $_GET[$key] = $param; + } break; } } @@ -1033,67 +1035,81 @@ else { $home_page = io_safe_output($user_info['section']); $home_url = $user_info['data_section']; } - - - + if ($home_page != '') { switch ($home_page) { case 'Event list': - require ('operation/events/events.php'); + $_GET['sec'] = 'eventos'; + $_GET['sec2'] = 'operation/events/events'; break; case 'Group view': - require ('operation/agentes/group_view.php'); + $_GET['sec'] = 'view'; + $_GET['sec2'] = 'operation/agentes/group_view'; break; case 'Alert detail': - require ('operation/agentes/alerts_status.php'); + $_GET['sec'] = 'view'; + $_GET['sec2'] = 'operation/agentes/alerts_status'; break; case 'Tactical view': - require ('operation/agentes/tactical.php'); + $_GET['sec'] = 'view'; + $_GET['sec2'] = 'operation/agentes/tactical'; break; case 'Default': - require ('general/logon_ok.php'); + $_GET['sec2'] = 'general/logon_ok'; break; case 'Dashboard': $id_dashboard = db_get_value('id', 'tdashboard', 'name', $home_url); - $str = 'sec=visualc&sec2='.ENTERPRISE_DIR.'/dashboard/main_dashboard&id='.$id_dashboard; + $str = 'sec=reporting&sec2='.ENTERPRISE_DIR.'/dashboard/main_dashboard&id='.$id_dashboard; parse_str($str, $res); foreach ($res as $key => $param) { $_GET[$key] = $param; } - require(ENTERPRISE_DIR.'/dashboard/main_dashboard.php'); break; case 'Visual console': $id_visualc = db_get_value('id', 'tlayout', 'name', $home_url); if (($home_url == '') || ($id_visualc == false)) { - $str = 'sec=visualc&sec2=operation/visual_console/index&refr=60'; + $str = 'sec=network&sec2=operation/visual_console/index&refr=60'; } else - $str = 'sec=visualc&sec2=operation/visual_console/render_view&id='.$id_visualc .'&refr=60'; + $str = 'sec=network&sec2=operation/visual_console/render_view&id='.$id_visualc .'&refr=60'; parse_str($str, $res); foreach ($res as $key => $param) { $_GET[$key] = $param; } - require($_GET["sec2"] . '.php'); break; case 'Other': $home_url = io_safe_output($home_url); - parse_str ($home_url, $res); + $url_array = parse_url($home_url); + parse_str ($url_array['query'], $res); foreach ($res as $key => $param) { $_GET[$key] = $param; } - if (isset($_GET['sec2'])) { - $file = $_GET['sec2'] . '.php'; - - if (!file_exists ($file)) { - unset($_GET['sec2']); - require('general/logon_ok.php'); - } - else { - require($file); - } - } break; } + if (isset($_GET['sec2'])) { + $file = $_GET['sec2'] . '.php'; + // Translate some secs + $main_sec = get_sec($_GET['sec']); + $_GET['sec'] = $main_sec == false ? $_GET['sec'] : $main_sec; + if ( + !file_exists ($file) || + ( + $_GET['sec2'] != 'general/logon_ok' && + enterprise_hook ('enterprise_acl', + array ($config['id_user'], $_GET['sec'], $_GET['sec2'], true, + isset($_GET['sec3']) ? $_GET['sec3'] : '') + ) == false + ) + ) { + unset($_GET['sec2']); + require ("general/noaccess.php"); + } + else { + require($file); + } + } else { + require ("general/noaccess.php"); + } } else { require("general/logon_ok.php"); From 517c98cf1af59159b7bfc4f07c6964e5eccc4fc1 Mon Sep 17 00:00:00 2001 From: artica Date: Sat, 4 Aug 2018 00:01:25 +0200 Subject: [PATCH 79/84] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 1ea68c6c86..02d58edbec 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.725-180803 +Version: 7.0NG.725-180804 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 b1bf94ff72..a2b5477470 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.725-180803" +pandora_version="7.0NG.725-180804" 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 eecbdc4db9..b76d45b695 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.725'; -use constant AGENT_BUILD => '180803'; +use constant AGENT_BUILD => '180804'; # 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 eef9535ce5..0932b2dd0e 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.725 -%define release 180803 +%define release 180804 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 c581cc3f99..a900df829a 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.725 -%define release 180803 +%define release 180804 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 2d324e6ef9..e8b839f995 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180803" +PI_BUILD="180804" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 65db3b1ffb..909eba1368 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180803} +{180804} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 7897437210..f19b96db39 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.725(Build 180803)") +#define PANDORA_VERSION ("7.0NG.725(Build 180804)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 558dc27d0d..d71c9d2ff6 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.725(Build 180803))" + VALUE "ProductVersion", "(7.0NG.725(Build 180804))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index fec3f52d7a..15d7ead978 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.725-180803 +Version: 7.0NG.725-180804 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 204d5a23d5..9cfc3aba5d 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.725-180803" +pandora_version="7.0NG.725-180804" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index d7dec7ab36..5e05b0e456 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 = 'PC180803'; +$build_version = 'PC180804'; $pandora_version = 'v7.0NG.725'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index e25f835183..0e9a3ba5c3 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 2e5c073341..4828537748 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180803 +%define release 180804 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 15d449f8d9..a3af5fc835 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180803 +%define release 180804 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 3be6386e3e..efb2898309 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180803" +PI_BUILD="180804" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 916c20e41b..09182dcad6 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.725 PS180803"; +my $version = "7.0NG.725 PS180804"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index cb2651b79d..9b948a5f0f 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.725 PS180803"; +my $version = "7.0NG.725 PS180804"; # save program name for logging my $progname = basename($0); From e5e97a304b741832aefc5826979496e678bfeb84 Mon Sep 17 00:00:00 2001 From: artica Date: Sun, 5 Aug 2018 00:01:21 +0200 Subject: [PATCH 80/84] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 02d58edbec..3bc25c54af 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.725-180804 +Version: 7.0NG.725-180805 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 a2b5477470..65fcfa0326 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.725-180804" +pandora_version="7.0NG.725-180805" 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 b76d45b695..6f2cfd5373 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.725'; -use constant AGENT_BUILD => '180804'; +use constant AGENT_BUILD => '180805'; # 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 0932b2dd0e..1864b02277 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.725 -%define release 180804 +%define release 180805 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 a900df829a..ac217dd5f9 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.725 -%define release 180804 +%define release 180805 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 e8b839f995..6dc11da0c1 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180804" +PI_BUILD="180805" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 909eba1368..d664107095 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180804} +{180805} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index f19b96db39..2f8363f271 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.725(Build 180804)") +#define PANDORA_VERSION ("7.0NG.725(Build 180805)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index d71c9d2ff6..598c476d80 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.725(Build 180804))" + VALUE "ProductVersion", "(7.0NG.725(Build 180805))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 15d7ead978..2fa3166562 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.725-180804 +Version: 7.0NG.725-180805 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 9cfc3aba5d..1515a7b7e4 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.725-180804" +pandora_version="7.0NG.725-180805" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 5e05b0e456..a03e3f6542 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 = 'PC180804'; +$build_version = 'PC180805'; $pandora_version = 'v7.0NG.725'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 0e9a3ba5c3..c713ccf064 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 4828537748..c7e8f4d12a 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180804 +%define release 180805 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index a3af5fc835..6c80afdf32 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180804 +%define release 180805 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index efb2898309..78060f7d36 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180804" +PI_BUILD="180805" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 09182dcad6..ae1deb8657 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.725 PS180804"; +my $version = "7.0NG.725 PS180805"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 9b948a5f0f..36e3ae3edb 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.725 PS180804"; +my $version = "7.0NG.725 PS180805"; # save program name for logging my $progname = basename($0); From 1367d0e57eca106b88909951b845a2ed56f9c946 Mon Sep 17 00:00:00 2001 From: artica Date: Mon, 6 Aug 2018 00:01:22 +0200 Subject: [PATCH 81/84] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 3bc25c54af..8e698490d1 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.725-180805 +Version: 7.0NG.725-180806 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 65fcfa0326..74937948c5 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.725-180805" +pandora_version="7.0NG.725-180806" 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 6f2cfd5373..3e23eb36f7 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.725'; -use constant AGENT_BUILD => '180805'; +use constant AGENT_BUILD => '180806'; # 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 1864b02277..27473af192 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.725 -%define release 180805 +%define release 180806 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 ac217dd5f9..9c34810850 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.725 -%define release 180805 +%define release 180806 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 6dc11da0c1..b854c70270 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180805" +PI_BUILD="180806" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index d664107095..08a30e3dbd 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180805} +{180806} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 2f8363f271..99ffc1fa5c 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.725(Build 180805)") +#define PANDORA_VERSION ("7.0NG.725(Build 180806)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 598c476d80..7fa03136b3 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.725(Build 180805))" + VALUE "ProductVersion", "(7.0NG.725(Build 180806))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 2fa3166562..93199bf083 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.725-180805 +Version: 7.0NG.725-180806 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 1515a7b7e4..a8576c494d 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.725-180805" +pandora_version="7.0NG.725-180806" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index a03e3f6542..f1fa0a152a 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 = 'PC180805'; +$build_version = 'PC180806'; $pandora_version = 'v7.0NG.725'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index c713ccf064..9ecb3fb0ed 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index c7e8f4d12a..4eb7c1f8ed 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180805 +%define release 180806 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 6c80afdf32..640996dd0d 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180805 +%define release 180806 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 78060f7d36..3b2ed41e9f 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180805" +PI_BUILD="180806" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index ae1deb8657..7430df0d1b 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.725 PS180805"; +my $version = "7.0NG.725 PS180806"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 36e3ae3edb..9549562c79 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.725 PS180805"; +my $version = "7.0NG.725 PS180806"; # save program name for logging my $progname = basename($0); From e614e3ececc8ab09343c639a6758149c26d4c8e1 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 7 Aug 2018 00:01:22 +0200 Subject: [PATCH 82/84] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 8e698490d1..1f2471feae 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.725-180806 +Version: 7.0NG.725-180807 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 74937948c5..82ad8d180e 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.725-180806" +pandora_version="7.0NG.725-180807" 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 3e23eb36f7..b06ff06e47 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.725'; -use constant AGENT_BUILD => '180806'; +use constant AGENT_BUILD => '180807'; # 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 27473af192..62ec623a3d 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.725 -%define release 180806 +%define release 180807 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 9c34810850..5ab51849e1 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.725 -%define release 180806 +%define release 180807 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 b854c70270..391368e40a 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180806" +PI_BUILD="180807" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 08a30e3dbd..4488e61450 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180806} +{180807} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 99ffc1fa5c..b6c9954228 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.725(Build 180806)") +#define PANDORA_VERSION ("7.0NG.725(Build 180807)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 7fa03136b3..1ebbb8ad02 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.725(Build 180806))" + VALUE "ProductVersion", "(7.0NG.725(Build 180807))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 93199bf083..1604f7e408 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.725-180806 +Version: 7.0NG.725-180807 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 a8576c494d..24cfe8c8bb 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.725-180806" +pandora_version="7.0NG.725-180807" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index f1fa0a152a..ae311a1e04 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 = 'PC180806'; +$build_version = 'PC180807'; $pandora_version = 'v7.0NG.725'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 9ecb3fb0ed..443623808a 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 4eb7c1f8ed..e9ef4e7aef 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180806 +%define release 180807 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 640996dd0d..7a7822f0ee 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180806 +%define release 180807 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 3b2ed41e9f..48b30ec956 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180806" +PI_BUILD="180807" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 7430df0d1b..6a28329336 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.725 PS180806"; +my $version = "7.0NG.725 PS180807"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 9549562c79..63ddb01218 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.725 PS180806"; +my $version = "7.0NG.725 PS180807"; # save program name for logging my $progname = basename($0); From 2778239a0fe692703f43171cf31854d24a09e53b Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Tue, 7 Aug 2018 13:03:53 +0200 Subject: [PATCH 83/84] Fix the api info call --- pandora_console/include/api.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/api.php b/pandora_console/include/api.php index 1c6f0af77b..de84850890 100644 --- a/pandora_console/include/api.php +++ b/pandora_console/include/api.php @@ -54,6 +54,7 @@ $no_login_msg = ""; // Clean unwanted output ob_clean(); +// READ THIS: // Special call without checks to retrieve version and build of the Pandora FMS // This info is avalable from the web console without login // Don't change the format, it is parsed by applications @@ -63,7 +64,7 @@ switch($info) { $config["MR"] = 0; } - echo io_safe_output(get_product_name()) . ' ' . $pandora_version . ' - ' . $build_version . " MR" . $config["MR"]; + echo 'Pandora FMS ' . $pandora_version . ' - ' . $build_version . " MR" . $config["MR"]; exit; } From c6eef38ae8f6081569ff7831fc9d6c630804d757 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 8 Aug 2018 00:01:22 +0200 Subject: [PATCH 84/84] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index 1f2471feae..2b8a981307 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.725-180807 +Version: 7.0NG.725-180808 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 82ad8d180e..a9781baa56 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.725-180807" +pandora_version="7.0NG.725-180808" 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 b06ff06e47..47bf96bc69 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.725'; -use constant AGENT_BUILD => '180807'; +use constant AGENT_BUILD => '180808'; # 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 62ec623a3d..e39eeb3fdc 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.725 -%define release 180807 +%define release 180808 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 5ab51849e1..5c8ee9b653 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.725 -%define release 180807 +%define release 180808 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 391368e40a..cdc4dae675 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180807" +PI_BUILD="180808" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 4488e61450..eff123577e 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{180807} +{180808} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index b6c9954228..2f63c5d985 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.725(Build 180807)") +#define PANDORA_VERSION ("7.0NG.725(Build 180808)") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 1ebbb8ad02..e0f99c4347 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.725(Build 180807))" + VALUE "ProductVersion", "(7.0NG.725(Build 180808))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 1604f7e408..6bd9a8d6e5 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.725-180807 +Version: 7.0NG.725-180808 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 24cfe8c8bb..45fb374b9d 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.725-180807" +pandora_version="7.0NG.725-180808" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index ae311a1e04..8698653da1 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 = 'PC180807'; +$build_version = 'PC180808'; $pandora_version = 'v7.0NG.725'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 443623808a..8c0c9ce870 100755 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -71,7 +71,7 @@
    [ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index e9ef4e7aef..f9fdb341d3 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180807 +%define release 180808 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 7a7822f0ee..4517f0ed11 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -3,7 +3,7 @@ # %define name pandorafms_server %define version 7.0NG.725 -%define release 180807 +%define release 180808 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 48b30ec956..fe813df94d 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.725" -PI_BUILD="180807" +PI_BUILD="180808" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 6a28329336..99eebad634 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -34,7 +34,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.725 PS180807"; +my $version = "7.0NG.725 PS180808"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 63ddb01218..b83ab98065 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.725 PS180807"; +my $version = "7.0NG.725 PS180808"; # save program name for logging my $progname = basename($0);