' .
+ html_print_select_groups(
+ $config['id_user'],
+ "VR",
+ true,
+ 'element_group',
+ __('All'),
+ '',
+ '',
+ 0,
+ true) .
ui_print_help_tip (
__("If selected, restrict visualization of this item in the visual console to users who have access to selected group. This is also used on calculating child visual consoles."), true) .
'
';
diff --git a/pandora_console/include/graphs/functions_pchart.php b/pandora_console/include/graphs/functions_pchart.php
index fcbd67f00a..0114d36e32 100644
--- a/pandora_console/include/graphs/functions_pchart.php
+++ b/pandora_console/include/graphs/functions_pchart.php
@@ -522,7 +522,7 @@ function pch_pie_graph ($graph_type, $data_values, $legend_values, $width,
if ($legend_position != 'hidden') {
// This is a hardcore adjustment to match most of the graphs, please don't alter
- $legend_with_aprox = 32 + (4.5 * $max_chars);
+ $legend_with_aprox = 32 + (9.5 * $max_chars);
$PieChart->drawPieLegend($width - $legend_with_aprox, 5, array("R"=>255,"G"=>255,"B"=>255, "BoxSize"=>10));
}
diff --git a/pandora_console/include/graphs/pandora.d3.js b/pandora_console/include/graphs/pandora.d3.js
index 98d4a54557..300ff0b665 100644
--- a/pandora_console/include/graphs/pandora.d3.js
+++ b/pandora_console/include/graphs/pandora.d3.js
@@ -2334,7 +2334,7 @@ var digitPattern = [
digit.select("path:nth-child(5)").classed("lit", function(d) { return digitPattern[4][d]; });
digit.select("path:nth-child(6)").classed("lit", function(d) { return digitPattern[5][d]; });
digit.select("path:nth-child(7)").classed("lit", function(d) { return digitPattern[6][d]; });
- separator.classed("lit", seconds & 1);
+ separator.classed("lit", seconds);
setTimeout(tick, 1000 - now % 1000);
})();
diff --git a/pandora_console/include/javascript/pandora_snmp_browser.js b/pandora_console/include/javascript/pandora_snmp_browser.js
index fd202ad4dc..60f914c9e9 100644
--- a/pandora_console/include/javascript/pandora_snmp_browser.js
+++ b/pandora_console/include/javascript/pandora_snmp_browser.js
@@ -203,8 +203,9 @@ function hideOIDData() {
// Empty previous OID data
$("#snmp_data").empty();
-
+
$("#snmp_data").css('display', 'none');
+ $(".forced_title_layer").css('display', 'none');
}
// Search the SNMP tree for a matching string
diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css
index 28c6e3691d..6601807581 100644
--- a/pandora_console/include/styles/pandora.css
+++ b/pandora_console/include/styles/pandora.css
@@ -4619,4 +4619,11 @@ form ul.form_flex li ul li{
.events_bar {
margin:0 auto;
-}
\ No newline at end of file
+}
+
+#snmp_data {
+ background: #f9faf9;
+}
+#snmp_data .databox {
+ border: 0px;
+}
diff --git a/pandora_console/install.php b/pandora_console/install.php
index 0a3ac1acf9..3725bf6847 100755
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -71,7 +71,7 @@
$field['id_field'],
- 'id_agent' => $id_agente));
-
- if ($custom_value === false || $custom_value == '') {
- $custom_value = '-'.__('empty').'-';
+ $custom_value = db_get_all_rows_sql("select tagent_custom_data.description,tagent_custom_fields.is_password_type from tagent_custom_fields
+ INNER JOIN tagent_custom_data ON tagent_custom_fields.id_field = tagent_custom_data.id_field where tagent_custom_fields.id_field = ".$field['id_field']." and tagent_custom_data.id_agent = ".$id_agente);
+
+ if ($custom_value[0]['description'] === false || $custom_value[0]['description'] == '') {
+ $custom_value[0]['description'] = '-'.__('empty').'-';
}
else {
- $custom_value = ui_bbcode_to_html($custom_value);
+ $custom_value[0]['description'] = ui_bbcode_to_html($custom_value[0]['description']);
}
- $data[2] = $custom_value;
+ if($custom_value[0]['is_password_type']){
+ $data[2] = '••••••••';
+ }
+ else{
+ $data[2] = $custom_value[0]['description'];
+ }
array_push ($table->data, $data);
}
diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php
index b94a7733db..52ad3766bc 100644
--- a/pandora_console/operation/agentes/ver_agente.php
+++ b/pandora_console/operation/agentes/ver_agente.php
@@ -44,12 +44,16 @@ if (is_ajax ()) {
$get_agentmodule_status_tooltip = (bool) get_parameter ("get_agentmodule_status_tooltip");
$get_group_status_tooltip = (bool) get_parameter ("get_group_status_tooltip");
$get_agent_id = (bool) get_parameter ("get_agent_id");
+ $cluster_mode = (bool) get_parameter ("cluster_mode",0);
+ $agent_alias = get_parameter('alias', '');
+ $agents_inserted = get_parameter('agents_inserted', array());
$id_group = (int) get_parameter('id_group');
if ($get_agents_group_json) {
$id_group = (int) get_parameter('id_group');
$recursion = get_parameter ('recursion');
$id_os = get_parameter('id_os', '');
$agent_name = get_parameter('name', '');
+
$privilege = (string) get_parameter ('privilege', "AR");
// Is is possible add keys prefix to avoid auto sorting in js object conversion
$keys_prefix = (string) get_parameter ('keys_prefix', '');
@@ -75,6 +79,8 @@ if (is_ajax ()) {
$filter['id_os'] = $id_os;
if (!empty($agent_name))
$filter['nombre'] = '%' . $agent_name . '%';
+ if (!empty($agent_alias))
+ $filter['alias'] = '%' . $agent_alias . '%';
switch ($status_agents) {
case AGENT_STATUS_NORMAL:
@@ -98,6 +104,43 @@ if (is_ajax ()) {
}
$filter['order'] = "alias ASC";
+ if($cluster_mode){
+
+ $agent_id_os = db_get_all_rows_sql('select id_os from tconfig_os where id_os != 100');
+
+ foreach ($agent_id_os as $key => $value) {
+ $agent_id_os_array[] = $agent_id_os[$key]['id_os'];
+ }
+
+ $filter['id_os'] = $agent_id_os_array;
+
+ if($agents_inserted[0] != ''){
+
+ $agents_id_list = '';
+
+ foreach($agents_inserted as $elem) {
+
+ if ($elem === end($agents_inserted)) {
+ $agents_id_list .= $elem;
+ }
+ else{
+ $agents_id_list .= $elem.',';
+ }
+
+ }
+
+ $agent_id_agente = db_get_all_rows_sql('select id_agente from tagente where id_agente not in ('.$agents_id_list.')');
+
+ foreach ($agent_id_agente as $key => $value) {
+ $agent_id_agente_array[] = $agent_id_agente[$key]['id_agente'];
+ }
+
+ $filter['id_agente'] = $agent_id_agente_array;
+
+ }
+
+ }
+
// Build fields
$fields = array('id_agente', 'alias');
diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php
index a7e6523c7e..9564e87b5e 100644
--- a/pandora_console/operation/events/events.php
+++ b/pandora_console/operation/events/events.php
@@ -275,7 +275,7 @@ if ($id_agent != 0) {
}
$text_module = (string) get_parameter('module_search', '');
-$id_agent_module = get_parameter('module_search_hidden', 0);
+$id_agent_module = get_parameter('module_search_hidden', get_parameter('id_agent_module',0));
if ($id_agent_module != 0) {
$text_module = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $id_agent_module);
if ($text_module == false) {
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index b1397231d1..f014ac5dbf 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.720
-%define release 180321
+%define release 180322
# User and Group under which Apache is running
%define httpd_name httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index 443fbc28e8..d8681212eb 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.720
-%define release 180321
+%define release 180322
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2
diff --git a/pandora_server/DEBIAN/control b/pandora_server/DEBIAN/control
index 5bf6ce8c9b..b004cf734e 100644
--- a/pandora_server/DEBIAN/control
+++ b/pandora_server/DEBIAN/control
@@ -1,5 +1,5 @@
package: pandorafms-server
-Version: 7.0NG.720-180321
+Version: 7.0NG.720-180322
Architecture: all
Priority: optional
Section: admin
diff --git a/pandora_server/DEBIAN/make_deb_package.sh b/pandora_server/DEBIAN/make_deb_package.sh
index 6ca7a40a8c..bb5d6efaf5 100644
--- a/pandora_server/DEBIAN/make_deb_package.sh
+++ b/pandora_server/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.720-180321"
+pandora_version="7.0NG.720-180322"
package_cpan=0
package_pandora=1
diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm
index b8364fdb6d..6f3e48961a 100644
--- a/pandora_server/lib/PandoraFMS/Config.pm
+++ b/pandora_server/lib/PandoraFMS/Config.pm
@@ -43,7 +43,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.720";
-my $pandora_build = "180321";
+my $pandora_build = "180322";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash
diff --git a/pandora_server/lib/PandoraFMS/PluginTools.pm b/pandora_server/lib/PandoraFMS/PluginTools.pm
index b31e623c40..c65a36c6a3 100644
--- a/pandora_server/lib/PandoraFMS/PluginTools.pm
+++ b/pandora_server/lib/PandoraFMS/PluginTools.pm
@@ -31,7 +31,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.720";
-my $pandora_build = "180321";
+my $pandora_build = "180322";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec
index c7f2e5d382..9a87ae5704 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.720
-%define release 180321
+%define release 180322
Summary: Pandora FMS Server
Name: %{name}
diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec
index a190e8b030..80a197e3b4 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.720
-%define release 180321
+%define release 180322
Summary: Pandora FMS Server
Name: %{name}
diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer
index cfa1cf7d0f..5b362ab884 100755
--- a/pandora_server/pandora_server_installer
+++ b/pandora_server/pandora_server_installer
@@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.720"
-PI_BUILD="180321"
+PI_BUILD="180322"
MODE=$1
if [ $# -gt 1 ]; then
diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl
index 87db9b804f..dbf37ee39f 100644
--- a/pandora_server/util/pandora_db.pl
+++ b/pandora_server/util/pandora_db.pl
@@ -33,7 +33,7 @@ use PandoraFMS::Tools;
use PandoraFMS::DB;
# version: define current version
-my $version = "7.0NG.720 PS180321";
+my $version = "7.0NG.720 PS180322";
# Pandora server configuration
my %conf;
diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl
index 356f62ef21..0291c9e46c 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.720 PS180321";
+my $version = "7.0NG.720 PS180322";
# save program name for logging
my $progname = basename($0);
@@ -195,7 +195,6 @@ sub help_screen{
\n\t ]", 'Add snmp network module to policy');
help_screen_line('--create_policy_plugin_module', " \n\t [ \n\t \n\t \n\t \n\t \n\t \n\t ]", 'Add plug-in module to policy');
help_screen_line('--create_policy_data_module_from_local_component', '');
- help_screen_line('--create_policy_web_module_from_local_component', '');
help_screen_line('--add_collection_to_policy', "");
help_screen_line('--validate_policy_alerts', '', 'Validate the alerts of a given policy');
help_screen_line('--get_policy_modules', '', 'Get the modules of a policy');
@@ -5834,10 +5833,6 @@ sub pandora_manage_main ($$$) {
param_check($ltotal, 2, 2);
cli_create_policy_data_module_from_local_component();
}
- elsif ($param eq '--create_policy_web_module_from_local_component') {
- param_check($ltotal, 2, 2);
- cli_create_policy_web_module_from_local_component();
- }
elsif ($param eq '--create_policy') {
param_check($ltotal, 3, 2);
cli_create_policy();
@@ -6072,6 +6067,7 @@ sub pandora_manage_main ($$$) {
param_check($ltotal, 3, 2);
cli_export_visual_console();
}
+<<<<<<< HEAD
elsif ($param eq '--migration_agent_queue') {
param_check($ltotal, 4, 1);
cli_migration_agent_queue();
@@ -6080,6 +6076,12 @@ sub pandora_manage_main ($$$) {
param_check($ltotal, 1, 0);
cli_migration_agent();
}
+=======
+ elsif ($param eq '--apply_module_template') {
+ param_check($ltotal, 2, 2);
+ cli_apply_module_template();
+ }
+>>>>>>> origin/develop
else {
print_log "[ERROR] Invalid option '$param'.\n\n";
$param = '';
@@ -6289,25 +6291,6 @@ sub cli_create_policy_data_module_from_local_component() {
enterprise_hook('pandora_create_policy_data_module_from_local_component',[$conf, $component, $policy_id, $dbh]);
}
-##############################################################################
-# Create policy web module from local component.
-# Related option: --create_policy_web_module_from_local_component
-##############################################################################
-sub cli_create_policy_web_module_from_local_component() {
- my ($policy_name, $component_name) = @ARGV[2..3];
-
- my $policy_id = enterprise_hook('get_policy_id',[$dbh, safe_input($policy_name)]);
- exist_check($policy_id,'policy',$policy_name);
-
- my $lc_id = pandora_get_local_component_id($dbh, $component_name);
- exist_check($lc_id,'local component',$component_name);
-
- # Get local component web
- my $component = get_db_single_row ($dbh, 'SELECT * FROM tlocal_component WHERE id = ?', $lc_id);
-
- enterprise_hook('pandora_create_policy_web_module_from_local_component',[$conf, $component, $policy_id, $dbh]);
-}
-
##############################################################################
# Create local component.
# Related option: --create_local_component
@@ -6451,6 +6434,7 @@ sub cli_add_tag_to_module() {
print "\n$result\n";
}
+<<<<<<< HEAD
##############################################################################
# Only meta migrate agent
##############################################################################
@@ -6490,3 +6474,96 @@ sub cli_migration_agent() {
print "\n0\n";
}
}
+=======
+sub cli_apply_module_template() {
+ my ($id_template, $id_agent) = @ARGV[2..3];
+
+ my @row = get_db_rows ($dbh,"select * from tagente where id_agente = ".$id_agent);
+
+ return if (scalar (@row) == 0);
+
+ my $name_template = get_db_value ($dbh,'select name from tnetwork_profile where id_np = '.$id_template);
+
+ my @npc = get_db_rows($dbh,"select * from tnetwork_profile_component where id_np = ".$id_template);
+
+ foreach my $component (@npc) {
+
+ my @template_values = get_db_rows ($dbh,"SELECT * FROM tnetwork_component where id_nc = ".$component->{'id_nc'});
+
+ return if (scalar (@template_values) == 0);
+
+ foreach my $element (@template_values) {
+ my $agent_values;
+ $agent_values->{'id_agente'} = $id_agent;
+ $agent_values->{'id_tipo_modulo'} = $element->{"type"};
+ $agent_values->{'descripcion'} = 'Created by template '.$name_template.' '.$element->{"description"};
+ $agent_values->{'max'} = $element->{"max"};
+ $agent_values->{'min'} = $element->{"min"};
+ $agent_values->{'module_interval'} = $element->{"module_interval"};
+ $agent_values->{'tcp_port'} = $element->{"tcp_port"};
+ $agent_values->{'tcp_send'} = $element->{"tcp_send"};
+ $agent_values->{'tcp_rcv'} = $element->{"tcp_rcv"};
+ $agent_values->{'snmp_community'} = $element->{"snmp_community"};
+ $agent_values->{'snmp_oid'} = $element->{"snmp_oid"};
+ $agent_values->{'ip_target'} = $row[0]->{"direccion"};
+ $agent_values->{'id_module_group'} = $element->{"id_module_group"};
+ $agent_values->{'id_modulo'} = $element->{"id_modulo"};
+ $agent_values->{'plugin_user'} = $element->{"plugin_user"};
+ $agent_values->{'plugin_pass'} = $element->{"plugin_pass"};
+ $agent_values->{'plugin_parameter'} = $element->{"plugin_parameter"};
+ $agent_values->{'unit'} = $element->{"unit"};
+ $agent_values->{'max_timeout'} = $element->{"max_timeout"};
+ $agent_values->{'max_retries'} = $element->{"max_retries"};
+ $agent_values->{'id_plugin'} = $element->{"id_plugin"};
+ $agent_values->{'post_process'} = $element->{"post_process"};
+ $agent_values->{'dynamic_interval'} = $element->{"dynamic_interval"};
+ $agent_values->{'dynamic_max'} = $element->{"dynamic_max"};
+ $agent_values->{'dynamic_min'} = $element->{"dynamic_min"};
+ $agent_values->{'dynamic_two_tailed'} = $element->{"dynamic_two_tailed"};
+ $agent_values->{'min_warning'} = $element->{"min_warning"};
+ $agent_values->{'max_warning'} = $element->{"max_warning"};
+ $agent_values->{'str_warning'} = $element->{"str_warning"};
+ $agent_values->{'min_critical'} = $element->{"min_critical"};
+ $agent_values->{'max_critical'} = $element->{"max_critical"};
+ $agent_values->{'str_critical'} = $element->{"str_critical"};
+ $agent_values->{'critical_inverse'} = $element->{"critical_inverse"};
+ $agent_values->{'warning_inverse'} = $element->{"warning_inverse"};
+ $agent_values->{'critical_instructions'} = $element->{"critical_instructions"};
+ $agent_values->{'warning_instructions'} = $element->{"warning_instructions"};
+ $agent_values->{'unknown_instructions'} = $element->{"unknown_instructions"};
+ $agent_values->{'id_category'} = $element->{"id_category"};
+ $agent_values->{'macros'} = $element->{"macros"};
+ $agent_values->{'each_ff'} = $element->{"each_ff"};
+ $agent_values->{'min_ff_event'} = $element->{"min_ff_event"};
+ $agent_values->{'min_ff_event_normal'} = $element->{"min_ff_event_normal"};
+ $agent_values->{'min_ff_event_warning'} = $element->{"min_ff_event_warning"};
+ $agent_values->{'min_ff_event_critical'} = $element->{"min_ff_event_critical"};
+ $agent_values->{'nombre'} = $element->{"name"};
+
+ my @tags;
+ if($element->{"tags"} ne '') {
+ @tags = split(',', $element->{"tags"});
+ }
+
+ my $module_name_check = get_db_value ($dbh,'select id_agente_modulo from tagente_modulo where delete_pending = 0 and nombre ="'.$agent_values->{'nombre'}.'" and id_agente = '.$id_agent);
+
+ if (!defined($module_name_check)) {
+
+ my $id_agente_modulo = pandora_create_module_from_hash(\%conf,$agent_values,$dbh);
+
+ if ($id_agente_modulo != -1) {
+
+ foreach my $tag_name (@tags) {
+
+ my $tag_id = get_db_value($dbh,'select id_tag from ttag where name = "'.$tag_name.'"');
+
+ db_do($dbh,'insert into ttag_module (id_tag,id_agente_modulo) values ("'.$tag_id.'","'.$id_agente_modulo.'")');
+
+ }
+ }
+ }
+ }
+ }
+}
+
+>>>>>>> origin/develop