pandorafms/pandora_console/operation/agentes/status_monitor.php

288 lines
9.7 KiB
PHP
Raw Normal View History

<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2010 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
// 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.
// Load global vars
global $config;
check_login();
2008-08-11 Esteban Sanchez <estebans@artica.es> * include/functions_db.php: Added __ as an alias of lang_string(). * include/functions_reporting_pdf.php, include/functions_reporting.php, include/functions.php, include/functions_visual_map.php, index.php, operation/incidents/incident.php, operation/incidents/incident_detail.php, operation/incidents/incident_note.php, operation/incidents/incident_search.php, operation/incidents/incident_statistics.php, operation/snmpconsole/snmp_alert.php, operation/snmpconsole/snmp_view.php, operation/users/user.php, operation/users/user_edit.php, operation/users/user_statistics.php, operation/events/event_statistics.php, operation/events/events.php, operation/visual_console/render_view.php, operation/visual_console/index.php, operation/extensions.php, operation/agentes/estado_alertas.php, operation/agentes/status_monitor.php, operation/agentes/estado_grupo.php, operation/agentes/export_csv.php, operation/agentes/datos_agente.php, operation/agentes/estado_ultimopaquete.php, operation/agentes/estado_generalagente.php, operation/agentes/estado_agente.php, operation/agentes/bulbs.php, operation/agentes/status_events.php, operation/agentes/sla_view.php, operation/agentes/exportdata.php, operation/agentes/estado_monitores.php, operation/agentes/ver_agente.php, operation/agentes/estadisticas.php, operation/agentes/tactical.php, operation/agentes/networkmap.php, operation/messages/message.php, operation/reporting/reporting_viewer.php, operation/reporting/graph_viewer.php, operation/reporting/custom_reporting.php, operation/servers/view_server.php, operation/servers/view_server_detail.php, operation/menu.php, reporting/fgraph.php, reporting/stat_win.php, ajax.php, general/logoff.php, general/pandora_help.php, general/footer.php, general/noaccess.php, general/logon_failed.php, general/links_menu.php, general/login_page.php, general/logon_ok.php, general/header.php, general/main_menu.php, godmode/groups/configure_group.php, godmode/groups/group_list.php, godmode/setup/news.php, godmode/setup/links.php, godmode/setup/setup.php, godmode/users/user_list.php, godmode/users/configure_user.php, godmode/profiles/profile_list.php, godmode/admin_access_logs.php, godmode/db/db_info_data.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/agent_template.php, godmode/agentes/module_manager_editor_network.php, godmode/agentes/module_manager_editor_wmi.php, godmode/agentes/alert_manager.php, godmode/agentes/module_manager_editor_plugin.php, godmode/agentes/module_manager_editor_prediction.php, godmode/agentes/alert_manager_editor.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor_data.php, godmode/agentes/module_manager.php, godmode/agentes/modificar_agente.php, godmode/agentes/configurar_agente.php, godmode/agentes/agent_disk_conf_editor.php, godmode/agentes/planned_downtime.php, godmode/agentes/manage_config_remote.php, godmode/agentes/agent_manager.php, godmode/modules/manage_network_components_form.php, godmode/modules/manage_nc_groups_form.php, godmode/modules/manage_network_templates.php, godmode/modules/module_list.php, godmode/modules/manage_network_templates_form.php, godmode/modules/manage_network_components_form_network.php, godmode/modules/manage_network_components_form_wmi.php, godmode/modules/manage_network_components.php, godmode/modules/manage_nc_groups.php, godmode/reporting/reporting_builder.php, godmode/reporting/map_builder.php, godmode/reporting/graph_builder.php, godmode/servers/plugin.php, godmode/servers/manage_recontask.php, godmode/servers/modificar_server.php, godmode/servers/manage_recontask_form.php, godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php, godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a instead of $lang_label to future use of gettext. Style corrections. * godmode/agentes/planned_downtime.php: Rewritten to use Pandora functions and adopt the UI style. Replaced lang_string with __(). * pandoradb.sql: Fields in tplanned_downtime renamed to fit guidelines. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
if (! give_acl ($config['id_user'], 0, "AR") && ! give_acl ($config['id_user'], 0, "AW")) {
audit_db ($config['id_user'],$_SERVER['REMOTE_ADDR'], "ACL Violation",
2008-08-11 Esteban Sanchez <estebans@artica.es> * include/functions_db.php: Added __ as an alias of lang_string(). * include/functions_reporting_pdf.php, include/functions_reporting.php, include/functions.php, include/functions_visual_map.php, index.php, operation/incidents/incident.php, operation/incidents/incident_detail.php, operation/incidents/incident_note.php, operation/incidents/incident_search.php, operation/incidents/incident_statistics.php, operation/snmpconsole/snmp_alert.php, operation/snmpconsole/snmp_view.php, operation/users/user.php, operation/users/user_edit.php, operation/users/user_statistics.php, operation/events/event_statistics.php, operation/events/events.php, operation/visual_console/render_view.php, operation/visual_console/index.php, operation/extensions.php, operation/agentes/estado_alertas.php, operation/agentes/status_monitor.php, operation/agentes/estado_grupo.php, operation/agentes/export_csv.php, operation/agentes/datos_agente.php, operation/agentes/estado_ultimopaquete.php, operation/agentes/estado_generalagente.php, operation/agentes/estado_agente.php, operation/agentes/bulbs.php, operation/agentes/status_events.php, operation/agentes/sla_view.php, operation/agentes/exportdata.php, operation/agentes/estado_monitores.php, operation/agentes/ver_agente.php, operation/agentes/estadisticas.php, operation/agentes/tactical.php, operation/agentes/networkmap.php, operation/messages/message.php, operation/reporting/reporting_viewer.php, operation/reporting/graph_viewer.php, operation/reporting/custom_reporting.php, operation/servers/view_server.php, operation/servers/view_server_detail.php, operation/menu.php, reporting/fgraph.php, reporting/stat_win.php, ajax.php, general/logoff.php, general/pandora_help.php, general/footer.php, general/noaccess.php, general/logon_failed.php, general/links_menu.php, general/login_page.php, general/logon_ok.php, general/header.php, general/main_menu.php, godmode/groups/configure_group.php, godmode/groups/group_list.php, godmode/setup/news.php, godmode/setup/links.php, godmode/setup/setup.php, godmode/users/user_list.php, godmode/users/configure_user.php, godmode/profiles/profile_list.php, godmode/admin_access_logs.php, godmode/db/db_info_data.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/agent_template.php, godmode/agentes/module_manager_editor_network.php, godmode/agentes/module_manager_editor_wmi.php, godmode/agentes/alert_manager.php, godmode/agentes/module_manager_editor_plugin.php, godmode/agentes/module_manager_editor_prediction.php, godmode/agentes/alert_manager_editor.php, godmode/agentes/manage_config.php, godmode/agentes/module_manager_editor_data.php, godmode/agentes/module_manager.php, godmode/agentes/modificar_agente.php, godmode/agentes/configurar_agente.php, godmode/agentes/agent_disk_conf_editor.php, godmode/agentes/planned_downtime.php, godmode/agentes/manage_config_remote.php, godmode/agentes/agent_manager.php, godmode/modules/manage_network_components_form.php, godmode/modules/manage_nc_groups_form.php, godmode/modules/manage_network_templates.php, godmode/modules/module_list.php, godmode/modules/manage_network_templates_form.php, godmode/modules/manage_network_components_form_network.php, godmode/modules/manage_network_components_form_wmi.php, godmode/modules/manage_network_components.php, godmode/modules/manage_nc_groups.php, godmode/reporting/reporting_builder.php, godmode/reporting/map_builder.php, godmode/reporting/graph_builder.php, godmode/servers/plugin.php, godmode/servers/manage_recontask.php, godmode/servers/modificar_server.php, godmode/servers/manage_recontask_form.php, godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php, godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a instead of $lang_label to future use of gettext. Style corrections. * godmode/agentes/planned_downtime.php: Rewritten to use Pandora functions and adopt the UI style. Replaced lang_string with __(). * pandoradb.sql: Fields in tplanned_downtime renamed to fit guidelines. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
"Trying to access Agent Management");
require ('general/noaccess.php');
return;
}
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
print_page_header ("Monitor detail", "images/bricks.png", false);
$ag_freestring = get_parameter ('ag_freestring');
$ag_modulename = (string) get_parameter ('ag_modulename');
$ag_group = (int) get_parameter ('ag_group', 0);
$offset = (int) get_parameter ('offset');
$status = (int) get_parameter ('status', 4);
$modulegroup = (int) get_parameter ('modulegroup');
echo '<form method="post" action="index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60">';
echo '<table cellspacing="4" cellpadding="4" width="750" class="databox">';
echo '<tr><td valign="middle">'.__('Group').'</td>';
echo '<td valign="middle">';
2010-07-15 Miguel de Dios <miguel.dedios@artica.es> * include/functions_html.php: added the function "print_select_groups" to print the field select box for groups with tree style. * include/functions_db.php: in function "get_user_groups" added test to false value in parameter $privilege for get all groups without ACL test. Fixed in function "get_user_groups_tree" the call to "get_user_groups" with the correct parameters. * operation/incidents/incident.php, operation/incidents/incident_detail.php, operation/events/events.php, operation/agentes/status_monitor.php, operation/agentes/estado_agente.php, operation/agentes/alerts_status.functions.php, operation/agentes/exportdata.php, operation/agentes/networkmap.php, operation/messages/message.php, general/ui/agents_list.php, godmode/groups/configure_group.php, godmode/groups/group_list.php, godmode/agentes/massive_add_alerts.php, godmode/agentes/massive_delete_agents.php, godmode/agentes/massive_config.php, godmode/agentes/massive_delete_action_alerts.php, godmode/agentes/massive_delete_alerts.php, godmode/agentes/modificar_agente.php, godmode/agentes/massive_delete_modules.php, godmode/agentes/massive_add_action_alerts.php, godmode/agentes/planned_downtime.php, godmode/agentes/manage_config_remote.php, godmode/agentes/agent_manager.php, godmode/servers/manage_recontask_form.php, godmode/alerts/configure_alert_compound.php, godmode/alerts/alert_compounds.php, godmode/alerts/configure_alert_template.php, godmode/alerts/configure_alert_action.php, godmode/setup/gis_step_2.php, godmode/users/configure_user.php, godmode/gis_maps/configure_gis_map.php, godmode/reporting/graph_builder.main.php, godmode/reporting/reporting_builder.main.php, godmode/reporting/visual_console_builder.data.php: changed the fields select box of group to tree style select box for groups. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3009 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-07-15 17:20:43 +02:00
print_select_groups(false, "AR", true, "ag_group", $ag_group, 'this.form.submit();',
'', '0', false, false, false, 'w130', false, 'width:150px;');
echo "</td>";
echo "<td>".__('Monitor status')."</td><td>";
$fields = array ();
$fields[0] = __('Normal');
$fields[1] = __('Warning');
$fields[2] = __('Critical');
$fields[3] = __('Unknown');
$fields[4] = __('Not normal'); //default
$fields[5] = __('Not init');
print_select ($fields, "status", $status, 'this.form.submit();', __('All'), -1, false, false, true, '', false, 'width: 125px;');
echo '</td>';
echo '<td valign="middle">'.__('Module group').'</td>';
echo '<td valign="middle">';
print_select_from_sql ("SELECT * FROM tmodule_group ORDER BY name",
'modulegroup', $modulegroup, '',__('All'), 0, false, false, true, false, 'width: 100px;');
echo '</tr><tr><td valign="middle">'.__('Module name').'</td>';
echo '<td valign="middle">';
$user_groups = implode (",", array_keys (get_user_groups ()));
$user_agents = implode (",", array_keys (get_group_agents($user_groups)));
$modules = get_db_all_rows_filter ('tagente_modulo', array('id_agente' => $user_agents, 'nombre' => '<>delete_pending'), 'DISTINCT(nombre)');
print_select (index_array ($modules, 'nombre', 'nombre'), "ag_modulename",
$ag_modulename, 'this.form.submit();', __('All'), '', false, false, true, '', false, 'width: 150px;');
echo '</td><td valign="middle">'.__('Search').'</td>';
echo '<td valign="middle">';
2009-03-04 Sancho Lerena <slerena@artica.es> * extras/: New directory with extra contents (scripts, tools, samples) * index.php: Add new permission check for /attachment directory. Probably could be extended and wrapped into a function. This should be only called once, this is the reason why is placed here and not in config_process. * pandora_console_upgrade: Force MYSQL run, even if SQL return error (useful for applying over a older 3.0 version for example). * pandoradb_data.sql: Was missing some tconfig variables. * extras/*.sql: Missing somre tconfig variables and other minor issues fixed * extensions/update_manager/main.php: Description of update manager patch wider. Probably needs more formatting in the future. * extras/sample_login.php: Sample on how to implement autologin feature. * footer.php: I hope solve the frakkin image problem. * godmode/agents/agent_manager.php: proper ACL check notice. * godmode/alerts/alert_list.php: Fixed notice. * godmode/reporting/map_builder.php: Added link to wizard and item count. * godmode/reporting/map_builder_wizard.php: Added new feature, a wizard to populate the visual map, using agents from a combo, depending on the map selected. Could have a lot of improvements, it's a basic start. Allow to choose agents and image maps and space between images. Puts in a reticle automatically adjusting at 600px width. * godmode/setup.php: Checkbox for trap_forward was bad, fixed. * config_process.php: Fixed version to 3.0-dev * functions_html.php: Default of 0 in text boxes makes them unusable on default values, funny :-) * include/functions_reporting.php: Fixed a notice on unknown variable on function get_group_stat(). * operation/agentes/alerts_status.php: Filter on module status is made now with combos, like the rest of the filters in the GUI. * operation/events/events.php: a missing div makes graph float outside the filter box. TODO: Hidder filter makes free-width style buggy here. * operation/reporting/reporting_viewer.php: Fixed layout issue. * operation/visual_console/render_view.php: Added ACL check. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1510 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-04 18:57:00 +01:00
print_input_text ("ag_freestring", $ag_freestring, '', 15,30, false);
echo '</td><td valign="middle">';
print_submit_button (__('Show'), "uptbutton", false, 'class="sub search"');
echo "</form>";
echo "</table>";
// Begin Build SQL sentences
$sql = " FROM tagente, tagente_modulo, tagente_estado
WHERE tagente.id_agente = tagente_modulo.id_agente
AND tagente_modulo.disabled = 0
AND tagente.disabled = 0
AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo";
// Agent group selector
if ($ag_group > 0 && give_acl ($config["id_user"], $ag_group, "AR")) {
$sql .= sprintf (" AND tagente.id_grupo = %d", $ag_group);
} else {
// User has explicit permission on group 1 ?
$sql .= " AND tagente.id_grupo IN (".$user_groups.")";
}
// Module group
if ($modulegroup > 0) {
$sql .= sprintf (" AND tagente_modulo.id_module_group = '%d'", $modulegroup);
}
// Module name selector
if ($ag_modulename != "") {
$sql .= sprintf (" AND tagente_modulo.nombre = '%s'", $ag_modulename);
}
// Freestring selector
if ($ag_freestring != "") {
$sql .= sprintf (" AND (tagente.nombre LIKE '%%%s%%' OR tagente_modulo.nombre LIKE '%%%s%%' OR tagente_modulo.descripcion LIKE '%%%s%%')", $ag_freestring, $ag_freestring, $ag_freestring);
}
// Status selector
if ($status == 0) { //Normal
2009-12-1 Sancho Lerena <slerena@artica.es> * include/functions_reporting.php: Fixed some innacurate queries, skipping non-init modules, async modules and keepalive modules. * include/functions_servers.php: Improved LAG calculation algorithm, now is VERY precise. Added performance meter for local & remote checks. * include/config_process.php: error_reporting() has better default values now (skipping notices and non-important messages) for pandora_console.log * include/functions_agents.php: Fixing a problem in an alert SQL on function get_agent_alerts_simple(). * include/functions_db.php: get_server_info() moved to functions_servers.php * operation/events/events.php: Fixed a bug with pagination and other bug with user validated events search. * operation/agentes/status_monitor.php: Better management of async modules, non init and unknown modules. Now works as expected. * operation/agentes/estado_monitores.php: Removed blank space between icons to let table row more compact. * operation/agentes/tactical.php: Added performance information. Removed some information (not used) from snmp and recon servers. * general/header.php: Latest changes here don't work as expected. Rewritten and now works fine (enterprise/open logo in header). * godmode/admin_access_logs.php: Fixed pagination bug in tracker. Added table layout with two alternate colors (rowOdd method). * operation/servers/view_server.php, * godmode/servers/modificar_server.php: Added include to functions_servers.php to use the new server functions, moved from functions_db.php. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2151 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-12-02 00:10:00 +01:00
$sql .= " AND tagente_estado.estado = 0
AND (utimestamp > 0 OR (tagente_modulo.id_tipo_modulo IN(21,22,23,100))) ";
}
elseif ($status == 2) { //Critical
$sql .= " AND tagente_estado.estado = 1 AND utimestamp > 0";
}
elseif ($status == 1) { //Warning
$sql .= " AND tagente_estado.estado = 2 AND utimestamp > 0";
}
elseif ($status == 4) { //Not normal
$sql .= " AND tagente_estado.estado <> 0";
}
elseif ($status == 3) { //Unknown
$sql .= " AND tagente_estado.estado = 3";
}
elseif ($status == 5) { //Not init
$sql .= " AND tagente_estado.utimestamp = 0 AND tagente_modulo.id_tipo_modulo NOT IN (21,22,23,100)";
}
$sql .= " ORDER BY tagente.id_grupo, tagente.nombre";
// Build final SQL sentences
$count = get_db_sql ("SELECT COUNT(tagente_modulo.id_agente_modulo)".$sql);
$sql = "SELECT tagente_modulo.id_agente_modulo,
tagente.intervalo AS agent_interval,
tagente.nombre AS agent_name,
tagente_modulo.nombre AS module_name,
tagente_modulo.id_agente_modulo,
tagente_modulo.history_data,
tagente_modulo.flag AS flag,
tagente.id_grupo AS id_group,
tagente.id_agente AS id_agent,
tagente_modulo.id_tipo_modulo AS module_type,
tagente_modulo.module_interval,
tagente_estado.datos,
tagente_estado.estado,
tagente_estado.utimestamp AS utimestamp".$sql." LIMIT ".$offset.",".$config["block_size"];
$result = get_db_all_rows_sql ($sql);
if ($count > $config["block_size"]) {
pagination ($count, false, $offset);
}
if ($result === false) {
$result = array ();
}
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->width = 750;
$table->class = "databox";
$table->head = array ();
$table->data = array ();
$table->size = array ();
$table->align = array ();
$table->head[1] = __('Agent');
$table->head[2] = __('Type');
$table->align[2] = "left";
2009-06-25 Jorge Gonzalez <jorgegonz@artica.es> * include/functions_db.php, operation/snmpconsole/snmp_view.php, * operation/agentes/status_monitor.php, * operation/agentes/estado_grupo.php, * operation/agentes/estado_ultimopaquete.php, * operation/agentes/alerts_status.php, * operation/agentes/estado_generalagente.php, * operation/agentes/estado_agente.php, * operation/agentes/exportdata.php, * operation/agentes/estado_monitores.php, * operation/agentes/tactical.php, operation/agentes/networkmap.php, * operation/reporting/reporting_viewer.php, reporting/fgraph.php, * general/pandora_help.php, general/logoff.php, * general/logon_failed.php, godmode/setup/setup.php, * godmode/setup/links.php, godmode/snmpconsole/snmp_alert.php, * godmode/profiles/profile_list.php, godmode/db/db_main.php, * godmode/db/db_audit.php, godmode/db/db_refine.php, * godmode/db/db_info.php, godmode/db/db_event.php, * godmode/db/db_purge.php, * godmode/agentes/massive_delete_agents.php, * godmode/agentes/massive_config.php, * godmode/agentes/massive_delete_alerts.php, * godmode/agentes/massive_edit_modules.php, * godmode/agentes/module_manager.php, * godmode/agentes/massive_delete_modules.php, * godmode/agentes/configurar_agente.php, * godmode/agentes/planned_downtime.php, * godmode/modules/manage_network_templates_form.php, * godmode/modules/manage_network_components.php, * godmode/reporting/map_builder.php, * godmode/reporting/map_builder_wizard.php, * godmode/servers/manage_export.php, * godmode/servers/manage_export_form.php, * godmode/servers/plugin.php, godmode/servers/modificar_server.php, * godmode/servers/manage_recontask_form.php, * godmode/alerts/alert_compounds.php, godmode/menu.php: Some * translatable strings reused to simplify i18n work. * include/languages/es.po, include/languages/es.mo: Updated Spanish * translation. * include/languages/index.pot: Updated po template. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1768 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-06-25 10:01:18 +02:00
$table->head[3] = __('Module name');
$table->head[4] = __('Interval');
$table->align[4] = "center";
$table->head[5] = __('Status');
$table->align[5] = "center";
$table->head[6] = __('Graph');
$table->align[6] = "center";
$table->head[7] = __('Data');
$table->align[7] = "left";
$table->head[8] = __('Timestamp');
$table->align[8] = "right";
$rowPair = true;
$iterator = 0;
foreach ($result as $row) {
if ($rowPair)
$table->rowclass[$iterator] = 'rowPair';
else
$table->rowclass[$iterator] = 'rowOdd';
$rowPair = !$rowPair;
$iterator++;
$data = array ();
$data[1] = '<strong><a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$row["id_agent"].'">';
$data[1] .= substr ($row["agent_name"], 0, 25);
$data[1] .= '</a></strong>';
$data[2] = '<img src="images/'.show_icon_type ($row["module_type"]).'" border="0" />';
$data[3] = mb_strimwidth ($row["module_name"], 0, 30);
$data[4] = ($row['module_interval'] == 0) ? $row['agent_interval'] : $row['module_interval'];
if($row['utimestamp'] == 0 && (($row['module_type'] < 21 || $row['module_type'] > 23) && $row['module_type'] != 100)){
$data[5] = print_status_image(STATUS_MODULE_NO_DATA, __('NOT INIT'), true);
} elseif ($row["estado"] == 0) {
$data[5] = print_status_image(STATUS_MODULE_OK, __('NORMAL').": ".$row["datos"], true);
} elseif ($row["estado"] == 1) {
$data[5] = print_status_image(STATUS_MODULE_CRITICAL, __('CRITICAL').": ".$row["datos"], true);
} elseif ($row["estado"] == 2) {
$data[5] = print_status_image(STATUS_MODULE_WARNING, __('WARNING').": ".$row["datos"], true);
} else {
$last_status = get_agentmodule_last_status($row['id_agente_modulo']);
switch($last_status) {
case 0:
$data[5] = print_status_image(STATUS_MODULE_OK, __('UNKNOWN')." - ".__('Last status')." ".__('NORMAL').": ".$row["datos"], true);
break;
case 1:
$data[5] = print_status_image(STATUS_MODULE_CRITICAL, __('UNKNOWN')." - ".__('Last status')." ".__('CRITICAL').": ".$row["datos"], true);
break;
case 2:
$data[5] = print_status_image(STATUS_MODULE_WARNING, __('UNKNOWN')." - ".__('Last status')." ".__('WARNING').": ".$row["datos"], true);
break;
}
}
$data[6] = "";
if ($row['history_data'] == 1){
$graph_type = return_graphtype ($row["module_type"]);
$nombre_tipo_modulo = get_moduletype_name ($row["module_type"]);
$handle = "stat".$nombre_tipo_modulo."_".$row["id_agente_modulo"];
$url = 'include/procesos.php?agente='.$row["id_agente_modulo"];
$win_handle=dechex(crc32($row["id_agente_modulo"].$row["module_name"]));
$link ="winopeng('operation/agentes/stat_win.php?type=$graph_type&period=86400&id=".$row["id_agente_modulo"]."&label=".$row["module_name"]."&refresh=600','day_".$win_handle."')";
$data[6] = '<a href="javascript:'.$link.'"><img src="images/chart_curve.png" border=0></a>';
$data[6] .= "&nbsp;<a href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$row["id_agent"]."&tab=data_view&period=86400&id=".$row["id_agente_modulo"]."'><img border=0 src='images/binary.png'></a>";
}
if (is_numeric($row["datos"]))
$data[7] = format_numeric($row["datos"]);
else
$data[7] = "<span title='".$row['datos']."' style='white-space: nowrap;'>".substr(safe_output($row["datos"]),0,12)."</span>";
if ($row["module_interval"] > 0)
$interval = $row["module_interval"];
else
$interval = $row["agent_interval"];
if ($row['estado'] == 3){
$option = array ("html_attr" => 'class="redb"');
2009-12-1 Sancho Lerena <slerena@artica.es> * include/functions_reporting.php: Fixed some innacurate queries, skipping non-init modules, async modules and keepalive modules. * include/functions_servers.php: Improved LAG calculation algorithm, now is VERY precise. Added performance meter for local & remote checks. * include/config_process.php: error_reporting() has better default values now (skipping notices and non-important messages) for pandora_console.log * include/functions_agents.php: Fixing a problem in an alert SQL on function get_agent_alerts_simple(). * include/functions_db.php: get_server_info() moved to functions_servers.php * operation/events/events.php: Fixed a bug with pagination and other bug with user validated events search. * operation/agentes/status_monitor.php: Better management of async modules, non init and unknown modules. Now works as expected. * operation/agentes/estado_monitores.php: Removed blank space between icons to let table row more compact. * operation/agentes/tactical.php: Added performance information. Removed some information (not used) from snmp and recon servers. * general/header.php: Latest changes here don't work as expected. Rewritten and now works fine (enterprise/open logo in header). * godmode/admin_access_logs.php: Fixed pagination bug in tracker. Added table layout with two alternate colors (rowOdd method). * operation/servers/view_server.php, * godmode/servers/modificar_server.php: Added include to functions_servers.php to use the new server functions, moved from functions_db.php. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2151 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-12-02 00:10:00 +01:00
} else {
$option = array ();
}
$data[8] = print_timestamp ($row["utimestamp"], true, $option);
array_push ($table->data, $data);
}
if (!empty ($table->data)) {
print_table ($table);
} else {
echo '<div class="nf">'.__('This group doesn\'t have any monitor').'</div>';
}
?>