' . __('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_alias($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'); $agents = get_parameter('agents', null); $query = ' AND id_evento > ' . $id; $type = array(); $alert = get_parameter('alert_fired'); if ($alert == 'true') { $resultAlert = alerts_get_event_status_group($idGroup, array('alert_fired','alert_ceased'), $query, $agents); } $critical = get_parameter('critical'); if ($critical == 'true') { $resultCritical = alerts_get_event_status_group($idGroup, 'going_up_critical', $query, $agents); } $warning = get_parameter('warning'); if ($warning == 'true') { $resultWarning = alerts_get_event_status_group($idGroup, 'going_up_warning', $query, $agents); } $unknown = get_parameter('unknown'); if ($unknown == 'true') { $resultUnknown = alerts_get_event_status_group($idGroup, 'going_unknown', $query, $agents); } if ($resultAlert) { $return = array('fired' => $resultAlert, 'sound' => $config['sound_alert']); $event = events_get_event($resultAlert); $module_name = modules_get_agentmodule_name($event['id_agentmodule']); $agent_name = agents_get_alias($event['id_agente']); $return['message'] = io_safe_output($agent_name) . " - " . __('Alert fired in module ') . io_safe_output($module_name) . " - " . $event['timestamp']; } else if ($resultCritical) { $return = array('fired' => $resultCritical, 'sound' => $config['sound_critical']); $event = events_get_event($resultCritical); $module_name = modules_get_agentmodule_name($event['id_agentmodule']); $agent_name = agents_get_alias($event['id_agente']); $return['message'] = io_safe_output($agent_name) . " - " . __('Module ') . io_safe_output($module_name) . __(' is going to critical') . " - " . $event['timestamp']; } else if ($resultWarning) { $return = array('fired' => $resultWarning, 'sound' => $config['sound_warning']); $event = events_get_event($resultWarning); $module_name = modules_get_agentmodule_name($event['id_agentmodule']); $agent_name = agents_get_alias($event['id_agente']); $return['message'] = io_safe_output($agent_name) . " - " . __('Module ') . io_safe_output($module_name) . __(' is going to warning') . " - " . $event['timestamp']; } else if ($resultUnknown) { $return = array('fired' => $resultUnknown, 'sound' => $config['sound_alert']); $event = events_get_event($resultUnknown); $module_name = modules_get_agentmodule_name($event['id_agentmodule']); $agent_name = agents_get_alias($event['id_agente']); $return['message'] = io_safe_output($agent_name) . " - " . __('Module ') . io_safe_output($module_name) . __(' is going to unknown') . " - " . $event['timestamp']; } else { $return = array('fired' => 0); } echo io_json_mb_encode($return); } return; } enterprise_hook('open_meta_frame'); if (!$meta) { if (isset($config['event_replication']) && $config['event_replication'] == 1) { if ($config['show_events_in_local'] == 0) { db_pandora_audit("ACL Violation", "Trying to access event viewer. View disabled due event replication."); ui_print_info_message(array('message' => __('Event viewer is disabled due event replication. For more information, please contact with the administrator'), 'no_close' => true)); return; } else { $readonly = true; } } } $offset = (int) get_parameter ("offset", 0); $id_group = (int) get_parameter('id_group', 0);//0 all //********************************************************************** // TODO // This code is disabled for to enabled in Pandora 5.1 // but it needs a field in tevent_filter. // //$recursion = (bool)get_parameter('recursion', false); //Flag show in child groups //********************************************************************** $recursion = (bool)get_parameter('recursion', true); //Flag show in child groups $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"); $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', ''); $open_filter = (int) get_parameter('open_filter', 0); $date_from = (string)get_parameter('date_from', ''); $date_to = (string)get_parameter('date_to', ''); $time_from = (string)get_parameter('time_from', ''); $time_to = (string)get_parameter('time_to', ''); $server_id = (int)get_parameter('server_id', 0); $text_agent = (string) get_parameter("text_agent"); $refr = (int) get_parameter ('refresh'); if ($id_agent != 0) { $text_agent = agents_get_alias($id_agent); if ($text_agent == false) { $text_agent = ''; $id_agent = 0; } } else { if (!$meta) { $text_agent = ''; } } $text_module = (string) get_parameter('module_search', ''); $id_agent_module = get_parameter('module_search_hidden', 0); if ($id_agent_module != 0) { $text_module = db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $id_agent_module); if ($text_module == false) { $text_module = ''; } } else { $text_module = ''; } $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 = get_parameter ("search"); users_get_groups ($config["id_user"], "ER"); $ids = (array) get_parameter ("eventid", -1); $params = "search=" . io_safe_input($search) . "&event_type=" . $event_type . "&severity=" . $severity . "&status=" . $status . "&id_group=" . $id_group . "&recursion=" . $recursion . "&refresh=" . (int)get_parameter("refresh", 0) . "&id_agent=" . $id_agent . "&id_agent_module=" . $id_agent_module . "&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 . "&history=" . (int)$history . "&section=" . $section . "&open_filter=" . $open_filter . "&date_from=" . $date_from . "&date_to=" . $date_to . "&time_from=" . $time_from . "&time_to=" . $time_to; if ($meta) { $params .= "&text_agent=" . $text_agent; $params .= "&server_id=" . $server_id; } $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/full_screen.png", true, array ("title" => __('Full screen'))) .''; // Event list $list['active'] = false; $list['text'] = '' . html_print_image("images/events_list.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/csv_mc.png", true, array ("title" => __('Export to CSV file'))) .''; // Sound events $sound_event['active'] = false; $sound_event['text'] = '' . html_print_image('images/sound.png', true, array('title' => __('Sound events'))) . ''; // If the user has administrator permission display manage tab if (check_acl ($config["id_user"], 0, "EW") || check_acl ($config["id_user"], 0, "EM")) { // Manage events $manage_events['active'] = false; $manage_events['text'] = '' . html_print_image("images/setup.png", true, array ("title" => __('Manage events'))) . ''; $manage_events['godmode'] = true; $onheader = array( 'manage_events' => $manage_events, 'fullscreen' => $fullscreen, 'list' => $list, 'history' => $history_list, 'rss' => $rss, 'marquee' => $marquee, 'csv' => $csv, 'sound_event' => $sound_event) ; } 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; } /* Hello there! :) We added some of what seems to be "buggy" messages to the openSource version recently. This is not to force open-source users to move to the enterprise version, this is just to inform people using Pandora FMS open source that it requires skilled people to maintain and keep it running smoothly without professional support. This does not imply open-source version is limited in any way. If you check the recently added code, it contains only warnings and messages, no limitations except one: we removed the option to add custom logo in header. In the Update Manager section, it warns about the 'danger’ of applying automated updates without a proper backup, remembering in the process that the Enterprise version comes with a human-tested package. Maintaining an OpenSource version with more than 500 agents is not so easy, that's why someone using a Pandora with 8000 agents should consider asking for support. It's not a joke, we know of many setups with a huge number of agents, and we hate to hear that “its becoming unstable and slow” :( You can of course remove the warnings, that's why we include the source and do not use any kind of trick. And that's why we added here this comment, to let you know this does not reflect any change in our opensource mentality of does the last 14 years. */ if (! defined ('METACONSOLE')) { unset($onheader['history']); ui_print_page_header (__("Events"), "images/op_events.png", false, "eventview", false, $onheader,true, "eventsmodal"); } 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); } ?> '; echo ''; echo ''; // Floating menu - End ui_require_jquery_file('countdown'); ui_require_css_file('countdown'); } // Error div for ajax messages echo "
"; echo "
"; if (($section == 'validate') && ($ids[0] == -1)) { $section = 'list'; ui_print_error_message (__('No events selected')); } //Process validation (pass array or single value) if ($validate) { $ids = get_parameter ("eventid", -1); $comment = get_parameter ("comment", ''); $new_status = get_parameter ("select_validate", 1); $ids = explode(',',$ids); $standby_alert = (bool) get_parameter("standby-alert"); // Avoid to re-set inprocess events if ($new_status == 2) { foreach ($ids as $key => $id) { $event = events_get_event($id); if ($event['estado'] == 2) { unset($ids[$key]); } } } if (isset($ids[0]) && $ids[0] != -1) { $return = events_change_status ($ids, $new_status, $meta); if ($new_status == 1) { ui_print_result_message ($return, __('Successfully validated'), __('Could not be validated')); } elseif ($new_status == 2) { ui_print_result_message ($return, __('Successfully set in process'), __('Could not be set in process')); } } } //Process deletion (pass array or single value) if ($delete) { $ids = (array) get_parameter ("validate_ids", -1); if ($ids[0] != -1) { $return = events_delete_event ($ids, ($group_rep == 1), $meta); ui_print_result_message ($return, __('Successfully deleted'), __('Could not be deleted')); } require_once($config['homedir'] . '/operation/events/events_list.php'); } else { switch ($section) { case 'list': case 'history': require_once($config['homedir'] . '/operation/events/events_list.php'); break; } } echo "
"; echo "
"; ui_require_jquery_file ('bgiframe'); ui_require_javascript_file('pandora_events'); enterprise_hook('close_meta_frame'); ui_require_javascript_file('wz_jsgraphics'); ui_require_javascript_file('pandora_visual_console'); $ignored_params['refresh']=''; ?>