diff --git a/pandora_console/godmode/reporting/cluster_builder.main.php b/pandora_console/godmode/reporting/cluster_builder.main.php
index e5002e2df1..38f8bbb486 100644
--- a/pandora_console/godmode/reporting/cluster_builder.main.php
+++ b/pandora_console/godmode/reporting/cluster_builder.main.php
@@ -250,13 +250,9 @@ elseif($step == 2){
$cluster_agents_all[$value['id_agente']] = $value['alias'];
}
- $cluster_agents_out = array();
- $cluster_agents_out = array_diff_key($template_agents_all, $template_agents_in);
+ $cluster_agents_out = array_diff_key($cluster_agents_all,$cluster_agents_in);
- $cluster_agents_in_keys = array_keys($template_agents_in);
- $cluster_agents_out_keys = array_keys($template_agents_out);
-
- html_print_select ($cluster_agents_all, 'id_agents[]', 0, false, '', '', false, true, true, '', false, 'width: 100%;', $option_style);
+ html_print_select ($cluster_agents_out, 'id_agents[]', 0, false, '', '', false, true, true, '', false, 'width: 100%;', $option_style);
echo "";
diff --git a/pandora_console/godmode/reporting/cluster_list.php b/pandora_console/godmode/reporting/cluster_list.php
index e7c3857f1e..e70aa21e06 100644
--- a/pandora_console/godmode/reporting/cluster_list.php
+++ b/pandora_console/godmode/reporting/cluster_list.php
@@ -77,8 +77,7 @@ ui_pagination (count($clusters));
foreach ($clusters as $cluster) {
$data = array ();
- $data[0] = '
'.$cluster["name"].' - Enlace Map Dani (Mapa de red)'.
- '
'.$cluster["name"].' - Enlace Enrique (pantalla informativa)';
+ $data[0] = '
'.$cluster["name"].'';
$data[1] = ui_print_truncate_text($cluster["description"], 70);
$data[2] = ui_print_group_icon($cluster['group'],true);
@@ -143,7 +142,7 @@ ui_pagination (count($clusters));
break;
}
- $data[6] = "

+ $data[6] = "

