From e1669ded9d8d73aad703331e92d4ddc7eae61dbf Mon Sep 17 00:00:00 2001
From: enriquecd
Agent alias | -Module name | -Status | -Data | -Graph | -Last contact | -![]() |
-
---|---|---|---|---|---|---|
'.agents_get_alias($key).' | '; - echo ''.modules_get_agentmodule_name($value).' | '; - echo '';
-
- switch (modules_get_agentmodule_last_status($value)) {
- case 1:
-
- echo '![]() ![]() ![]() ![]() ![]() ![]() | ';
-
- echo ''.modules_get_last_value($value).' | '; - - echo '';
- echo '';
- echo '![]() ![]() | ';
- echo ''.date("d/m/Y - H:i:s",modules_get_last_contact($value)).' | '; - echo ''; - echo ' | '; - echo '
"; - - } - else{ - - echo " | ";
-
- }
-
- echo " ";
- echo ' ';
- echo " | ";
-
- echo "";
-
- 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 "".__('CLUSTER STATUS')." ";
-
- $cluster_module_central = db_process_sql('select id_agente_modulo from tagente_modulo where id_agente = (select id_agent from tcluster where id = '.$id_cluster.') and nombre = "Cluster status"');
-
- $cluster_module_central_status = modules_get_agentmodule_last_status($cluster_module_central[0]['id_agente_modulo']);
-
- switch ($cluster_module_central_status) {
- 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;
- }
-
-
-
-
- if($cluster_type[$id_cluster] == 'AP'){
-
-
- echo "";
-
- echo " ";
-
- echo "".__('Balanced modules')." ";
-
- echo " ";
-
- echo "";
-
- $last_update = db_process_sql('select timestamp,id_agente_modulo from tagente_estado where id_agente_modulo = '.$cluster_module_central[0]['id_agente_modulo']);
-
- $last_update_value = $last_update[0]['timestamp'];
-
- $last_update_value_unix = strtotime($last_update_value);
-
- $last_run_difference = '';
-
- $diferencia = time() - $last_update_value_unix;
-
- $last_run_difference_months = 0;
- $last_run_difference_weeks = 0;
- $last_run_difference_days = 0;
- $last_run_difference_minutos = 0;
- $last_run_difference_seconds = 0;
-
- while($diferencia >= 2419200){
- $diferencia -= 2419200;
- $last_run_difference_months++;
- }
-
- while($diferencia >= 604800){
- $diferencia -= 604800;
- $last_run_difference_weeks++;
- }
-
- while($diferencia >= 86400){
- $diferencia -= 86400;
- $last_run_difference_days++;
- }
-
- while($diferencia >= 3600){
- $diferencia -= 3600;
- $last_run_difference_hours++;
- }
-
- while($diferencia >= 60){
- $diferencia -= 60;
- $last_run_difference_minutes++;
- }
-
- $last_run_difference_seconds = $diferencia;
-
- if($last_run_difference_months > 0){
- $last_run_difference .= $last_run_difference_months.'month/s ';
- }
-
- if ($last_run_difference_weeks > 0) {
- $last_run_difference .= $last_run_difference_weeks.' week/s ';
- }
-
- if ($last_run_difference_days > 0) {
- $last_run_difference .= $last_run_difference_days.' day/s ';
- }
-
- if ($last_run_difference_hours > 0) {
- $last_run_difference .= $last_run_difference_hours.' hour/s ';
- }
-
- if ($last_run_difference_minutes > 0) {
- $last_run_difference .= $last_run_difference_minutes.' minute/s ';
- }
-
- $last_run_difference .= $last_run_difference_seconds.' second/s ago';
-
- echo " ";
-
-
- echo "".__('LAST UPDATE')." ";
-
- if($cluster_module_central_status == 4){
- echo "".__('Not init')." ";
- }else{
- echo "".$last_run_difference." ";
- }
-
-
-
- echo "";
-
- echo " ";
-
- echo "".__('Common modules')." ";
-
- echo " ";
-
- echo "";
-
- $id_agent = db_process_sql('select id_agent from tcluster where id = '.$id_cluster);
-
- $id_agent_value = $id_agent[0]['id_agent'];
-
- $table = new stdClass();
- $table->id = 'agent_details';
- $table->width = '100%';
- $table->cellspacing = 0;
- $table->cellpadding = 0;
- $table->class = 'agents';
- $table->style = array_fill(0, 3, 'vertical-align: top;');
-
- $data = array();
- $data[0][0] = html_print_table($table_agent, true);
- $data[0][0] .=
- ' ";
-
-
- echo "
' . html_print_table($table_data, true); - $data[0][1] .= !isset($table_incident) ? - '' : - ' ' . html_print_table($table_incident, true); - - $table->rowspan[1][0] = 0; - - $table->data = $data; - $table->rowclass[] = ''; - - $table->cellstyle[1][0] = 'text-align:center;'; - - html_print_table($table); - $data2[1][0] = !isset($table_interface) ? - '' : - html_print_table($table_interface, true); - $table->data = $data2; - $table->styleTable = ''; - html_print_table($table); - - unset($table); - - echo " | ";
-
- echo "||
";
- echo " ";
- echo " ";
- echo " | ";
- echo "