' . __('Event') . '';
echo '' . __('Type') . ':
';
events_print_type_img ($event["event_type"]);
echo ' ';
if ($event["event_type"] == "system") {
echo __('System');
}
elseif ($event["id_agente"] > 0) {
// Agent name
echo agents_get_name ($event["id_agente"]);
}
else {
echo '';
}
echo '
';
echo '' . __('Timestamp') . ':
';
ui_print_timestamp ($event['utimestamp']);
echo '
';
echo '' . __('Description') . ':
';
echo $event['evento'];
return;
}
if ($validate_event) {
$id = (int) get_parameter ("id");
$similars = (bool) get_parameter ('similars');
$comment = (string) get_parameter ('comment');
$new_status = get_parameter ('new_status');
// Set off the standby mode when close an event
if ($new_status == 1) {
$event = events_get_event ($id);
alerts_agent_module_standby ($event['id_alert_am'], 0);
}
$return = events_change_status ($id, $new_status, $meta);
if ($return)
echo 'ok';
else
echo 'error';
return;
}
if ($delete_event) {
$id = (array) get_parameter ("id");
$similars = (bool) get_parameter ('similars');
$return = events_delete_event ($id, $similars, $meta, $history);
if ($return)
echo 'ok';
else
echo 'error';
return;
}
if ($get_events_fired) {
$id = get_parameter('id_row');
$idGroup = get_parameter('id_group');
$query = ' AND id_evento > ' . $id;
$type = array();
$alert = get_parameter('alert_fired');
if ($alert == 'true') {
$resultAlert = alerts_get_event_status_group($idGroup,
'alert_fired', $query);
}
$critical = get_parameter('critical');
if ($critical == 'true') {
$resultCritical = alerts_get_event_status_group($idGroup,
'going_up_critical', $query);
}
$warning = get_parameter('warning');
if ($warning == 'true') {
$resultWarning = alerts_get_event_status_group($idGroup,
'going_up_warning', $query);
}
if ($resultAlert) {
$return = array('fired' => $resultAlert,
'sound' => $config['sound_alert']);
}
else if ($resultCritical) {
$return = array('fired' => $resultCritical,
'sound' => $config['sound_critical']);
}
else if ($resultWarning) {
$return = array('fired' => $resultWarning,
'sound' => $config['sound_warning']);
}
else {
$return = array('fired' => 0);
}
echo json_encode($return);
}
return;
}
$offset = (int) get_parameter ("offset", 0);
$ev_group = (int) get_parameter ("ev_group", 0); //0 all
$event_type = get_parameter ("event_type", ''); // 0 all
$severity = (int) get_parameter ("severity", -1); // -1 all
$status = (int) get_parameter ("status", 3); // -1 all, 0 only new, 1 only validated, 2 only in process, 3 only not validated,
$id_agent = (int) get_parameter ("id_agent", 0);
$pagination = (int) get_parameter ("pagination", $config["block_size"]);
$event_view_hr = (int) get_parameter ("event_view_hr", $history ? 0 : $config["event_view_hr"]);
$id_user_ack = get_parameter ("id_user_ack", 0);
$group_rep = (int) get_parameter ("group_rep", 1);
$delete = (bool) get_parameter ("delete");
$validate = (bool) get_parameter ("validate", 0);
$section = (string) get_parameter ("section", "list");
$text_agent = (string) get_parameter('text_agent', __("All"));
$filter_only_alert = (int) get_parameter('filter_only_alert', -1);
$filter_id = (int) get_parameter('filter_id', 0);
$id_name = (string) get_parameter('id_name', '');
$id_group = (int) get_parameter('id_group', 0);
$open_filter = (int) get_parameter('open_filter', 0);
$text_agent = (string) get_parameter("text_agent", __("All"));
$tag_with_json = base64_decode(get_parameter("tag_with", '')) ;
$tag_with_json_clean = io_safe_output($tag_with_json);
$tag_with_base64 = base64_encode($tag_with_json_clean);
$tag_with = json_decode($tag_with_json_clean, true);
if (empty($tag_with)) $tag_with = array();
$tag_with = array_diff($tag_with, array(0 => 0));
$tag_without_json = base64_decode(get_parameter("tag_without", ''));
$tag_without_json_clean = io_safe_output($tag_without_json);
$tag_without_base64 = base64_encode($tag_without_json_clean);
$tag_without = json_decode($tag_without_json_clean, true);
if (empty($tag_without)) $tag_without = array();
$tag_without = array_diff($tag_without, array(0 => 0));
$search = io_safe_output(preg_replace ("/&([A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/", "&", rawurldecode (get_parameter ("search"))));
users_get_groups ($config["id_user"], "ER");
$ids = (array) get_parameter ("eventid", -1);
$params = "search=" . rawurlencode(io_safe_input($search)) .
"&event_type=" . $event_type .
"&severity=" . $severity .
"&status=" . $status .
"&ev_group=" . $ev_group .
"&refr=" . $config["refr"] .
"&id_agent=" . $id_agent .
"&pagination=" . $pagination .
"&group_rep=" . $group_rep .
"&event_view_hr=" . $event_view_hr .
"&id_user_ack=" . $id_user_ack .
"&tag_with=". $tag_with_base64 .
"&tag_without=" . $tag_without_base64 .
"&filter_only_alert" . $filter_only_alert .
"&offset=" . $offset .
"&toogle_filter=no" .
"&filter_id=" . $filter_id .
"&id_name=" . $id_name .
"&id_group=" . $id_group .
"&history=" . (int)$history .
"§ion=" . $section .
"&open_filter=" . $open_filter .
"&pure=" . $config["pure"];
if($meta) {
$params .= "&text_agent=" . $text_agent;
}
$url = "index.php?sec=eventos&sec2=operation/events/events&" . $params;
// Header
if ($config["pure"] == 0 || $meta) {
$pss = get_user_info($config['id_user']);
$hashup = md5($config['id_user'] . $pss['password']);
// Fullscreen
$fullscreen['active'] = false;
$fullscreen['text'] = '' .
html_print_image("images/fullscreen.png", true, array ("title" => __('Full screen'))) .'';
// Event list
$list['active'] = false;
$list['text'] = '' .
html_print_image("images/god6.png", true, array("title" => __('Event list'))) . '';
// History event list
$history_list['active'] = false;
$history_list['text'] = '' .
html_print_image("images/books.png", true, array("title" => __('History event list'))) . '';
// RSS
$rss['active'] = false;
$rss['text'] = '' .
html_print_image("images/rss.png", true, array ("title" => __('RSS Events'))) .'';
// Marquee
$marquee['active'] = false;
$marquee['text'] = '' .
html_print_image("images/heart.png", true, array ("title" => __('Marquee display'))) .'';
// CSV
$csv['active'] = false;
$csv['text'] = '' .
html_print_image("images/disk.png", true, array ("title" => __('Export to CSV file'))) .'';
// Sound events
$sound_event['active'] = false;
$sound_event['text'] = '' . html_print_image('images/music_note.png', true, array('title' => __('Sound events'))) . '';
// If the user has administrator permission display manage tab
if (check_acl ($config["id_user"], 0, "EW")) {
// Manage events
$manage_events['active'] = false;
$manage_events['text'] = '' .
html_print_image("images/setup.png", true, array ("title" => __('Manage events'))) . '';
$onheader = array(
'separator' => '',
'fullscreen' => $fullscreen,
'list' => $list,
'history' => $history_list,
'rss' => $rss,
'marquee' => $marquee,
'csv' => $csv,
'sound_event' => $sound_event,
'manage_events' => $manage_events) ;
}
else {
$onheader = array('fullscreen' => $fullscreen,
'list' => $list,
'history' => $history_list,
'rss' => $rss,
'marquee' => $marquee,
'csv' => $csv,
'sound_event' => $sound_event) ;
}
// If the history event is not ebabled, dont show the history tab
if(!isset($config['metaconsole_events_history']) || $config['metaconsole_events_history'] != 1) {
unset($onheader['history']);
}
switch ($section) {
case 'sound_event':
$onheader['sound_event']['active'] = true;
$section_string = __('Sound events');
break;
case 'history':
$onheader['history']['active'] = true;
$section_string = __('History');
break;
default:
$onheader['list']['active'] = true;
$section_string = __('List');
break;
}
if (! defined ('METACONSOLE')) {
unset($onheader['history']);
ui_print_page_header (__("Events"), "images/lightning_go.png",
false, "eventview", false, $onheader);
}
else {
unset($onheader['rss']);
unset($onheader['marquee']);
unset($onheader['csv']);
unset($onheader['sound_event']);
unset($onheader['fullscreen']);
ui_meta_print_header(__("Events"), $section_string, $onheader);
}
?>
" . __('Events') . " » " . __('Main event view') . " ";
echo ui_print_help_icon ("eventview", true);
echo " ";
echo '';
html_print_image ("images/normalscreen.png", false,
array("title" => __('Back to normal mode')));
echo '';
echo "";
}
// Error div for ajax messages
echo "