pandorafms/pandora_console/operation/agentes/alerts_status.php

719 lines
23 KiB
PHP
Raw Normal View History

<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
2008-04-03 Sancho Lerena <slerena@gmail.com> * pandoradb_data.sql: IA to prediction in description. * pandoradb.sql: Added priority to alert and custom recovery fields. * include/styles/tip.css, include/styles/pandora.css: New styles for tooltip info (combined and alerts) and some changes in frames for agent management / view. * include/functions_db.php: Added check_server_status() function to check from console server status. If in 15 minutes there is no updated keepalive from any server, they will be marked as down. And function return down. This function is now called on each page. Added funtions to display alert status in a tooltip. * include/languages/language_en.php: More strings. * include/functions.php: Added several funtions to simplify alert report. * operation/agentes/estado_alertas.php: Updated. Shows also combined alerts and give a lot of information in different tooltips. * operation/agentes/estado_ultimopaquete.php: Clean blank spaces in URL. * operation/agentes/estado_monitores.php: now is possible to force a module refresh from main view. * operation/agentes/ver_agente.php: Tab has been upgraded. * images/mod_data.png, images/mod_data_inc.png images/mod_proc.png images/mod_keepalive.png images/mod_string.png: Added new type icons and updated old ones. * general/header.php: Global check for servers and autorefresh control. * godmode/agentes/alert_manager.php: New alert management for combined alerts, visualization, etc. * godmode/agentes/configurar_agente.php: Included new alert management. * godmode/agentes/alert_manager_editor.php: New alert management editor. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@791 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-04-03 17:43:34 +02:00
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
// Login check
check_login();
2007-04-19 Sancho Lerena <slerena@artica.es> * pandora.css: added some classes for graphical input buttons. * languages/language_en.php: More strings to go ! * include/config.php: Deleted from repo, now has no sense. * pandoradb.sql: Added `alert_text` to talerta_agent for new text alerts. Added tables for custom graphs and reporting: tgraph, tgraph_source, treport, and treport_content. * operation/users/user.php: Fixed problem with last Raul's commit. * godmode/usuarios/lista_usuarios.php: Fixed problem with last Raul's commit. * operation/agentes/estado_alertas.php: Code cleanup. Implemented render for text alerts. * operation/agentes/datos_agente.php: Fixed small bug with text output. * operation/agentes/datos_agente_calendar.php: Added contribution from Leandro Doctors. Need to work on it before use several problems detected. * operation/servers/view_server.php: Fixed some bugs. * operation/reporting/graph_viewer.php: Added viewer for custom graphs. * operation/reporting/custom_reporting.php: Initial code, not finished yet. * operation/reporting/graph_builder.php: Work for modules in the same agent, several problems, but works. * operation/menu.php: Updated options for new reporting menu. * reporting/stat_win.php: New menu is great :-) * general/login_page.php: Updated login page. * godmode/agentes/alert_manager.php, configurar_agente.php: New code for text alerts and better user help. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@433 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-04-19 20:50:07 +02:00
2012-07-10 Miguel de Dios <miguel.dedios@artica.es> * install.php, operation/reporting/reporting_xml.php, operation/netflow/nf_live_view.php, operation/netflow/nf_view.php, operation/tree.php, operation/agentes/gis_view.php, operation/agentes/estado_monitores.php, operation/agentes/networkmap.php, operation/agentes/datos_agente.php, operation/agentes/alerts_status.php, operation/menu.php, operation/snmpconsole/snmp_view.php, operation/users/user_edit.php, godmode/groups/configure_group.php, godmode/groups/configure_modu_group.php, godmode/agentes/module_manager_editor_prediction.php, godmode/servers/manage_recontask.php, godmode/alerts/alert_compounds.php, godmode/alerts/configure_alert_template.php, godmode/alerts/alert_special_days.php, godmode/setup/links.php, godmode/setup/os.php, godmode/users/configure_profile.php, godmode/events/events.php, godmode/massive/massive_delete_modules.php, godmode/massive/massive_edit_modules.php, godmode/massive/massive_standby_alerts.php, godmode/massive/massive_add_action_alerts.php, godmode/massive/massive_enable_disable_alerts.php, godmode/massive/massive_operations.php, godmode/massive/massive_delete_profiles.php, godmode/modules/manage_network_components.php, godmode/modules/manage_nc_groups.php, godmode/reporting/graph_builder.php, godmode/reporting/reporting_builder.item_editor.php, include/functions_menu.php, include/functions_visual_map.php, include/functions_db.php: cleaned source code style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
if (is_ajax()) {
include_once 'include/functions_reporting.php';
$get_alert_fired = get_parameter('get_alert_fired', 0);
if ($get_alert_fired) {
// Calculate alerts fired
$data_reporting = reporting_get_group_stats();
echo $data_reporting['monitor_alerts_fired'];
}
return;
}
require_once $config['homedir'].'/include/functions_agents.php';
require_once $config['homedir'].'/operation/agentes/alerts_status.functions.php';
require_once $config['homedir'].'/include/functions_users.php';
$isFunctionPolicies = enterprise_include_once('include/functions_policies.php');
2009-01-15 Esteban Sanchez <estebans@artica.es> * include/styles/menu.css: Changed the z-index property of the menu which was overlapped in some cases. * include/functions.php: format_alert_row() moved to functions_ui.php * include/functions_ui.php: Added format_alert_row() from function.php * include/functions_agents.php: Added to repository. * include/functions_alerts.php: Added new functions get_alerts_agent_module_disabled(), set_alerts_agent_module_force_execution(), get_alerts_agent_module_last_fired(). * include/functions_db.php, operation/agentes/estado_agente.php, operation/agentes/networkmap.php: Style correction. * include/functions_reporting.php: Use new functions_agent.php. Added a bit of documentation and style correction. * godmode/alerts/alert_templates.php: Improved a bit the template tooltip. * operation/agentes/alerts_status.php: Added to repository. New interface to list agent alerts. * operation/agentes/estado_alertas.php: Removed from repository. Replaced by alert_status.php. * operation/agentes/ver_agente.php: Removed flag_alert code snippet. Use new files added. Style correction. * operation/menu.php: Old files references replaced by new ones. * index.php: Removed build and pandora version references. * pandoradb.sql: Removed useless module_type field in talert_templates. * pandoradb_migrate_20_to_21.sql: Removed duplicate fields addition. Fixed some warnings. Added custom_id field to tagente. Style correction. * include/config_process.php: Updated build version. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1344 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-15 11:21:38 +01:00
2015-01-15 18:08:58 +01:00
$strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']);
$filter = get_parameter('filter', 'all_enabled');
$filter_standby = get_parameter('filter_standby', 'all');
$offset_simple = (int) get_parameter_get('offset_simple', 0);
$id_group = (int) get_parameter('ag_group', 0);
// 0 is the All group (selects all groups)
$free_search = get_parameter('free_search', '');
2017-12-11 16:07:39 +01:00
$user_tag_array = tags_get_user_tags($config['id_user'], 'AR', true);
2017-12-11 16:07:39 +01:00
2018-02-26 13:42:28 +01:00
if ($user_tag_array) {
$user_tag_array = array_values(array_keys($user_tag_array));
$user_tag = '';
foreach ($user_tag_array as $key => $value) {
if ($value === end($user_tag_array)) {
$user_tag .= $value;
} else {
$user_tag .= $value.',';
}
}
$tag_filter = get_parameter('tag_filter', $user_tag);
$tag_param_validate = explode(',', $tag_filter);
foreach ($tag_param_validate as $key => $value) {
if (!in_array($value, $user_tag_array)) {
db_pandora_audit(
'ACL Violation',
'Trying to access Alert view'
);
include 'general/noaccess.php';
exit;
}
}
2018-02-26 13:42:28 +01:00
} else {
$tag_filter = get_parameter('tag_filter', 0);
2017-12-11 16:07:39 +01:00
}
2015-01-15 18:08:58 +01:00
if ($tag_filter) {
if ($id_group && $strict_user) {
$tag_filter = 0;
}
2015-01-15 18:08:58 +01:00
}
2007-04-19 Sancho Lerena <slerena@artica.es> * pandora.css: added some classes for graphical input buttons. * languages/language_en.php: More strings to go ! * include/config.php: Deleted from repo, now has no sense. * pandoradb.sql: Added `alert_text` to talerta_agent for new text alerts. Added tables for custom graphs and reporting: tgraph, tgraph_source, treport, and treport_content. * operation/users/user.php: Fixed problem with last Raul's commit. * godmode/usuarios/lista_usuarios.php: Fixed problem with last Raul's commit. * operation/agentes/estado_alertas.php: Code cleanup. Implemented render for text alerts. * operation/agentes/datos_agente.php: Fixed small bug with text output. * operation/agentes/datos_agente_calendar.php: Added contribution from Leandro Doctors. Need to work on it before use several problems detected. * operation/servers/view_server.php: Fixed some bugs. * operation/reporting/graph_viewer.php: Added viewer for custom graphs. * operation/reporting/custom_reporting.php: Initial code, not finished yet. * operation/reporting/graph_builder.php: Work for modules in the same agent, several problems, but works. * operation/menu.php: Updated options for new reporting menu. * reporting/stat_win.php: New menu is great :-) * general/login_page.php: Updated login page. * godmode/agentes/alert_manager.php, configurar_agente.php: New code for text alerts and better user help. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@433 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-04-19 20:50:07 +02:00
$action_filter = get_parameter('action_filter', 0);
2016-06-28 14:55:13 +02:00
$sec2 = get_parameter_get('sec2');
$sec2 = safe_url_extraclean($sec2);
2012-07-10 Miguel de Dios <miguel.dedios@artica.es> * install.php, operation/reporting/reporting_xml.php, operation/netflow/nf_live_view.php, operation/netflow/nf_view.php, operation/tree.php, operation/agentes/gis_view.php, operation/agentes/estado_monitores.php, operation/agentes/networkmap.php, operation/agentes/datos_agente.php, operation/agentes/alerts_status.php, operation/menu.php, operation/snmpconsole/snmp_view.php, operation/users/user_edit.php, godmode/groups/configure_group.php, godmode/groups/configure_modu_group.php, godmode/agentes/module_manager_editor_prediction.php, godmode/servers/manage_recontask.php, godmode/alerts/alert_compounds.php, godmode/alerts/configure_alert_template.php, godmode/alerts/alert_special_days.php, godmode/setup/links.php, godmode/setup/os.php, godmode/users/configure_profile.php, godmode/events/events.php, godmode/massive/massive_delete_modules.php, godmode/massive/massive_edit_modules.php, godmode/massive/massive_standby_alerts.php, godmode/massive/massive_add_action_alerts.php, godmode/massive/massive_enable_disable_alerts.php, godmode/massive/massive_operations.php, godmode/massive/massive_delete_profiles.php, godmode/modules/manage_network_components.php, godmode/modules/manage_nc_groups.php, godmode/reporting/graph_builder.php, godmode/reporting/reporting_builder.item_editor.php, include/functions_menu.php, include/functions_visual_map.php, include/functions_db.php: cleaned source code style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6759 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-10 12:38:02 +02:00
$sec = get_parameter_get('sec');
$sec = safe_url_extraclean($sec);
$flag_alert = (bool) get_parameter('force_execution', 0);
$alert_validate = (bool) get_parameter('alert_validate', 0);
$tab = get_parameter_get('tab', null);
$refr = (int) get_parameter('refr', 0);
$pure = get_parameter('pure', 0);
2015-01-15 18:08:58 +01:00
$url = 'index.php?sec='.$sec.'&sec2='.$sec2.'&refr='.$refr.'&filter='.$filter.'&filter_standby='.$filter_standby.'&ag_group='.$id_group.'&tag_filter='.$tag_filter.'&action_filter='.$action_filter;
if ($flag_alert == 1 && check_acl($config['id_user'], $id_group, 'AW')) {
forceExecution($id_group);
2009-01-15 Esteban Sanchez <estebans@artica.es> * include/styles/menu.css: Changed the z-index property of the menu which was overlapped in some cases. * include/functions.php: format_alert_row() moved to functions_ui.php * include/functions_ui.php: Added format_alert_row() from function.php * include/functions_agents.php: Added to repository. * include/functions_alerts.php: Added new functions get_alerts_agent_module_disabled(), set_alerts_agent_module_force_execution(), get_alerts_agent_module_last_fired(). * include/functions_db.php, operation/agentes/estado_agente.php, operation/agentes/networkmap.php: Style correction. * include/functions_reporting.php: Use new functions_agent.php. Added a bit of documentation and style correction. * godmode/alerts/alert_templates.php: Improved a bit the template tooltip. * operation/agentes/alerts_status.php: Added to repository. New interface to list agent alerts. * operation/agentes/estado_alertas.php: Removed from repository. Replaced by alert_status.php. * operation/agentes/ver_agente.php: Removed flag_alert code snippet. Use new files added. Style correction. * operation/menu.php: Old files references replaced by new ones. * index.php: Removed build and pandora version references. * pandoradb.sql: Removed useless module_type field in talert_templates. * pandoradb_migrate_20_to_21.sql: Removed duplicate fields addition. Fixed some warnings. Added custom_id field to tagente. Style correction. * include/config_process.php: Updated build version. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1344 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-15 11:21:38 +01:00
}
$idAgent = get_parameter_get('id_agente', 0);
// Show alerts for specific agent
if ($idAgent != 0) {
$url = $url.'&id_agente='.$idAgent;
$id_group = agents_get_agent_group($idAgent);
$is_extra = enterprise_hook(
'policies_is_agent_extra_policy',
[$id_agente]
);
if ($is_extra === ENTERPRISE_NOT_HOOK) {
$is_extra = false;
}
// All groups is calculated in ver_agente.php. Avoid to calculate it again
if (!isset($all_groups)) {
$all_groups = agents_get_all_groups_agent($idAgent, $id_group);
}
if (!check_acl_one_of_groups($config['id_user'], $all_groups, 'AR') && !check_acl_one_of_groups($config['id_user'], $id_group, 'AW') && !$is_extra) {
db_pandora_audit('ACL Violation', 'Trying to access alert view');
include 'general/noaccess.php';
exit;
}
$idGroup = false;
$print_agent = false;
$tab = get_parameter('tab', 'main');
if ($tab == 'main') {
echo "<h4 style='padding-top:0px !important;'>".__('Full list of alerts').'</h4>';
}
} else {
$agent_a = check_acl($config['id_user'], 0, 'AR');
$agent_w = check_acl($config['id_user'], 0, 'AW');
$access = ($agent_a == true) ? 'AR' : (($agent_w == true) ? 'AW' : 'AR');
if (!$agent_a && !$agent_w) {
db_pandora_audit('ACL Violation', 'Trying to access alert view');
include 'general/noaccess.php';
return;
}
$agents = array_keys(
agents_get_group_agents(
array_keys(
users_get_groups($config['id_user'], $access, false)
),
false,
'lower',
true
)
);
$idGroup = $id_group;
// If there is no agent defined, it means that it cannot search for the secondary groups
$all_groups = [$id_group];
$print_agent = true;
if (!is_metaconsole()) {
ui_print_page_header(__('Alert detail'), 'images/op_alerts.png', false, 'alert_validation');
} else {
ui_meta_print_header(__('Alerts view'));
}
}
2007-04-19 Sancho Lerena <slerena@artica.es> * pandora.css: added some classes for graphical input buttons. * languages/language_en.php: More strings to go ! * include/config.php: Deleted from repo, now has no sense. * pandoradb.sql: Added `alert_text` to talerta_agent for new text alerts. Added tables for custom graphs and reporting: tgraph, tgraph_source, treport, and treport_content. * operation/users/user.php: Fixed problem with last Raul's commit. * godmode/usuarios/lista_usuarios.php: Fixed problem with last Raul's commit. * operation/agentes/estado_alertas.php: Code cleanup. Implemented render for text alerts. * operation/agentes/datos_agente.php: Fixed small bug with text output. * operation/agentes/datos_agente_calendar.php: Added contribution from Leandro Doctors. Need to work on it before use several problems detected. * operation/servers/view_server.php: Fixed some bugs. * operation/reporting/graph_viewer.php: Added viewer for custom graphs. * operation/reporting/custom_reporting.php: Initial code, not finished yet. * operation/reporting/graph_builder.php: Work for modules in the same agent, several problems, but works. * operation/menu.php: Updated options for new reporting menu. * reporting/stat_win.php: New menu is great :-) * general/login_page.php: Updated login page. * godmode/agentes/alert_manager.php, configurar_agente.php: New code for text alerts and better user help. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@433 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2007-04-19 20:50:07 +02:00
if ($alert_validate) {
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') || check_acl_one_of_groups($config['id_user'], $all_groups, 'LM')) {
validateAlert();
} else {
ui_print_error_message(__('Insufficient permissions to validate alerts'));
}
}
enterprise_hook('open_meta_frame');
if ($free_search != '') {
$whereAlertSimple = 'AND ('.'id_alert_template IN (
2018-09-13 16:25:53 +02:00
SELECT id
FROM talert_templates
WHERE name LIKE "%'.$free_search.'%") OR '.'id_alert_template IN (
2018-09-13 16:25:53 +02:00
SELECT id
FROM talert_templates
WHERE id_alert_action IN (
SELECT id
FROM talert_actions
WHERE name LIKE "%'.$free_search.'%")) OR '.'talert_template_modules.id IN (
2018-09-13 16:25:53 +02:00
SELECT id_alert_template_module
FROM talert_template_module_actions
WHERE id_alert_action IN (
SELECT id
FROM talert_actions
WHERE name LIKE "%'.$free_search.'%")) OR '.'id_agent_module IN (
2018-09-13 16:25:53 +02:00
SELECT id_agente_modulo
FROM tagente_modulo
WHERE nombre LIKE "%'.$free_search.'%") OR '.'id_agent_module IN (
2018-09-13 16:25:53 +02:00
SELECT id_agente_modulo
FROM tagente_modulo
WHERE id_agente IN (
SELECT id_agente
FROM tagente
WHERE nombre LIKE "%'.$free_search.'%") OR alias LIKE "%'.$free_search.'%")'.')';
} else {
$whereAlertSimple = '';
}
$sortField = get_parameter('sort_field');
$sort = get_parameter('sort', 'none');
$selected = true;
$selectAgentUp = false;
$selectAgentDown = false;
$selectModuleUp = false;
$selectModuleDown = false;
$selectTemplateUp = false;
$selectTemplateDown = false;
switch ($sortField) {
case 'agent':
switch ($sort) {
case 'up':
$selectAgentUp = $selected;
$order = [
'field' => 'agent_name',
'order' => 'ASC',
];
break;
case 'down':
$selectAgentDown = $selected;
$order = [
'field' => 'agent_name',
'order' => 'DESC',
];
break;
}
break;
case 'module':
switch ($sort) {
case 'up':
$selectModuleUp = $selected;
$order = [
'field' => 'agent_module_name',
'order' => 'ASC',
];
break;
case 'down':
$selectModuleDown = $selected;
$order = [
'field' => 'agent_module_name',
'order' => 'DESC',
];
break;
}
break;
case 'template':
switch ($sort) {
case 'up':
$selectTemplateUp = $selected;
$order = [
'field' => 'template_name',
'order' => 'ASC',
];
break;
case 'down':
$selectTemplateDown = $selected;
$order = [
'field' => 'template_name',
'order' => 'DESC',
];
break;
}
break;
default:
if ($print_agent) {
$selectDisabledUp = '';
$selectDisabledDown = '';
$selectAgentUp = false;
$selectAgentDown = false;
$selectModuleUp = $selected;
$selectModuleDown = false;
$selectTemplateUp = false;
$selectTemplateDown = false;
$order = [
'field' => 'agent_module_name',
'order' => 'ASC',
];
} else {
$selectDisabledUp = '';
$selectDisabledDown = '';
$selectAgentUp = false;
$selectAgentDown = false;
$selectModuleUp = $selected;
$selectModuleDown = false;
$selectTemplateUp = false;
$selectTemplateDown = false;
$order = [
'field' => 'agent_module_name',
'order' => 'ASC',
];
}
break;
}
// Add checks for user ACL
$groups = users_get_groups($config['id_user'], $access);
$id_groups = array_keys($groups);
if (empty($id_groups)) {
$whereAlertSimple .= ' AND (1 = 0) ';
} else {
$whereAlertSimple .= sprintf(
' AND id_agent_module IN (
SELECT tam.id_agente_modulo
FROM tagente_modulo tam
WHERE tam.id_agente IN (SELECT ta.id_agente
FROM tagente ta LEFT JOIN tagent_secondary_group tasg ON
ta.id_agente = tasg.id_agent
WHERE (ta.id_grupo IN (%s) OR tasg.id_group IN (%s)))) ',
implode(',', $id_groups),
implode(',', $id_groups)
);
}
$alerts = [];
$options_simple = [
'offset' => $offset_simple,
'limit' => $config['block_size'],
'order' => $order,
];
$filter_alert = [];
2015-06-16 17:53:27 +02:00
if ($filter_standby == 'standby_on') {
$filter_alert['disabled'] = $filter;
$filter_alert['standby'] = '1';
} else if ($filter_standby == 'standby_off') {
$filter_alert['disabled'] = $filter;
$filter_alert['standby'] = '0';
} else {
$filter_alert['disabled'] = $filter;
}
2016-09-08 16:06:12 +02:00
if (is_metaconsole()) {
include_once $config['homedir'].'/enterprise/meta/include/functions_alerts_meta.php';
if ($idAgent != 0) {
$alerts['alerts_simple'] = alerts_meta_get_alerts($agents, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user);
$countAlertsSimple = alerts_meta_get_alerts($agents, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user);
} else {
$id_groups = array_keys(
users_get_groups($config['id_user'], 'AR', false)
);
$alerts['alerts_simple'] = alerts_meta_get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter);
$countAlertsSimple = alerts_meta_get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter);
}
} else {
if ($idAgent != 0) {
$alerts['alerts_simple'] = agents_get_alerts_simple($idAgent, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter);
$countAlertsSimple = agents_get_alerts_simple($idAgent, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter);
} else {
$id_groups = array_keys(
users_get_groups($config['id_user'], $access, false)
);
$alerts['alerts_simple'] = get_group_alerts($id_groups, $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup, false, $strict_user, $tag_filter, $action_filter);
$countAlertsSimple = get_group_alerts($id_groups, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true, $strict_user, $tag_filter, $action_filter);
}
}
if ($tab != null) {
$url = $url.'&tab='.$tab;
}
if ($pure) {
$url .= '&pure='.$pure;
}
if ($free_search != '') {
$url .= '&free_search='.$free_search;
}
2010-02-19 Sancho Lerena <slerena@artica.es> * functions_events.php: Fixed typo (switched meaning) in two labels. * include/styles/pandora.css: Changed background color of th default style. * include/functions_reporting.php: Improved function get_group_stats(). Now supports stats from batch-mode and get realtime stats in a more efficient way. Fixed get_fired_alerts_reporting_table() to avoid problems in external reporting (PDF & XML). * include/functions_servers.php: get_server_performance() now uses batch mode stats reporting, and improved also the realtime stats generation. Same with function get_server_info(). * include/functions_config.php: Added new config tokens (not fully implemented yet) for event, trap, strings and audit automatic purge. * include/functions_ui.php: Added new print_page_header() function to set the new standard header in all pages, using the "tabbed" format to show the title, subtitle and other options like help, or custom-tabs for the page * pandoradb.sql: Added tserver.stat_utimestamp field. Added indexes to tsession table. Fixed typo in field name in tgroup_stat: agents_uknown to agents_unknown. * extensions/ext_backup: New directory to place "deleted" extensions. * extensions/dbmanager/dbmanager.css: Table names now are in it's original lowercase/uppercase format. * extensions/dbmanager.php: Updated headers, and now return "empty" when a search is empty, instead "error" as before. * extensions/users_connected.php extensions/module_groups.php extensions/plugin_registration.php extensions/pandora_logs.php operation/incidents/incident.php operation/snmpconsole/snmp_view.php operation/users/user.php operation/users/user_edit.php godmode/agentes/planned_downtime.php operation/events/events.php operation/visual_console/index.php operation/agentes/estado_generalagente.php operation/agentes/estado_agente.php operation/agentes/exportdata.php operation/agentes/ver_agente.php operation/agentes/status_monitor.php operation/agentes/alerts_status.php operation/users/user_statistics.php: Added new header format. * operation/agentes/estado_grupo.php: Removed old group view. * operation/agentes/tactical.php: Adapted to use new realtime/batch statistical system. Placed events above server info. Showing only pending events and other minor changes. * operation/agentes/group_view.php: NEW screen, replacing old one. Probably most ugly, but much more useful than before. * operation/agentes/networkmap.php: Added title. * operation/messages/message.php: Added title and adding some exists in code was missing before. * operation/reporting/reporting_viewer.php: Added title. * operation/reporting/graph_viewer.php: Added title. * operation/reporting/custom_reporting.php: Added title. * operation/servers/view_server.php: * operation/menu.php: Replaced old group view with new (this has english name). Removed autorefresh "by default" in server view. * extras/pandoradb_migrate_v3.0_to_v3.1.sql: Fixed typo. * extras/pandora_diag.php: Minor changes, removed some info and added other. * general/logon_ok.php: Minor aesthetic changes. * general/header.php: Fixed missing ";" * operation/extensions.php, godmode/extensions.php: Added support for delete extensions. * godmode/menu.php: New setup items. * godmode/setup/setup.php, godmode/setup/performance.php, godmode/setup/setup_visuals.php: Reordered setup options, new setup section "Performance", added new performance options to set "realtime" statistics or "batchmode" with it's own interval. Some setup info is now shared with the servers (but it it's any change in setup, servers should be restarted anyway). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2390 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-19 16:16:03 +01:00
// Filter form
2009-01-15 Esteban Sanchez <estebans@artica.es> * include/styles/menu.css: Changed the z-index property of the menu which was overlapped in some cases. * include/functions.php: format_alert_row() moved to functions_ui.php * include/functions_ui.php: Added format_alert_row() from function.php * include/functions_agents.php: Added to repository. * include/functions_alerts.php: Added new functions get_alerts_agent_module_disabled(), set_alerts_agent_module_force_execution(), get_alerts_agent_module_last_fired(). * include/functions_db.php, operation/agentes/estado_agente.php, operation/agentes/networkmap.php: Style correction. * include/functions_reporting.php: Use new functions_agent.php. Added a bit of documentation and style correction. * godmode/alerts/alert_templates.php: Improved a bit the template tooltip. * operation/agentes/alerts_status.php: Added to repository. New interface to list agent alerts. * operation/agentes/estado_alertas.php: Removed from repository. Replaced by alert_status.php. * operation/agentes/ver_agente.php: Removed flag_alert code snippet. Use new files added. Style correction. * operation/menu.php: Old files references replaced by new ones. * index.php: Removed build and pandora version references. * pandoradb.sql: Removed useless module_type field in talert_templates. * pandoradb_migrate_20_to_21.sql: Removed duplicate fields addition. Fixed some warnings. Added custom_id field to tagente. Style correction. * include/config_process.php: Updated build version. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1344 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-15 11:21:38 +01:00
if ($print_agent) {
if (is_metaconsole()) {
ui_toggle(
printFormFilterAlert(
$id_group,
$filter,
$free_search,
$url,
$filter_standby,
$tag_filter,
false,
true,
$strict_user
),
__('Show Options')
);
;
} else {
ui_toggle(
printFormFilterAlert(
$id_group,
$filter,
$free_search,
$url,
$filter_standby,
$tag_filter,
$action_filter,
true,
$strict_user
),
__('Alert control filter'),
__('Toggle filter(s)'),
$access
);
}
}
// Urls to sort the table.
$url_up_agente = $url.'&sort_field=agent&sort=up';
$url_down_agente = $url.'&sort_field=agent&sort=down';
$url_up_module = $url.'&sort_field=module&sort=up';
$url_down_module = $url.'&sort_field=module&sort=down';
$url_up_template = $url.'&sort_field=template&sort=up';
$url_down_template = $url.'&sort_field=template&sort=down';
2015-05-25 13:31:10 +02:00
$table = new stdClass();
$table->width = '100%';
$table->class = 'info_table';
2015-04-21 17:26:20 +02:00
$table->cellpadding = '0';
$table->cellspacing = '0';
$table->size = [];
$table->head = [];
$table->align = [];
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
if ($print_agent) {
if (!is_metaconsole()) {
$table->size[8] = '4%';
if (check_acl($config['id_user'], $id_group, 'LW') || check_acl($config['id_user'], $id_group, 'LM')) {
$table->head[9] = html_print_checkbox('all_validate', 0, false, true, false);
$table->align[9] = 'left';
$table->size[9] = '5%';
}
}
$table->head[0] = "<span title='".__('Policy')."'>".__('P.').'</span>';
$table->head[1] = "<span title='".__('Standby')."'>".__('S.').'</span>';
if (!is_metaconsole()) {
if (check_acl($config['id_user'], $id_group, 'AW') || check_acl($config['id_user'], $id_group, 'LM')) {
$table->head[2] = "<span title='".__('Force execution')."'>".__('F.').'</span>';
}
}
$table->head[3] = __('Agent');
$table->head[4] = __('Module');
$table->head[5] = __('Template');
$table->head[6] = __('Action');
$table->head[7] = __('Last fired');
$table->head[8] = __('Status');
$table->align[8] = 'center';
// Sort buttons are only for normal console
if (!is_metaconsole()) {
$table->head[3] .= ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectAgentUp, $selectAgentDown);
$table->head[4] .= ui_get_sorting_arrows($url_up_module, $url_down_module, $selectModuleUp, $selectModuleDown);
$table->head[5] .= ui_get_sorting_arrows($url_up_template, $url_down_template, $selectTemplateUp, $selectTemplateDown);
}
} else {
if (!is_metaconsole()) {
$table->size[7] = '5%';
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LW') || check_acl_one_of_groups($config['id_user'], $all_groups, 'LM')) {
$table->head[8] = __('Validate');
$table->align[8] = 'left';
$table->size[8] = '5%';
}
}
$table->head[0] = "<span title='".__('Policy')."'>".__('P.').'</span>';
$table->head[1] = "<span title='".__('Standby')."'>".__('S.').'</span>';
if (!is_metaconsole()) {
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') || check_acl_one_of_groups($config['id_user'], $all_groups, 'LM')) {
$table->head[2] = "<span title='".__('Force execution')."'>".__('F.').'</span>';
}
}
$table->head[3] = __('Module');
$table->head[4] = __('Template');
$table->head[5] = __('Action');
$table->head[6] = __('Last fired');
$table->head[7] = __('Status');
$table->align[7] = 'center';
// Sort buttons are only for normal console
if (!is_metaconsole()) {
$table->head[3] .= ui_get_sorting_arrows($url_up_module, $url_down_module, $selectModuleUp, $selectModuleDown);
$table->head[4] .= ui_get_sorting_arrows($url_up_template, $url_down_template, $selectTemplateUp, $selectTemplateDown);
}
}
} else {
if ($print_agent) {
if (!is_metaconsole()) {
$table->size[7] = '5%';
if (check_acl($config['id_user'], $id_group, 'LW') || check_acl($config['id_user'], $id_group, 'LM')) {
$table->head[8] = __('Validate');
$table->align[8] = 'left';
$table->size[8] = '5%';
}
}
$table->head[0] = "<span title='".__('Standby')."'>".__('S.').'</span>';
if (!is_metaconsole()) {
if (check_acl($config['id_user'], $id_group, 'AW') || check_acl($config['id_user'], $id_group, 'LM')) {
$table->head[1] = "<span title='".__('Force execution')."'>".__('F.').'</span>';
}
}
$table->head[2] = __('Agent');
$table->head[3] = __('Module');
$table->head[4] = __('Template');
$table->head[5] = __('Action');
$table->head[6] = __('Last fired');
$table->head[7] = __('Status');
$table->align[7] = 'center';
// Sort buttons are only for normal console
if (!is_metaconsole()) {
$table->head[3] .= ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectAgentUp, $selectAgentDown);
$table->head[4] .= ui_get_sorting_arrows($url_up_module, $url_down_module, $selectModuleUp, $selectModuleDown);
$table->head[5] .= ui_get_sorting_arrows($url_up_template, $url_down_template, $selectTemplateUp, $selectTemplateDown);
}
} else {
if (!is_metaconsole()) {
$table->size[6] = '5%';
if (check_acl($config['id_user'], $id_group, 'LW') || check_acl($config['id_user'], $id_group, 'LM')) {
$table->head[7] = __('Validate');
$table->align[7] = 'left';
$table->size[7] = '5%';
}
}
$table->head[0] = "<span title='".__('Standby')."'>".__('S.').'</span>';
if (!is_metaconsole()) {
if (check_acl($config['id_user'], $id_group, 'AW') || check_acl($config['id_user'], $id_group, 'LM')) {
$table->head[1] = "<span title='".__('Force execution')."'>".__('F.').'</span>';
}
}
$table->head[2] = __('Module');
$table->head[3] = __('Template');
$table->head[4] = __('Action');
$table->head[5] = __('Last fired');
$table->head[6] = __('Status');
$table->align[6] = 'center';
// Sort buttons are only for normal console
if (!is_metaconsole()) {
$table->head[2] .= ui_get_sorting_arrows($url_up_module, $url_down_module, $selectModuleUp, $selectModuleDown);
$table->head[3] .= ui_get_sorting_arrows($url_up_template, $url_down_template, $selectTemplateUp, $selectTemplateDown);
}
}
}
if ($sortField) {
$url .= '&sort_field='.$sortField;
$url .= '&sort='.$sort;
}
$table->data = [];
$rowPair = true;
$iterator = 0;
foreach ($alerts['alerts_simple'] as $alert) {
$row = ui_format_alert_row($alert, $print_agent, $url, 'font-size: 7pt;');
$table->data[] = $row;
}
if (!empty($table->data)) {
echo '<form method="post" action="'.$url.'">';
ui_pagination(
$countAlertsSimple,
$url,
$offset_simple,
0,
false,
'offset_simple'
);
html_print_table($table);
ui_pagination(
$countAlertsSimple,
$url,
$offset_simple,
0,
false,
'offset_simple',
true,
'pagination-bottom'
);
if (!is_metaconsole()) {
if (check_acl($config['id_user'], $id_group, 'AW') || check_acl($config['id_user'], $id_group, 'LM')) {
if (count($alerts['alerts_simple']) > 0) {
echo '<div class="action-buttons" style="width: '.$table->width.';">';
html_print_submit_button(__('Validate'), 'alert_validate', false, 'class="sub ok"', false);
echo '</div>';
}
}
}
echo '</form>';
} else {
ui_print_info_message(['no_close' => true, 'message' => __('No alerts found') ]);
}
// strict user hidden
2015-01-15 18:08:58 +01:00
echo '<div id="strict_hidden" style="display:none;">';
html_print_input_text('strict_user_hidden', $strict_user);
2016-09-08 16:06:12 +02:00
html_print_input_text('is_meta_hidden', (int) is_metaconsole());
2015-01-15 18:08:58 +01:00
echo '</div>';
enterprise_hook('close_meta_frame');
ui_require_css_file('cluetip', 'include/styles/js/');
2011-04-13 Juan Manuel Ramon <juanmanuel.ramon@artica.es> * include/functions_events.php include/functions_html.php include/functions_modules.php include/functions_reporting.php include/functions_filemanager.php include/functions_gis.php include/functions_networkmap.php include/functions_visual_map.php include/ajax/reporting.ajax.php include/help/en/help_timesource.php include/help/es/help_timesource.php include/help/ja/help_timesource.php include/functions_ui.php include/functions.php include/functions_db.php include/functions_ui_renders.php index.php extensions/insert_data.php extensions/system_info.php extensions/extension_uploader.php extensions/pandora_logs.php extensions/agents_modules.php extensions/dbmanager.php extensions/resource_registration.php extensions/resource_exportation.php extensions/users_connected.php extensions/module_groups.php extensions/update_manager/settings.php extensions/update_manager/main.php extensions/plugin_registration.php operation/incidents/incident.php operation/incidents/incident.files.php operation/incidents/incident_detail.php operation/incidents/incident.workunits.php operation/incidents/incident.list.php operation/incidents/incident_statistics.php operation/search_modules.php operation/visual_console/render_view.php operation/visual_console/index.php operation/extensions.php operation/agentes/status_monitor.php operation/agentes/alerts_status.php operation/agentes/datos_agente.php operation/agentes/estado_ultimopaquete.php operation/agentes/custom_fields.php operation/agentes/estado_generalagente.php operation/agentes/networkmap.topology.php operation/agentes/estado_agente.php operation/agentes/alerts_status.functions.php operation/agentes/networkmap.groups.php operation/agentes/bulbs.php operation/agentes/sla_view.php operation/agentes/exportdata.php operation/agentes/gis_view.php operation/agentes/estado_monitores.php operation/agentes/ver_agente.php operation/agentes/graphs.php operation/agentes/agent_fields.php operation/agentes/tactical.php operation/agentes/group_view.php operation/agentes/networkmap.php operation/agentes/stat_win.php operation/servers/view_server.php operation/servers/view_server_detail.php operation/search_agents.php operation/search_graphs.php operation/snmpconsole/snmp_view.php operation/users/user_edit.php operation/gis_maps/render_view.php operation/gis_maps/ajax.php operation/gis_maps/index.php operation/integria_incidents/incident.php operation/integria_incidents/incident.files.php operation/integria_incidents/incident_detail.php operation/integria_incidents/incident.workunits.php operation/integria_incidents/incident.list.php operation/integria_incidents/incident_statistics.php operation/events/event_statistics.php operation/events/events_list.php operation/events/events.php operation/search_alerts.php operation/messages/message.php operation/reporting/reporting_viewer.php operation/reporting/graph_viewer.php operation/reporting/custom_reporting.php operation/search_reports.php operation/search_maps.php operation/search_results.php operation/search_users.php extras/pandora_diag.php mobile/operation/agents/monitor_status.php mobile/operation/agents/view_agents.php mobile/operation/agents/view_alerts.php mobile/operation/events/events.php mobile/operation/servers/view_servers.php mobile/include/functions_web.php general/footer.php general/noaccess.php general/logon_ok.php general/main_menu.php general/ui/agents_list.php general/header.php godmode/groups/modu_group_list.php godmode/groups/configure_group.php godmode/groups/configure_modu_group.php godmode/groups/group_list.php godmode/admin_access_logs.php godmode/db/db_main.php godmode/db/db_audit.php godmode/db/db_sanity.php godmode/db/db_refine.php godmode/db/db_info.php godmode/db/db_event.php godmode/db/db_purge.php godmode/extensions.php godmode/agentes/module_manager_editor_common.php godmode/agentes/module_manager_editor_network.php godmode/agentes/fields_manager.php godmode/agentes/module_manager_editor_wmi.php godmode/agentes/module_manager_editor_plugin.php godmode/agentes/module_manager_editor_prediction.php godmode/agentes/agent_conf_gis.php godmode/agentes/module_manager.php godmode/agentes/modificar_agente.php godmode/agentes/configurar_agente.php godmode/agentes/configure_field.php godmode/agentes/module_manager_editor.php godmode/agentes/planned_downtime.php godmode/agentes/manage_config_remote.php godmode/agentes/agent_manager.php godmode/servers/recon_script.php godmode/servers/plugin.php godmode/servers/manage_recontask.php godmode/servers/modificar_server.php godmode/servers/manage_recontask_form.php godmode/alerts/alert_list.list.php godmode/alerts/configure_alert_compound.php godmode/alerts/alert_compounds.php godmode/alerts/alert_list.php godmode/alerts/configure_alert_template.php godmode/alerts/alert_templates.php godmode/alerts/configure_alert_action.php godmode/alerts/configure_alert_command.php godmode/alerts/alert_actions.php godmode/alerts/alert_list.builder.php godmode/alerts/alert_commands.php godmode/setup/file_manager.php godmode/setup/os.list.php godmode/setup/news.php godmode/setup/gis_step_2.php godmode/setup/links.php godmode/setup/setup.php godmode/setup/os.php godmode/setup/performance.php godmode/setup/setup_auth.php godmode/setup/gis.php godmode/setup/os.builder.php godmode/setup/setup_visuals.php godmode/snmpconsole/snmp_alert.php godmode/snmpconsole/snmp_filters.php godmode/users/user_list.php godmode/users/configure_user.php godmode/users/configure_profile.php godmode/gis_maps/configure_gis_map.php godmode/gis_maps/index.php godmode/massive/massive_add_alerts.php godmode/massive/massive_copy_modules.php godmode/massive/massive_delete_agents.php godmode/massive/massive_enable_disable_alerts.php godmode/massive/massive_operations.php godmode/massive/massive_delete_profiles.php godmode/massive/massive_edit_agents.php godmode/massive/massive_delete_action_alerts.php godmode/massive/massive_delete_modules.php godmode/massive/massive_add_profiles.php godmode/massive/massive_delete_alerts.php godmode/massive/massive_edit_modules.php godmode/massive/massive_standby_alerts.php godmode/massive/massive_add_action_alerts.php godmode/modules/manage_network_templates.php godmode/modules/module_list.php godmode/modules/manage_network_components_form_common.php godmode/modules/manage_network_components_form_network.php godmode/modules/manage_network_templates_form.php godmode/modules/manage_network_components_form_wmi.php godmode/modules/manage_network_components.php godmode/modules/manage_nc_groups.php godmode/modules/manage_network_components_form_plugin.php godmode/reporting/reporting_builder.list_items.php godmode/reporting/visual_console_builder.php godmode/reporting/reporting_builder.preview.php godmode/reporting/visual_console_builder.data.php godmode/reporting/visual_console_builder.elements.php godmode/reporting/graph_builder.php godmode/reporting/visual_console_builder.preview.php godmode/reporting/graph_builder.graph_editor.php godmode/reporting/reporting_builder.php godmode/reporting/visual_console_builder.editor.php godmode/reporting/reporting_builder.item_editor.php godmode/reporting/map_builder.php godmode/reporting/graphs.php godmode/reporting/graph_builder.preview.php: Now all functions of include/functions_ui have ui_ prefix. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4212 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-13 18:11:02 +02:00
ui_require_jquery_file('cluetip');
?>
2009-01-15 Esteban Sanchez <estebans@artica.es> * include/styles/menu.css: Changed the z-index property of the menu which was overlapped in some cases. * include/functions.php: format_alert_row() moved to functions_ui.php * include/functions_ui.php: Added format_alert_row() from function.php * include/functions_agents.php: Added to repository. * include/functions_alerts.php: Added new functions get_alerts_agent_module_disabled(), set_alerts_agent_module_force_execution(), get_alerts_agent_module_last_fired(). * include/functions_db.php, operation/agentes/estado_agente.php, operation/agentes/networkmap.php: Style correction. * include/functions_reporting.php: Use new functions_agent.php. Added a bit of documentation and style correction. * godmode/alerts/alert_templates.php: Improved a bit the template tooltip. * operation/agentes/alerts_status.php: Added to repository. New interface to list agent alerts. * operation/agentes/estado_alertas.php: Removed from repository. Replaced by alert_status.php. * operation/agentes/ver_agente.php: Removed flag_alert code snippet. Use new files added. Style correction. * operation/menu.php: Old files references replaced by new ones. * index.php: Removed build and pandora version references. * pandoradb.sql: Removed useless module_type field in talert_templates. * pandoradb_migrate_20_to_21.sql: Removed duplicate fields addition. Fixed some warnings. Added custom_id field to tagente. Style correction. * include/config_process.php: Updated build version. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1344 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-15 11:21:38 +01:00
<script type="text/javascript">
$(document).ready (function () {
$("a.template_details").cluetip ({
arrows: true,
attribute: 'href',
cluetipClass: 'default'
}).click (function () {
return false;
});
$('[id^=checkbox-validate]').change(function(){
if($(this).parent().parent().hasClass('checkselected')){
$(this).parent().parent().removeClass('checkselected');
}
else{
$(this).parent().parent().addClass('checkselected');
}
});
$('[id^=checkbox-all_validate]').change(function(){
if ($("#checkbox-all_validate").prop("checked")) {
$('[id^=checkbox-validate]').parent().parent().addClass('checkselected');
$('[name^=validate]').prop("checked", true);
}
else{
$('[id^=checkbox-validate]').parent().parent().removeClass('checkselected');
$('[name^=validate]').prop("checked", false);
}
});
});
$('table.alert-status-filter #ag_group').change (function () {
var strict_user = $("#text-strict_user_hidden").val();
var is_meta = $("#text-is_meta_hidden").val();
if (($(this).val() != 0) && (strict_user != 0)) {
$("table.alert-status-filter #tag_filter").hide();
if (is_meta) {
$("table.alert-status-filter #table1-0-4").hide();
} else {
$("table.alert-status-filter #table2-0-4").hide();
}
} else {
$("#tag_filter").show();
if (is_meta) {
$("table.alert-status-filter #table1-0-4").show();
} else {
$("table.alert-status-filter #table2-0-4").show();
}
}
}).change();
2018-09-13 16:25:53 +02:00
</script>