pandorafms/pandora_console/operation/agentes/tactical.php

252 lines
9.9 KiB
PHP
Raw Normal View History

<?php
2008-07-25 Sancho Lerena <slerena@gmail.com> * pandoradb.sql: Added new tables for planned downtimes. * godmode/menu.php: Added entry for manage downtimes. * group_list.php: Stetic changes in table. * modificar_server.php: Fixed timestamp render for start/update timestamp of each server. * functions.php: Minimal estetic changes in help function. * functions_db.php: Change header (Flexible <- Free) * functions_html.php: Now select admits multiselect option. Default class for table render is now databox not databox_color. * AUTHORS: Update list of authors and make a reference to contributors. * function_reporting.php: Header change, updated datetime string format. * language_en.php, language_es_es.php: Changed FREE for Flexible. * pandora.css: Minimal changes. Update color of Monitor count in tactical. * menu.php: Added some new event options: CSV Export, RSS and new marquee event visualizer. * estado_ultimopaquete.php: Header update. * tactical.php: Added link to data module alerts. * ver_agente.php: Fixed a problem in ajax code that was rending bad count of down monitors. Using boolean comparation on result of function get_db_sql(). This kind problem could be in more lines of code. * events.php: New quicklinks to RSS, CSV and Marquee in event viewer. * export_csv.php, events_rss.php: Fixed duped call to function includes. * graph_viewer.php: I hope this fix FINALLY the annoying bug of graph type selector. * visual_console/index.php: Updated header. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@973 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-07-25 20:37:32 +02:00
// Pandora FMS - The Flexible Monitoring System
// ============================================
// Copyright (c) 2004-2008 Sancho Lerena, slerena@gmail.com
// Copyright (c) 2005-2008 Artica Soluciones Tecnologicas, info@artica.es
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
// 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; either version 2
// of the License, or (at your option) any later version.
// 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.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
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
// Load global vars
require_once ("include/config.php");
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
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") != 1) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
"Trying to access Agent view (Grouped)");
require ("general/noaccess.php");
exit;
}
require_once ("include/functions_reporting.php");
//This is an intermediary function to print out a set of cells
//Cells is an array with the explanation, value, link and color
function print_cells_temp ($cells) {
foreach ($cells as $key => $row) {
//Switch class around
$class = (($key % 2) ? "datos2" : "datos");
echo '<tr><td class="'.$class.'"><b>'.$row[0].'</b></td>';
if ($row[1] === 0) {
$row[1] = "-";
}
echo '<td class="'.$class.'" style="text-align:right;"><a class="big_data" href="'.$row["href"].'" style="color: '.$row["color"].';">'.$row[1].'</a></td></tr>';
}
}
echo "<h2>".__('Pandora Agents')." &gt; ".__('Tactical view')."</h2>";
$data = get_group_stats (0);
echo '<div style="width:265px; float:left; padding-right: 40px;" id="leftcolumn">';
2008-07-10 Sancho Lerena <slerena@gmail.com> * include/styles/pandora_red.css: Updated. * include/styles/pandora_black.css: New style with BLACK blackground. * include/styles/pandora.css: Updated. * include/functions_db.php: Added auto order combos and queries. * include/functions_visual_map.php: Added overlap on down elements if there are more than one in the same position (This could allow to cluster elements to shown the down status first). Removed unused code. * operation/events/events.php: Added tooltip for group name. * operation/visual_console/render_view.php: Adjusted controls position. * operation/agentes/status_monitor.php: Added status for unknown monitors. Added some database search improvement. * operation/agentes/sla_view.php: Sorted list of items. * operation/agentes/ver_agente.php: Updated AJAX code for network map detail view of an agent. Added alert data. * operation/agentes/tactical.php: Removed 'fixed' styles, now using CSS. * operation/agentes/networkmap.php: Added ransep and font selectors. Added alert under yellow color. Minor improvements. * operation/reporting/graph_viewer.php: Style update. * operation/menu.php: Visual console maps sort by name * images/background-li.gif: This sould replace <li> image. * general/login_page.php: Added build version on develop mode. * godmode/reporting/map_builder.php: Sorted lists, and shown module name instead description. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@949 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-07-10 13:58:40 +02:00
// Monitor checks
$table->width = "100%";
$table->class = "databox";
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->border = 0;
$table->head = array ();
$table->data = array ();
$table->style = array ();
$table->style[0] = "padding-top:4px; padding-bottom:4px;";
$table->data[0][0] ='<b>'.__('Monitor health').'</b>';
$table->style[1] = "padding-top:4px; padding-bottom:4px;";
$table->data[1][0] = '<img src="reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent='.$data["monitor_health"].'" title="'.$data["monitor_health"].'% '.__('of monitors up').'" />';
$table->style[2] = "padding-top:4px; padding-bottom:4px;";
$table->data[2][0] = '<b>'.__('Data health').'</b>';
$table->style[3] = "padding-top:4px; padding-bottom:4px;";
$table->data[3][0] = '<img src="reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent='.$data["data_health"].'" title="'.$data["data_health"].'% '.__('of data modules up').'" />';
$table->style[4] = "padding-top:4px; padding-bottom:4px;";
$table->data[4][0] = '<b>'.__('Global health').'</b>';
$table->style[5] = "padding-top:4px; padding-bottom:4px;";
$table->data[5][0] = '<img src="reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent='.$data["global_health"].'" title="'.$data["global_health"].'% '.__('of total modules up').'" />';
$table->style[6] = "padding-top:4px; padding-bottom:4px;";
$table->data[6][0] = '<b>'.__('Module sanity').'</b>';
$table->style[7] = "padding-top:4px; padding-bottom:4px;";
$table->data[7][0] = '<img src="reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent='.$data["module_sanity"].'" title="'.$data["module_sanity"].'% '.__('of total modules inited').'" />';
$table->style[8] = "padding-top:4px; padding-bottom:4px;";
$table->data[8][0] = '<b>'.__('Alert level').'</b>';
$table->style[9] = "padding-top:4px; padding-bottom:4px;";
$table->data[9][0] = '<img src="reporting/fgraph.php?tipo=progress&height=20&width=260&mode=0&percent='.$data["alert_level"].'" title="'.$data["alert_level"].'% '.__('of defined alerts not fired').'" />';
print_table ($table);
unset ($table);
echo '<table class="databox" cellpadding="4" cellspacing="4" style="width:100%;">';
echo '<tr><th colspan="2">'.__('Monitor checks').'</th></tr>';
$cells = array ();
$cells[0][0] = __('Monitor checks');
$cells[0][1] = $data["monitor_checks"];
$cells[0]["href"] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=-1"; //All
$cells[0]["color"] = "#000";
$cells[1][0] = __('Monitors good');
$cells[1][1] = $data["monitor_ok"];
$cells[1]["href"] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=1"; //Up
$cells[1]["color"] = "#000";
$cells[2][0] = __('Monitors down');
$cells[2][1] = $data["monitor_down"];
$cells[2]["href"] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=0"; //Down
$cells[2]["color"] = "#f00";
$cells[3][0] = __('Monitors unknown');
$cells[3][1] = $data["monitor_unknown"];
$cells[3]["href"] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=2"; //Unknown
$cells[3]["color"] = "#C0C0C0";
$cells[4][0] = __('Monitors not init');
$cells[4][1] = $data["monitor_not_init"];
$cells[4]["href"] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=2"; //Unknown
$cells[4]["color"] = "#f00";
$cells[5][0] = __('Alerts defined');
$cells[5][1] = $data["monitor_alerts"];
$cells[5]["href"] = "index.php?sec=estado&sec2=operation/agentes/estado_alertas&refr=60"; //All alerts defined
$cells[5]["color"] = "#000";
$cells[6][0] = __('Alerts fired');
$cells[6][1] = $data["monitor_alerts_fired"];
$cells[6]["href"] = "index.php?sec=eventos&sec2=operation/events/events&search=&event_type=alert_fired"; //Fired alert events
$cells[6]["color"] = "#f00";
print_cells_temp ($cells);
echo '<tr><th colspan="2">'.__('Data checks').'</th></tr>';
$cells = array ();
$cells[0][0] = __('Data checks');
$cells[0][1] = $data["data_checks"];
$cells[0]["href"] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=-1"; //All
$cells[0]["color"] = "#000";
$cells[1][0] = __('Data good');
$cells[1][1] = $data["data_ok"];
$cells[1]["href"] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=1"; //Up
$cells[1]["color"] = "#000";
$cells[2][0] = __('Data down');
$cells[2][1] = $data["data_down"];
$cells[2]["href"] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=0"; //Down
$cells[2]["color"] = "#f00";
$cells[3][0] = __('Data unknown');
$cells[3][1] = $data["data_unknown"];
$cells[3]["href"] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=2"; //Unknown
$cells[3]["color"] = "#C0C0C0";
$cells[4][0] = __('Data not init');
$cells[4][1] = $data["data_not_init"];
$cells[4]["href"] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=2"; //Unknown
$cells[4]["color"] = "#f00";
$cells[5][0] = __('Alerts defined');
$cells[5][1] = $data["data_alerts"];
$cells[5]["href"] = "index.php?sec=estado&sec2=operation/agentes/estado_alertas&refr=60"; //All alerts defined
$cells[5]["color"] = "#000";
$cells[6][0] = __('Alerts fired');
$cells[6][1] = $data["data_alerts_fired"];
$cells[6]["href"] = "index.php?sec=eventos&sec2=operation/events/events&search=&event_type=alert_fired"; //Fired alert events
$cells[6]["color"] = "#f00";
print_cells_temp ($cells);
echo '<tr><th colspan="2">'.__('Summary').'</th></tr>';
$cells = array ();
$cells[0][0] = __('Total Agents');
$cells[0][1] = $data["total_agents"];
$cells[0]["color"] = "#000";
$cells[0]["href"] = "index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60";
$cells[1][0] = __('Total Checks');
$cells[1][1] = $data["total_checks"];
$cells[1]["color"] = "#000";
$cells[1]["href"] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=-1";
$cells[2][0] = __('Uninitialized modules');
$cells[2][1] = $data["server_sanity"] . "%";
$cells[2]["color"] = "#000";
$cells[2]["href"] = "index.php?sec=estado_server&sec2=operation/servers/view_server&refr=60";
print_cells_temp ($cells);
echo "</table>";
echo '</div>'; //Left column
echo '<div style="width: 450px; float:left;" id="rightcolumn">';
// Server information
echo '<table class="databox" cellpadding="4" cellspacing="4" style="width:100%;">';
echo '<thead><tr><th colspan="4">'.__('Tactical server information').'</th></tr>';
echo '<tr><th style="font-weight:none;">'.__('Name').'</th><th style="font-weight:none;">'.__('Status').'</th><th style="font-weight:none;">'.__('Load').'</th><th style="font-weight:none;">'.__('Lag').pandora_help ("serverlag", true).'</th></tr></thead><tbody>';
$serverinfo = get_server_info ();
$total_modules = get_agentmodule_count ();
$cells = array ();
foreach ($serverinfo as $server_id => $server_info) {
$data = array ();
$data[0] = $server_info["name"];
if ($server_info["status"] == 0){
$data[1] = '<img src="images/pixel_red.png" width="20" height="20" />';
} else {
$data[1] = '<img src="images/pixel_green.png" width="20" height="20" />';
}
if ($server_info["modules"] > 0 && $total_modules > 0) {
$percent = $server_info["modules"] / ($total_modules / 100);
} else {
$percent = 0;
}
$data[2] = '<img src="reporting/fgraph.php?tipo=progress&percent='.$percent.'&height=18&width=80" title="'.$server_info["modules"]." ".__('of')." ".$total_modules.'" />';
$data[3] = $server_info["lag"]." / ".$server_info["module_lag"];
array_push ($cells, $data);
}
foreach ($cells as $key => $row) {
//Switch class around
$class = (($key % 2) ? "datos2" : "datos");
echo '<tr>
<td class="'.$class.'">'.$row[0].'</td>
<td class="'.$class.'" style="text-align:center;">'.$row[1].'</td>
<td class="'.$class.'" style="text-align:center;">'.$row[2].'</td>
<td class="'.$class.'" style="text-align:right;">'.$row[3].'</td>
</tr>';
}
echo '</tbody></table>';
smal_event_table ("", 10, 450);
echo '</div>';
?>