2006-03-27 05:37:27 +02:00
|
|
|
<?php
|
2008-07-30 20:39:40 +02:00
|
|
|
|
2009-06-08 20:15:58 +02:00
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
2010-05-31 13:41:10 +02:00
|
|
|
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
2009-06-08 20:15:58 +02:00
|
|
|
// Please see http://pandorafms.org for full contribution list
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2008-04-01 15:53:11 +02:00
|
|
|
// 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.
|
2009-06-08 20:15:58 +02:00
|
|
|
|
2006-03-27 05:37:27 +02:00
|
|
|
// Load global vars
|
2010-03-02 20:25:51 +01:00
|
|
|
global $config;
|
|
|
|
|
2009-04-09 23:06:17 +02:00
|
|
|
require_once ("include/functions_reporting.php");
|
2008-07-21 14:23:28 +02:00
|
|
|
check_login ();
|
2006-07-11 10:49:21 +02:00
|
|
|
|
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")) {
|
2010-03-09 13:34:09 +01:00
|
|
|
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 main list view");
|
2008-06-30 10:11:10 +02:00
|
|
|
require ("general/noaccess.php");
|
2009-03-26 16:55:30 +01:00
|
|
|
return;
|
2008-06-30 10:11:10 +02:00
|
|
|
}
|
2007-03-02 18:56:07 +01:00
|
|
|
|
2009-03-02 Esteban Sanchez <estebans@artica.es>
* include/functions_menu.php: Added to repository. Functions for menu.
* operation/menu.php, godmode/menu.php: Added class to menu due to
changes in print_menu().
* general/main_menu.php: temp_print_menu() moved to functions_menu.php
* include/functions_themes.php: Added to repository. Implement
functions relative to themes (only CSS themes list at this moment).
* include/styles/pandora.css, include/styles/pandora_black.css,
include/styles/pandora_minimal.css, include/styles/pandora_red.css:
Added author, name and description comments to adopt to new
get_themes() interface.
* include/styles/pandora_width.css: Improved and make lighter by
simply rewrite some classes.
* include/functions.php: Added is_ajax().
* godmode/agentes/module_manager_editor.php,
godmode/alerts/alert_actions.php, godmode/alerts/alert_commands.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/alert_templates.php, godmode/groups/group_list.php,
godmode/reporting/map_builder.php,
godmode/reporting/reporting_builder.php,
operation/agentes/estado_agente.php, operation/agentes/ver_agente.php,
operation/events/events.php, operation/messages/message.php: Use
is_ajax()
* godmode/setup/setup.php: Use enterprise_include() instead of manual
checking. Use get_css_themes() to show the theme list.
* include/styles/common.css: Added to repository. Minimal styles to
make pandora works and common with all the CSS themes.
* include/functions_ui.php: Added common.css file.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1496 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-02 14:43:15 +01:00
|
|
|
if (is_ajax ()) {
|
2009-02-18 13:29:30 +01:00
|
|
|
$get_agent_module_last_value = (bool) get_parameter ('get_agent_module_last_value');
|
2009-09-10 19:55:44 +02:00
|
|
|
$get_actions_alert_template = (bool) get_parameter("get_actions_alert_template");
|
|
|
|
|
|
|
|
if ($get_actions_alert_template) {
|
|
|
|
$id_template = get_parameter("id_template");
|
|
|
|
$rows = get_db_all_rows_sql("SELECT t1.id, t1.name,
|
|
|
|
(SELECT COUNT(t2.id)
|
|
|
|
FROM talert_templates AS t2
|
|
|
|
WHERE t2.id = " . $id_template . "
|
|
|
|
AND t2.id_alert_action = t1.id) as 'sort_order'
|
|
|
|
FROM talert_actions AS t1
|
|
|
|
ORDER BY sort_order DESC");
|
|
|
|
|
|
|
|
|
2009-09-16 17:38:44 +02:00
|
|
|
if ($rows !== false)
|
|
|
|
echo json_encode($rows);
|
|
|
|
else
|
|
|
|
echo "false";
|
2009-09-10 19:55:44 +02:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2009-02-18 13:29:30 +01:00
|
|
|
|
|
|
|
if ($get_agent_module_last_value) {
|
|
|
|
$id_module = (int) get_parameter ('id_agent_module');
|
|
|
|
|
|
|
|
if (! give_acl ($config['id_user'], get_agentmodule_group ($id_module), "AR")) {
|
2010-03-09 13:34:09 +01:00
|
|
|
audit_db ($config['id_user'], $_SERVER['REMOTE_ADDR'], "ACL Violation",
|
2009-02-18 13:29:30 +01:00
|
|
|
"Trying to access agent main list view");
|
|
|
|
echo json_encode (false);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
echo json_encode (get_agent_module_last_value ($id_module));
|
|
|
|
return;
|
|
|
|
}
|
2009-06-09 13:25:47 +02:00
|
|
|
|
2009-02-18 13:29:30 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-06-30 10:11:10 +02:00
|
|
|
// Take some parameters (GET)
|
|
|
|
$group_id = get_parameter ("group_id", 0);
|
2009-03-25 21:07:09 +01:00
|
|
|
$search = get_parameter ("search", "");
|
2008-01-10 17:40:00 +01:00
|
|
|
|
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 ( __("Agent detail"), "images/bricks.png", false, "agent_status");
|
2008-01-10 17:40:00 +01:00
|
|
|
|
2009-04-21 21:03:16 +02:00
|
|
|
if ($group_id > 1) {
|
2009-05-07 16:44:26 +02:00
|
|
|
echo '<form method="post" action="'.get_url_refresh (array ('group_id' => $group_id)).'">';
|
2008-06-30 10:11:10 +02:00
|
|
|
} else {
|
2009-04-21 21:03:16 +02:00
|
|
|
echo '<form method="post" action="'.get_url_refresh ().'">';
|
2008-06-30 10:11:10 +02:00
|
|
|
}
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2009-04-10 16:03:24 +02:00
|
|
|
echo '<table cellpadding="4" cellspacing="4" class="databox" width="95%">';
|
|
|
|
echo '<tr><td style="white-space:nowrap;">'.__('Group').': ';
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2008-10-23 08:58:38 +02:00
|
|
|
$groups = get_user_groups ();
|
2009-04-21 21:03:16 +02:00
|
|
|
print_select ($groups, 'group_id', $group_id, 'this.form.submit()', '', '');
|
2007-02-22 17:45:10 +01:00
|
|
|
|
2009-04-10 16:03:24 +02:00
|
|
|
echo '</td><td style="white-space:nowrap;">';
|
2009-04-09 23:06:17 +02:00
|
|
|
|
2009-04-10 16:03:24 +02:00
|
|
|
echo __('Free text for search').' (*): ';
|
2009-04-09 23:06:17 +02:00
|
|
|
|
|
|
|
print_input_text ("search", $search, '', 15);
|
2008-01-10 17:40:00 +01:00
|
|
|
|
2009-04-10 16:03:24 +02:00
|
|
|
echo '</td><td style="white-space:nowrap;">';
|
2008-01-10 17:40:00 +01:00
|
|
|
|
2010-05-31 13:41:10 +02:00
|
|
|
print_submit_button (__('Search'), "srcbutton", '', array ("class" => "sub search"));
|
2009-04-09 23:06:17 +02:00
|
|
|
|
2009-04-10 16:03:24 +02:00
|
|
|
echo '</td><td style="width:40%;"> </td></tr></table></form>';
|
2008-01-10 17:40:00 +01:00
|
|
|
|
2008-06-30 10:11:10 +02:00
|
|
|
if ($search != ""){
|
2009-06-08 13:02:45 +02:00
|
|
|
$filter = array ("string" => '%'.$search.'%');
|
2008-06-30 10:11:10 +02:00
|
|
|
} else {
|
2009-06-08 13:02:45 +02:00
|
|
|
$filter = array ();
|
2008-06-30 10:11:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Show only selected groups
|
2010-04-22 18:51:23 +02:00
|
|
|
if ($group_id > 0) {
|
2009-06-08 13:02:45 +02:00
|
|
|
$groups = $group_id;
|
|
|
|
$agent_names = get_group_agents ($group_id, $filter, "upper");
|
2008-06-30 10:11:10 +02:00
|
|
|
// Not selected any specific group
|
|
|
|
} else {
|
2009-04-09 23:06:17 +02:00
|
|
|
$user_group = get_user_groups ($config["id_user"], "AR");
|
2009-06-08 13:02:45 +02:00
|
|
|
$groups = array_keys ($user_group);
|
|
|
|
$agent_names = get_group_agents (array_keys ($user_group), $filter, "upper");
|
2009-04-09 23:06:17 +02:00
|
|
|
}
|
2008-06-09 19:51:18 +02:00
|
|
|
|
2009-06-08 13:02:45 +02:00
|
|
|
$total_agents = 0;
|
|
|
|
$agents = false;
|
|
|
|
if (! empty ($agent_names)) {
|
|
|
|
$total_agents = get_agents (array (//'id_agente' => array_keys ($agent_names),
|
|
|
|
'order' => 'nombre ASC',
|
|
|
|
'id_grupo' => $groups),
|
|
|
|
array ('COUNT(*) as total'));
|
|
|
|
$total_agents = isset ($total_agents[0]['total']) ? $total_agents[0]['total'] : 0;
|
|
|
|
$agents = get_agents (array ('id_agente' => array_keys ($agent_names),
|
|
|
|
'order' => 'nombre ASC',
|
|
|
|
'id_grupo' => $groups,
|
|
|
|
'offset' => (int) get_parameter ('offset'),
|
|
|
|
'limit' => (int) $config['block_size']),
|
|
|
|
array ('id_agente',
|
|
|
|
'id_grupo',
|
|
|
|
'id_os',
|
2010-05-31 13:41:10 +02:00
|
|
|
'ultimo_contacto',
|
2009-06-08 13:02:45 +02:00
|
|
|
'intervalo'));}
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2009-04-09 23:06:17 +02:00
|
|
|
if (empty ($agents)) {
|
|
|
|
$agents = array ();
|
|
|
|
}
|
2008-09-03 14:11:53 +02:00
|
|
|
|
2008-06-30 10:11:10 +02:00
|
|
|
// Prepare pagination
|
2009-06-08 13:02:45 +02:00
|
|
|
pagination ($total_agents, get_url_refresh (array ('group_id' => $group_id, 'search' => $search)));
|
2008-06-30 10:11:10 +02:00
|
|
|
|
|
|
|
// Show data.
|
2009-04-09 23:06:17 +02:00
|
|
|
$table->cellpadding = 4;
|
|
|
|
$table->cellspacing = 4;
|
2009-04-20 16:00:27 +02:00
|
|
|
$table->width = "98%";
|
2009-04-09 23:06:17 +02:00
|
|
|
$table->class = "databox";
|
|
|
|
|
|
|
|
$table->head = array ();
|
|
|
|
$table->head[0] = __('Agent');
|
|
|
|
$table->head[1] = __('OS');
|
|
|
|
$table->head[2] = __('Interval');
|
|
|
|
$table->head[3] = __('Group');
|
|
|
|
$table->head[4] = __('Modules');
|
|
|
|
$table->head[5] = __('Status');
|
|
|
|
$table->head[6] = __('Alerts');
|
|
|
|
$table->head[7] = __('Last contact');
|
|
|
|
|
|
|
|
$table->align = array ();
|
|
|
|
$table->align[1] = "center";
|
|
|
|
$table->align[2] = "center";
|
|
|
|
$table->align[3] = "center";
|
|
|
|
$table->align[4] = "center";
|
|
|
|
$table->align[5] = "center";
|
|
|
|
$table->align[6] = "center";
|
|
|
|
$table->align[7] = "right";
|
|
|
|
|
|
|
|
$table->data = array ();
|
|
|
|
|
2009-08-07 Miguel de Dios <miguel.dedios@artica.es>
* operation/visual_console/index.php,
pandora_console/operation/users/user.php, operation/incidents/incident.php,
operation/agentes/status_monitor.php, operation/agentes/estado_agente.php,
operation/agentes/alerts_status.php, include/styles/pandora.css,
include/styles/pandora_black.css,include/styles/pandora_blackmetal.css,
include/styles/pandora_width.css, include/styles/pandora_minimal.css,
include/styles/pandora_red.css: the table list now has rows with alternate
colours for easy see the data.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1833 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-08-10 11:55:53 +02:00
|
|
|
$rowPair = true;
|
|
|
|
$iterator = 0;
|
2009-04-09 23:06:17 +02:00
|
|
|
foreach ($agents as $agent) {
|
2009-08-07 Miguel de Dios <miguel.dedios@artica.es>
* operation/visual_console/index.php,
pandora_console/operation/users/user.php, operation/incidents/incident.php,
operation/agentes/status_monitor.php, operation/agentes/estado_agente.php,
operation/agentes/alerts_status.php, include/styles/pandora.css,
include/styles/pandora_black.css,include/styles/pandora_blackmetal.css,
include/styles/pandora_width.css, include/styles/pandora_minimal.css,
include/styles/pandora_red.css: the table list now has rows with alternate
colours for easy see the data.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1833 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-08-10 11:55:53 +02:00
|
|
|
if ($rowPair)
|
|
|
|
$table->rowclass[$iterator] = 'rowPair';
|
|
|
|
else
|
|
|
|
$table->rowclass[$iterator] = 'rowOdd';
|
|
|
|
$rowPair = !$rowPair;
|
|
|
|
$iterator++;
|
|
|
|
|
2009-04-09 23:06:17 +02:00
|
|
|
$agent_info = get_agent_module_info ($agent["id_agente"]);
|
2008-10-21 14:57:03 +02:00
|
|
|
|
2009-04-09 23:06:17 +02:00
|
|
|
$data = array ();
|
|
|
|
|
|
|
|
$data[0] = '';
|
|
|
|
if (give_acl ($config['id_user'], $agent["id_grupo"], "AW")) {
|
|
|
|
$data[0] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$agent["id_agente"].'">';
|
|
|
|
$data[0] .= print_image ("images/setup.png", true, array ("border" => 0, "width" => 16));
|
|
|
|
$data[0] .= '</a> ';
|
|
|
|
}
|
2008-10-21 14:57:03 +02:00
|
|
|
|
2009-10-13 Sancho Lerena <slerena@artica.es>
Upps, Tuesday #13, bad day for a last commit before launch RC1 ! :-S
* general/logon_ok.php: Fixed ugly format of table showing last activity
(has a too wide table width).
* godmode/admin_access_logs.php: Removed that crappy div fashion code and
replaced by old and reliable table-based-code :-) to fix the mess with the
pagination.
* godmode/agentes/configurar_agente.php: fixed problem with postprocess
values very bug (like 0.0000000123), parameter is now passed as string
because PHP is passing the value as scientific notation and mYsql don't
understand that.
* operation/agentes/exportdata.php,
* operation/search_results.php,
* godmode/reporting/map_builder.php,
* godmode/agentes/agent_manager.php,
* godmode/reporting/graph_builder.php,
* godmode/agentes/modificar_agente.php: Added non-case search SQL code for make
agent searches non case sensitive (nombre COLLATE utf8_general_ci LIKE...)
* module_manager_editor_common.php: More size for postprocess field.
* pandora_console/godmode/alerts/configure_alert_action.php: More width for
field2 in action form.
* godmode/alerts/configure_alert_command.php: Command field has more width
and added a help icon for macro subtitutions.
* include/functions_db.php: get_agent_name() now defaults to non uppercase
the agent names, because 3.0 has case sensitive agent names, and all
data must show the real Case.
* include/styles/pandora.css: removed uppercase transition for menu items
and agent tabs.
* operation/agentes/estado_agente.php: Agent is not shown in uppercase
anymore.
* operation/agentes/estado_generalagente.php: Agent name and parent name
is not in uppercase. OS version shows only last 15 characters or full string
if strlen() < 15.
* operation/agentes/status_monitor.php: Agent name is not in uppercase
anymore.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2015 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-10-13 20:59:48 +02:00
|
|
|
$data[0] .= print_agent_name ($agent["id_agente"], true, "none");
|
2009-04-06 13:02:05 +02:00
|
|
|
|
2009-04-09 23:06:17 +02:00
|
|
|
$data[1] = print_os_icon ($agent["id_os"], false, true);
|
2009-04-06 13:02:05 +02:00
|
|
|
|
2009-10-06 21:54:50 +02:00
|
|
|
//The interval we are thinking that it must be the agent interval in this
|
|
|
|
//cell and it'snt the interval of modules.
|
|
|
|
// if ($agent_info["interval"] > $agent["intervalo"]) {
|
|
|
|
// $data[2] = '<span class="green">'.$agent_info["interval"].'</span>';
|
|
|
|
// } else {
|
|
|
|
// $data[2] = $agent["intervalo"];
|
|
|
|
// }
|
|
|
|
$data[2] = $agent["intervalo"];
|
2009-04-09 23:06:17 +02:00
|
|
|
|
|
|
|
$data[3] = print_group_icon ($agent["id_grupo"], true);
|
|
|
|
|
|
|
|
$data[4] = '<b>';
|
|
|
|
$data[4] .= $agent_info["modules"];
|
2010-02-01 19:01:05 +01:00
|
|
|
|
2009-04-18 16:35:53 +02:00
|
|
|
if ($agent_info["monitor_critical"] > 0)
|
|
|
|
$data[4] .= ' : <span class="red">'.$agent_info["monitor_critical"].'</span>';
|
2010-02-01 19:01:05 +01:00
|
|
|
if ($agent_info["monitor_warning"] > 0)
|
|
|
|
$data[4] .= ' : <span class="yellow">'.$agent_info["monitor_warning"].'</span>';
|
|
|
|
if ($agent_info["monitor_normal"] > 0)
|
|
|
|
$data[4] .= ' : <span class="green">'.$agent_info["monitor_normal"].'</span>';
|
2009-04-18 16:35:53 +02:00
|
|
|
if ($agent_info["monitor_down"] > 0)
|
|
|
|
$data[4] .= ' : <span class="grey">'.$agent_info["monitor_down"].'</span>';
|
2010-02-01 19:01:05 +01:00
|
|
|
$data[4] .= '</b>';
|
|
|
|
|
2009-04-09 23:06:17 +02:00
|
|
|
$data[5] = $agent_info["status_img"];
|
|
|
|
|
|
|
|
$data[6] = $agent_info["alert_img"];
|
2010-03-04 21:02:29 +01:00
|
|
|
|
|
|
|
|
2010-05-31 13:41:10 +02:00
|
|
|
$last_time = strtotime ($agent["ultimo_contacto"]);
|
2010-03-04 21:02:29 +01:00
|
|
|
$now = time ();
|
|
|
|
$diferencia = $now - $last_time;
|
|
|
|
$time = print_timestamp ($last_time, true);
|
|
|
|
$style = '';
|
|
|
|
if ($diferencia > ($agent["intervalo"] * 2))
|
2010-05-31 13:41:10 +02:00
|
|
|
$data[7] = '<b><span style="color: #ff0000">'.$time.'</span></b>';
|
|
|
|
else
|
|
|
|
$data[7] = $time;
|
2010-03-04 21:02:29 +01:00
|
|
|
|
2010-05-31 13:41:10 +02:00
|
|
|
// This old code was returning "never" on agents without modules, BAD !!
|
|
|
|
// And does not print outdated agents in red. WRONG !!!!
|
|
|
|
// $data[7] = print_timestamp ($agent_info["last_contact"], true);
|
2010-03-04 21:02:29 +01:00
|
|
|
|
2009-04-09 23:06:17 +02:00
|
|
|
array_push ($table->data, $data);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!empty ($table->data)) {
|
|
|
|
print_table ($table);
|
|
|
|
unset ($table);
|
2008-06-30 10:11:10 +02:00
|
|
|
} else {
|
2009-04-09 23:06:17 +02:00
|
|
|
echo '<div class="nf">'.__('There are no agents included in this group').'</div>';
|
|
|
|
}
|
|
|
|
|
2009-08-06 20:55:54 +02:00
|
|
|
/* Godmode controls SHOULD NOT BE HERE
|
|
|
|
|
2009-04-09 23:06:17 +02:00
|
|
|
if (give_acl ($config['id_user'], 0, "LM") || give_acl ($config['id_user'], 0, "AW")
|
|
|
|
|| give_acl ($config['id_user'], 0, "PM") || give_acl ($config['id_user'], 0, "DM")
|
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
|
|
|
|| give_acl ($config['id_user'], 0, "UM")) {
|
2009-04-09 23:06:17 +02:00
|
|
|
|
|
|
|
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
2009-03-18 10:37:31 +01:00
|
|
|
print_input_hidden ('new_agent', 1);
|
|
|
|
print_submit_button (__('Create agent'), 'crt', false, 'class="sub next"');
|
2009-04-09 23:06:17 +02:00
|
|
|
echo '</form>';
|
2006-03-27 05:37:27 +02:00
|
|
|
}
|
2009-08-06 20:55:54 +02:00
|
|
|
*/
|
2007-02-22 17:45:10 +01:00
|
|
|
?>
|