".__('Pandora Agents')." > ".__('Full list of Alerts').""; } $query = sprintf ("SELECT talerta_agente_modulo.* FROM talerta_agente_modulo, tagente_modulo WHERE talerta_agente_modulo.id_agente_modulo = tagente_modulo.id_agente_modulo AND tagente_modulo.id_agente = %d",$id_agente); $result = get_db_all_rows_sql ($query); if ($result !== false) { if (!isset ($_GET["tab"])) { echo "

".__('Full list of Alerts')."

"; } echo ''; echo ""; $color = 1; foreach ($result as $data) { if ($color == 1){ $tdcolor = "datos"; $color = 0; } else { $tdcolor = "datos2"; $color = 1; } echo ""; show_alert_show_view ($data, $tdcolor, 0); echo ""; } // Show combined alerts for this agent $sql = sprintf ("SELECT * FROM talerta_agente_modulo WHERE id_agent = %d",$id_agente); $result = get_db_all_rows_sql ($sql); if ($result !== false) { echo '"; show_alert_show_view ($data, $tdcolor, 1); echo ""; } } echo '
".__('Type')." ".__('Name')." ".__('Description')." ".__('Info')." ".__('Min.')." ".__('Max.')." ".__('Time threshold')." ".__('Last fired')." ".__('Times Fired')." ".__('Status')." ".__('Validate')."
'.__('Combined alerts').'
'; foreach ($result as $data) { //$color comes from the previous one if ($color == 1) { $tdcolor = "datos"; $color = 0; } else { $tdcolor = "datos2"; $color = 1; } echo "
'; } else { echo '
'.__('This agent doesn\'t have any alert').'
'; } // Show alert for no defined agent } else { // ------------------------------- // SHOW ALL ALERTS (GENERAL PAGE) // ------------------------------- echo "

".__('Pandora Agents')." > ".__('Full list of Alerts')."

"; $iduser_temp = $config["id_user"]; $ag_group = get_parameter ("ag_group", -1); if (give_acl ($config["id_user"], $ag_group, "AR") == 0) { audit_db ($config["id_user"], $REMOTE_ADDR, "ACL Violation","Trying to access alert view"); require ("general/noaccess.php"); exit; } if ($ag_group != -1) { echo '
'; } else { echo ''; } echo ''; echo ''; //And finish the table here echo ''; echo ''; echo '
'.__('Group').''; //Select box $fields = get_user_groups ($iduser_temp); print_select ($fields, "ag_group", $ag_group, 'javascript:this.form.submit();" class="w150',''); //And submit button echo ' '.__('Alert fired').' '.__('Alert not fired').'(*) '.__('Combined alert').'
'; // Agent group selector if ($ag_group > 1) { $result = get_agents_in_group ($ag_group); } else { //Fields is an array with all the groups the user has access to $result = get_agents_in_group (array_keys ($fields)); } $color = 1; $string = ''; if ($result === false) { $result = array(); } else { $table->head = array(); //Reset table head $table->head[0] = __('Agent'); $table->head[1] = __('Status'); $table->head[2] = __('Type'); $table->head[3] = __('Description'); $table->head[4] = __('Last fired'); $table->head[5] = __('Times Fired'); $table->align = array(); $table->align[1] = "center"; $table->cellpadding = 4; $table->cellspacing = 4; $table->width = 700; $table->class = "databox"; $table->data = array(); //Reset table data $idx = 0; //row index } //This result is the array with agents foreach ($result as $row) { $id_agente = $row["id_agente"]; $nombre_agente = strtoupper ($row["nombre"]); $result_alerts = get_alerts_in_agent ($id_agente); if ($result_alerts === false) $result_alerts = array(); foreach ($result_alerts as $data) { $table->data[$idx] = array(); //init array $table->data[$idx][0] = ''.$nombre_agente.''; if ($data["times_fired"] != 0) { $table->data[$idx][1] = ''; } else { $table->data[$idx][1] = ''; } $table->data[$idx][2] = dame_nombre_alerta ($data["id_alerta"]); $table->data[$idx][3] = $data["descripcion"]; if ($data["last_fired"] == "0000-00-00 00:00:00") { $table->data[$idx][4] = __('Never'); } else { $table->data[$idx][4] = human_time_comparation ($data["last_fired"]); } $table->data[$idx][5] = $data["times_fired"]; $idx++; //increment the index counter } //end foreach (data) } //end foreach (agent) if (!empty ($result) && !empty ($table->data)) { print_table ($table); } else { echo '
'.__('No agent included in this group has any assigned alert').'
'; } unset ($table); //throw away table } // Main alert view ?>