";
array_push ($table->data, $data);
diff --git a/pandora_console/godmode/reporting/cluster_name_agents.php b/pandora_console/godmode/reporting/cluster_name_agents.php
new file mode 100644
index 0000000000..0247a10ffe
--- /dev/null
+++ b/pandora_console/godmode/reporting/cluster_name_agents.php
@@ -0,0 +1,136 @@
+ $value) {
+ $module_agents_value[$module_agents[$key]['id_agente']] = $module_agents[$key]['id_agente_modulo'];
+ }
+
+
+ echo '
+
+
+
+
+
+
+
+
+
+
+
+
+ ';
+ foreach ($module_agents_value as $key => $value) {
+
+ if ($value === reset($module_agents_value) && $module_ap) {
+ echo '';
+ }
+ else{
+ echo '
';
+ }
+
+ echo ''.agents_get_alias($key).' | ';
+ echo ''.modules_get_agentmodule_name($value).' | ';
+ echo '';
+
+ switch (modules_get_agentmodule_last_status($value)) {
+ case 1:
+
+ echo ' ';
+
+ break;
+ case 2:
+
+ echo ' ';
+
+ break;
+ case 4:
+
+ echo ' ';
+
+ break;
+ case 3:
+
+ echo ' ';
+
+ break;
+ case 5:
+
+ echo ' ';
+
+ break;
+ case 0:
+
+ echo ' ';
+
+ break;
+
+ default:
+
+ break;
+ }
+
+
+ echo ' | ';
+
+ echo ''.modules_get_last_value($value).' | ';
+
+ echo '';
+ echo '';
+ echo ' ';
+ echo ' ';
+
+ $nombre_tipo_modulo = modules_get_moduletype_name (modules_get_type_id($value));
+ $handle = "stat".$nombre_tipo_modulo."_".$value;
+ $url = 'include/procesos.php?agente='.$value;
+ $win_handle=dechex(crc32($value.modules_get_agentmodule_name($value)));
+
+ if ($graph_type == 'boolean') {
+ $draw_events = 1;
+ } else {
+ $draw_events = 0;
+ }
+
+ $link ="winopeng('" .
+ "operation/agentes/stat_win.php?" .
+ "type=$graph_type&" .
+ "period=" . SECONDS_1DAY . "&" .
+ "id=" . $value . "&" .
+ "label=" . rawurlencode(
+ urlencode(
+ base64_encode($module["nombre"]))) . "&" .
+ "refresh=" . SECONDS_10MINUTES . "&" .
+ "draw_events=$draw_events', 'day_".$win_handle."')";
+
+ echo '';
+ echo ' ';
+ echo '';
+
+
+ echo ' | ';
+ echo ''.date("d/m/Y - H:i:s",modules_get_last_contact($value)).' | ';
+ echo '';
+ echo ' | ';
+ echo '
';
+ }
+
+ echo '
+
+
+';
+
+ return;
+
+?>
\ No newline at end of file
diff --git a/pandora_console/godmode/reporting/cluster_view.php b/pandora_console/godmode/reporting/cluster_view.php
index 47b33cb3ef..050dea02c8 100644
--- a/pandora_console/godmode/reporting/cluster_view.php
+++ b/pandora_console/godmode/reporting/cluster_view.php
@@ -142,7 +142,7 @@ echo "
";
echo "";
- $balanced_modules_in = items_get_cluster_items_id_name($id_cluster,'AP');
+ $balanced_modules_in = items_get_cluster_items_id_name($id_cluster,'AP',1);
foreach ($balanced_modules_in as $key => $value) {
$cluster_module = db_process_sql('select id_agente_modulo from tagente_modulo where custom_integer_2 = '.$key);
@@ -150,12 +150,12 @@ echo "
";
$cluster_module_status = modules_get_agentmodule_last_status($cluster_module[0]['id_agente_modulo']);
echo "";
-
- if($cluster_module_status == 5){
- echo '

'.ui_print_truncate_text($value, 40,false).'
';
+
+ if($cluster_module_status == 0){
+ echo '

'.ui_print_truncate_text($value, 40,false).'
';
}
else{
- echo '

'.ui_print_truncate_text($value, 40,false).'
';
+ echo '

'.ui_print_truncate_text($value, 40,false).'
';
}
echo '
';
@@ -169,7 +169,9 @@ echo "";
echo "";
}
-
+ // $module_agents = db_process_sql('select tagente_modulo.id_agente_modulo,tagente_modulo.id_agente,utimestamp from tagente_modulo,tagente_estado where tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo and nombre = "CPU Load" and tagente_modulo.id_agente in
+ // (select id_agent from tcluster_agent where id_cluster = 6)');
+ // html_debug($module_agents);
echo "";
@@ -195,11 +197,11 @@ echo "
";
echo "";
- if($cluster_module_status == 5){
- echo '

'.ui_print_truncate_text($value, 40,false).'
';
+ if($cluster_module_status == 0){
+ echo '

'.ui_print_truncate_text($value, 40,false).'
';
}
else{
- echo '

'.ui_print_truncate_text($value, 40,false).'
';
+ echo '

'.ui_print_truncate_text($value, 40,false).'
';
}
echo '
';
@@ -280,6 +282,8 @@ echo "";
+echo "";
+
$id_agent = db_process_sql('select id_agent from tcluster where id = '.$id_cluster);
$id_agent_value = $id_agent[0]['id_agent'];
@@ -513,8 +517,32 @@ function refresh_pagination_callback (module_id, id_agent, server_name,module_na
});
}
+function modal_module(name,id_cluster,module_ap,event){
+
+ x=event.clientX-550;
+ y=event.clientY-50;
+
+ $.ajax({
+ type: "POST",
+ url: "ajax.php",
+ data: {"page" : "godmode/reporting/cluster_name_agents",
+ "name_module" : name,
+ "id_cluster" : id_cluster,
+ "module_ap" : module_ap
+ },
+ success: function(data) {
+
+ $('#modal_module_popup').css({'display':'block','width':'600px','left':x+'px','top': y+'px'});
+
+ $('#modal_module_popup').html(data);
+ }
+ });
+
+}
+
$(document).ready(function(){
+
$('.tooltip').tooltipster();
var controller = null
$(function() {
diff --git a/pandora_console/images/firts_task/icono-cluster-activo.png b/pandora_console/images/firts_task/icono-cluster-activo.png
new file mode 100644
index 0000000000..49720af75d
Binary files /dev/null and b/pandora_console/images/firts_task/icono-cluster-activo.png differ
diff --git a/pandora_console/images/os_icons/so_big_icons/so_cluster.png b/pandora_console/images/os_icons/so_big_icons/so_cluster.png
new file mode 100644
index 0000000000..4b85e5f049
Binary files /dev/null and b/pandora_console/images/os_icons/so_big_icons/so_cluster.png differ
diff --git a/pandora_console/images/os_icons/so_cluster.png b/pandora_console/images/os_icons/so_cluster.png
new file mode 100644
index 0000000000..5f76cd1615
Binary files /dev/null and b/pandora_console/images/os_icons/so_cluster.png differ
diff --git a/pandora_console/images/os_icons/so_cluster_small.png b/pandora_console/images/os_icons/so_cluster_small.png
new file mode 100644
index 0000000000..8f5a3c9c5f
Binary files /dev/null and b/pandora_console/images/os_icons/so_cluster_small.png differ
diff --git a/pandora_console/include/functions_clusters.php b/pandora_console/include/functions_clusters.php
index b59607b377..e54e73c08c 100644
--- a/pandora_console/include/functions_clusters.php
+++ b/pandora_console/include/functions_clusters.php
@@ -123,8 +123,8 @@ function items_get_cluster_items_id ($id_cluster,$item_type = 'AA'){
return ($post_items);
}
-function items_get_cluster_items_id_name ($id_cluster,$item_type = 'AA'){
- $items = db_get_all_rows_filter("tcluster_item", array("id_cluster" => $id_cluster,"item_type" => $item_type), array("id"));
+function items_get_cluster_items_id_name ($id_cluster,$item_type = 'AA',$is_critical = '%%'){
+ $items = db_get_all_rows_filter("tcluster_item", array("id_cluster" => $id_cluster,"item_type" => $item_type,"is_critical" => $is_critical), array("id"));
$post_items = array();
@@ -214,4 +214,5 @@ function cluster_get_status ($id_agente){
}
+
?>
\ No newline at end of file
diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php
index 15058a3a4b..0f26670a06 100755
--- a/pandora_console/include/functions_modules.php
+++ b/pandora_console/include/functions_modules.php
@@ -1649,6 +1649,11 @@ function modules_is_unit_macro($macro) {
return false;
}
+function modules_get_last_contact ($id_agentmodule) {
+ return db_get_value ('utimestamp', 'tagente_estado',
+ 'id_agente_modulo', $id_agentmodule);
+}
+
/**
* Get the current value of an agent module.
*
diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css
index 04f11bf691..0b63010b2d 100644
--- a/pandora_console/include/styles/pandora.css
+++ b/pandora_console/include/styles/pandora.css
@@ -4451,3 +4451,11 @@ form ul.form_flex li ul li{
height: 50px;
width: 100%;
}
+
+#modal_module_popup_close:hover{
+ cursor: pointer;
+}
+
+.modal_module_list:hover{
+ cursor: pointer;
+}
\ No newline at end of file
diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql
index 27dbfea739..3f850e0bd0 100644
--- a/pandora_console/pandoradb_data.sql
+++ b/pandora_console/pandoradb_data.sql
@@ -142,7 +142,7 @@ INSERT INTO `tconfig_os` (`id_os`, `name`, `description`, `icon_name`) VALUES
(18, 'Switch', 'Generic switch', 'so_switch.png'),
(19, 'Satellite', 'Satellite agent', 'satellite.png'),
(20, 'Mainframe', 'Mainframe agent', 'so_mainframe.png'),
-(21, 'Cluster', 'Cluster agent', 'so_mainframe.png');
+(21, 'Cluster', 'Cluster agent', 'so_cluster.png');
UNLOCK TABLES;