2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
<?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.
|
|
|
|
|
|
|
|
require_once("../include/functions_agents.php");
|
|
|
|
require_once("../include/functions_reporting.php");
|
|
|
|
require_once("../include/functions_alerts.php");
|
2010-09-17 Miguel de Dios <miguel.dedios@artica.es>
* include/fgraph.php: added function "grafico_modulo_sparse_mobile" for
to paint a mobile graph.
* include/functions_db.php: erased deprecate function "dame_grupo_icono".
* include/functions_module.php: moved the functions "format_delete",
"format_time", "format_data", "format_verbatim", "format_timestamp",
"format_delete", "format_delete_string", "format_delete_log4x" from the
file "operation/agentes/datos_agente.php" for to use in other source code
places.
* operation/agentes/datos_agente.php: extracted the functions
"format_delete", "format_time", "format_data", "format_verbatim",
"format_timestamp", "format_delete", "format_delete_string",
"format_delete_log4x" to "include/functions_module.php" for to use in other
source code.
* operation/agentes/tactical.php: cleaned source code style.
* operation/agentes/group_view.php: cleaned source code style.
* mobile/operation/agents/view_agents.php: added class "viewGraph" to show
graph and data of any module.
* mobile/operation/agents/tactical.php: added first version of page to show
tactical mobile page.
* mobile/operation/agents/view_alerts.php: added first version of page to
show alerts mobile page.
* mobile/operation/agents/group_view.php: added first version of page to
show group view mobile page.
* mobile/operation/servers/view_servers.php: added first version of page to
show servers mobile page.
* mobile/include/style/main.css: added many new styles.
* mobile/include/functions_web.php: added links into menu for new pages.
* mobile/include/system.class.php: fixed scope of method "getConfig".
* mobile/index.php: added hooks for new pages.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3250 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-17 12:56:17 +02:00
|
|
|
require_once("../include/functions_modules.php");
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
|
|
|
|
class ViewAgents {
|
|
|
|
private $user;
|
|
|
|
private $system;
|
|
|
|
private $filter;
|
|
|
|
private $filterGroup;
|
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
global $system;
|
|
|
|
global $user;
|
|
|
|
|
|
|
|
$this->user = $user;
|
|
|
|
$this->system = $system;
|
|
|
|
$this->filterText = $this->system->getRequest('filter_text', '');
|
|
|
|
$this->filterGroup = $this->system->getRequest('filter_group', 0);;
|
|
|
|
}
|
|
|
|
|
|
|
|
private function showForm() {
|
|
|
|
echo "<form>";
|
|
|
|
print_input_hidden('page', 'agents');
|
|
|
|
print_select_groups($this->user->getIdUser(), "AR", true, 'filter_group', $this->filterGroup);
|
|
|
|
print_input_text('filter_text', $this->filterText, __('Free text search'), 10, 20);
|
|
|
|
echo "<input type='submit' class='button_filter' name='submit_button' value='' alt='" . __('Filter') . "' title='" . __('Filter') . "' />";
|
|
|
|
echo "<form>";
|
|
|
|
}
|
|
|
|
|
|
|
|
public function show() {
|
|
|
|
$this->showForm();
|
|
|
|
|
|
|
|
// Show only selected groups
|
|
|
|
if ($this->filterGroup > 0) {
|
|
|
|
$groups = $this->filterGroup;
|
|
|
|
$agent_names = get_group_agents ($this->filterGroup, array('string' => $this->filterText), "upper");
|
|
|
|
// Not selected any specific group
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$user_group = get_user_groups ($this->user->getIdUser(), "AR");
|
|
|
|
$groups = array_keys ($user_group);
|
|
|
|
$agent_names = get_group_agents (array_keys ($user_group), array('string' => $this->filterText), "upper");
|
|
|
|
}
|
|
|
|
|
|
|
|
$total_agents = get_agents (array('id_agente' => array_keys ($agent_names),
|
|
|
|
'order' => 'nombre ASC',
|
|
|
|
'disabled' => 0,
|
|
|
|
'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) $this->system->getPageSize()), array('id_agente', 'nombre', 'id_grupo'));
|
|
|
|
|
|
|
|
$table = null;
|
|
|
|
|
|
|
|
$table->width = '100%';
|
|
|
|
|
|
|
|
$table->align = array();
|
|
|
|
$table->align[0] = 'center';
|
|
|
|
$table->align[2] = 'center';
|
|
|
|
$table->align[3] = 'center';
|
|
|
|
$table->align[4] = 'center';
|
|
|
|
|
|
|
|
$table->head = array();
|
|
|
|
$table->head[0] = '<span title="' . __('Group') . '" alt="' . __('Group') . '">' . __('G') . '</span>';
|
|
|
|
$table->head[1] = __('Name');
|
|
|
|
$table->head[2] = '<span title="' . __('Modules') . '" alt="' . __('Modules') . '">' . __('M') . '</span>';
|
|
|
|
$table->head[3] = '<span title="' . __('Status') . '" alt="' . __('Status') . '">' . __('S') . '</span>';
|
|
|
|
$table->head[4] = '<span title="' . __('Alert') . '" alt="' . __('Alert') . '">' . __('A') . '</span>';
|
|
|
|
|
|
|
|
$table->data = array();
|
|
|
|
|
|
|
|
if ($agents === false) $agents = array();
|
|
|
|
|
|
|
|
$iterator = 0;
|
|
|
|
$rowPair = false;
|
|
|
|
foreach ($agents as $agent) {
|
|
|
|
if ($rowPair)
|
|
|
|
$table->rowclass[$iterator] = 'rowPair';
|
|
|
|
else
|
|
|
|
$table->rowclass[$iterator] = 'rowOdd';
|
|
|
|
$rowPair = !$rowPair;
|
2010-09-17 Miguel de Dios <miguel.dedios@artica.es>
* include/fgraph.php: added function "grafico_modulo_sparse_mobile" for
to paint a mobile graph.
* include/functions_db.php: erased deprecate function "dame_grupo_icono".
* include/functions_module.php: moved the functions "format_delete",
"format_time", "format_data", "format_verbatim", "format_timestamp",
"format_delete", "format_delete_string", "format_delete_log4x" from the
file "operation/agentes/datos_agente.php" for to use in other source code
places.
* operation/agentes/datos_agente.php: extracted the functions
"format_delete", "format_time", "format_data", "format_verbatim",
"format_timestamp", "format_delete", "format_delete_string",
"format_delete_log4x" to "include/functions_module.php" for to use in other
source code.
* operation/agentes/tactical.php: cleaned source code style.
* operation/agentes/group_view.php: cleaned source code style.
* mobile/operation/agents/view_agents.php: added class "viewGraph" to show
graph and data of any module.
* mobile/operation/agents/tactical.php: added first version of page to show
tactical mobile page.
* mobile/operation/agents/view_alerts.php: added first version of page to
show alerts mobile page.
* mobile/operation/agents/group_view.php: added first version of page to
show group view mobile page.
* mobile/operation/servers/view_servers.php: added first version of page to
show servers mobile page.
* mobile/include/style/main.css: added many new styles.
* mobile/include/functions_web.php: added links into menu for new pages.
* mobile/include/system.class.php: fixed scope of method "getConfig".
* mobile/index.php: added hooks for new pages.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3250 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-17 12:56:17 +02:00
|
|
|
$iterator++;
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
|
|
|
|
$agent_info = get_agent_module_info ($agent["id_agente"]); //$this->system->debug($agent_info);
|
|
|
|
|
|
|
|
$data = array();
|
|
|
|
|
2010-09-21 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php: fixed the width by default in the function
"print_table", now there isn't a default width (before it was 80%).
* include/pchart_graph.php: fixed in the function "add_events" when tryed
to add a event out the data.
* include/fgraph.php: check the user with the mobile methods.
* include/functions_db.php: in function "check_login" check the user with
the mobile methods.
* images/status_sets/default/severity_warning_pixel.png,
images/status_sets/default/severity_normal_pixel.png,
images/status_sets/default/severity_informational_pixel.png,
images/status_sets/default/severity_maintenance_pixel.png,
images/status_sets/default/severity_critical_pixel.png: added the image
files for to show in the event mobile's page.
* mobile/operation/agents/view_agents.php,
mobile/operation/agents/tactical.php,
mobile/operation/agents/view_alerts.php, mobile/operation/events/events.php,
mobile/operation/servers/view_servers.php, mobile/include/user.class.php,
mobile/include/system.class.php: changed the style the some pages to show
more clearly the pages in old m$-mobiles.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3265 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-21 10:59:01 +02:00
|
|
|
$truncName = printTruncateText($agent['nombre'], 25, true, true);
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
|
|
|
|
$data[] = print_group_icon2($agent["id_grupo"], true, "../images/groups_small", '', false);
|
|
|
|
$data[] = '<a href="index.php?page=agent&id=' . $agent['id_agente'] . '">' . $truncName . '</a>';
|
|
|
|
|
|
|
|
$moduleInfo = '<b>';
|
|
|
|
$moduleInfo .= $agent_info["modules"];
|
|
|
|
if ($agent_info["monitor_alertsfired"] > 0)
|
|
|
|
$moduleInfo .= ' : <span class="orange">'.$agent_info["monitor_alertsfired"].'</span>';
|
|
|
|
if ($agent_info["monitor_critical"] > 0)
|
|
|
|
$moduleInfo .= ' : <span class="red">'.$agent_info["monitor_critical"].'</span>';
|
|
|
|
if ($agent_info["monitor_warning"] > 0)
|
|
|
|
$moduleInfo .= ' : <span class="yellow">'.$agent_info["monitor_warning"].'</span>';
|
|
|
|
if ($agent_info["monitor_unknown"] > 0)
|
|
|
|
$moduleInfo .= ' : <span class="grey">'.$agent_info["monitor_unknown"].'</span>';
|
|
|
|
if ($agent_info["monitor_normal"] > 0)
|
|
|
|
$moduleInfo .= ' : <span class="green">'.$agent_info["monitor_normal"].'</span>';
|
|
|
|
$moduleInfo .= '</b>';
|
|
|
|
|
|
|
|
$data[] = $moduleInfo;
|
2010-09-21 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php: fixed the width by default in the function
"print_table", now there isn't a default width (before it was 80%).
* include/pchart_graph.php: fixed in the function "add_events" when tryed
to add a event out the data.
* include/fgraph.php: check the user with the mobile methods.
* include/functions_db.php: in function "check_login" check the user with
the mobile methods.
* images/status_sets/default/severity_warning_pixel.png,
images/status_sets/default/severity_normal_pixel.png,
images/status_sets/default/severity_informational_pixel.png,
images/status_sets/default/severity_maintenance_pixel.png,
images/status_sets/default/severity_critical_pixel.png: added the image
files for to show in the event mobile's page.
* mobile/operation/agents/view_agents.php,
mobile/operation/agents/tactical.php,
mobile/operation/agents/view_alerts.php, mobile/operation/events/events.php,
mobile/operation/servers/view_servers.php, mobile/include/user.class.php,
mobile/include/system.class.php: changed the style the some pages to show
more clearly the pages in old m$-mobiles.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3265 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-21 10:59:01 +02:00
|
|
|
$data[] = '<img width="12" height="12" src="../images/status_sets/default/' . $agent_info['status'] . '" />';
|
|
|
|
$data[] = '<img width="12" height="12" src="../images/status_sets/default/' . $agent_info['alert_value'] . '" />';
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
$table->data[] = $data;
|
|
|
|
}
|
|
|
|
|
|
|
|
print_table($table);
|
|
|
|
|
|
|
|
$pagination = pagination ($total_agents,
|
|
|
|
get_url_refresh (array ('filter_group' => $this->filterGroup, 'filter_group' => $this->filterGroup)),
|
|
|
|
0, 0, true);
|
|
|
|
|
|
|
|
$pagination = str_replace('images/go_first.png', '../images/go_first.png', $pagination);
|
|
|
|
$pagination = str_replace('images/go_previous.png', '../images/go_previous.png', $pagination);
|
|
|
|
$pagination = str_replace('images/go_next.png', '../images/go_next.png', $pagination);
|
|
|
|
$pagination = str_replace('images/go_last.png', '../images/go_last.png', $pagination);
|
|
|
|
|
|
|
|
echo $pagination;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class ViewAgent {
|
|
|
|
private $idAgent;
|
|
|
|
private $sytem;
|
|
|
|
private $agent;
|
|
|
|
|
|
|
|
private $name;
|
|
|
|
private $os;
|
|
|
|
private $ips;
|
|
|
|
private $modules;
|
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
global $system;
|
|
|
|
|
|
|
|
$this->system = $system;
|
|
|
|
|
|
|
|
$this->idAgent = $this->system->getRequest('id', 0);
|
|
|
|
$this->agent = get_db_row_filter('tagente', array('id_agente' => $this->idAgent));
|
|
|
|
|
|
|
|
$this->ips = get_agent_addresses($this->idAgent);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function show() {
|
2010-09-17 Miguel de Dios <miguel.dedios@artica.es>
* include/fgraph.php: added function "grafico_modulo_sparse_mobile" for
to paint a mobile graph.
* include/functions_db.php: erased deprecate function "dame_grupo_icono".
* include/functions_module.php: moved the functions "format_delete",
"format_time", "format_data", "format_verbatim", "format_timestamp",
"format_delete", "format_delete_string", "format_delete_log4x" from the
file "operation/agentes/datos_agente.php" for to use in other source code
places.
* operation/agentes/datos_agente.php: extracted the functions
"format_delete", "format_time", "format_data", "format_verbatim",
"format_timestamp", "format_delete", "format_delete_string",
"format_delete_log4x" to "include/functions_module.php" for to use in other
source code.
* operation/agentes/tactical.php: cleaned source code style.
* operation/agentes/group_view.php: cleaned source code style.
* mobile/operation/agents/view_agents.php: added class "viewGraph" to show
graph and data of any module.
* mobile/operation/agents/tactical.php: added first version of page to show
tactical mobile page.
* mobile/operation/agents/view_alerts.php: added first version of page to
show alerts mobile page.
* mobile/operation/agents/group_view.php: added first version of page to
show group view mobile page.
* mobile/operation/servers/view_servers.php: added first version of page to
show servers mobile page.
* mobile/include/style/main.css: added many new styles.
* mobile/include/functions_web.php: added links into menu for new pages.
* mobile/include/system.class.php: fixed scope of method "getConfig".
* mobile/index.php: added hooks for new pages.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3250 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-17 12:56:17 +02:00
|
|
|
$idGroup = $this->agent['id_grupo'];
|
|
|
|
if (! give_acl ($this->system->getConfig('id_user'), $idGroup, "AR")) {
|
|
|
|
audit_db ($this->system->getConfig('id_user'), $_SERVER['REMOTE_ADDR'], "ACL Violation",
|
|
|
|
"Trying to access (read) to agent ".get_agent_name($this->idAgent));
|
|
|
|
include ("../general/noaccess.php");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
$table = null;
|
|
|
|
|
|
|
|
$table->width = '100%';
|
|
|
|
|
|
|
|
$table->style[0] = 'font-weight: bolder;';
|
|
|
|
|
|
|
|
$table->data[0][0] = __('Name:');
|
|
|
|
$table->data[0][1] = $this->agent['nombre'];
|
|
|
|
$table->data[1][0] = __('IP:');
|
|
|
|
$table->data[1][1] = implode(',', $this->ips);
|
|
|
|
$table->data[2][0] = __('OS:');
|
2010-09-17 Miguel de Dios <miguel.dedios@artica.es>
* include/fgraph.php: added function "grafico_modulo_sparse_mobile" for
to paint a mobile graph.
* include/functions_db.php: erased deprecate function "dame_grupo_icono".
* include/functions_module.php: moved the functions "format_delete",
"format_time", "format_data", "format_verbatim", "format_timestamp",
"format_delete", "format_delete_string", "format_delete_log4x" from the
file "operation/agentes/datos_agente.php" for to use in other source code
places.
* operation/agentes/datos_agente.php: extracted the functions
"format_delete", "format_time", "format_data", "format_verbatim",
"format_timestamp", "format_delete", "format_delete_string",
"format_delete_log4x" to "include/functions_module.php" for to use in other
source code.
* operation/agentes/tactical.php: cleaned source code style.
* operation/agentes/group_view.php: cleaned source code style.
* mobile/operation/agents/view_agents.php: added class "viewGraph" to show
graph and data of any module.
* mobile/operation/agents/tactical.php: added first version of page to show
tactical mobile page.
* mobile/operation/agents/view_alerts.php: added first version of page to
show alerts mobile page.
* mobile/operation/agents/group_view.php: added first version of page to
show group view mobile page.
* mobile/operation/servers/view_servers.php: added first version of page to
show servers mobile page.
* mobile/include/style/main.css: added many new styles.
* mobile/include/functions_web.php: added links into menu for new pages.
* mobile/include/system.class.php: fixed scope of method "getConfig".
* mobile/index.php: added hooks for new pages.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3250 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-17 12:56:17 +02:00
|
|
|
$table->data[2][1] = str_replace('images/os_icons/', '../images/os_icons/', print_os_icon($this->agent['id_os'], true, true));
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
$table->data[3][0] = __('Last contact');
|
|
|
|
$table->data[3][1] = $this->agent['ultimo_contacto'];
|
|
|
|
|
|
|
|
print_table($table);
|
|
|
|
|
|
|
|
$sql = sprintf ("
|
|
|
|
SELECT *
|
|
|
|
FROM tagente_estado, tagente_modulo
|
|
|
|
LEFT JOIN tmodule_group
|
|
|
|
ON tmodule_group.id_mg = tagente_modulo.id_module_group
|
|
|
|
WHERE tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
|
|
|
|
AND tagente_modulo.id_agente = %d
|
|
|
|
AND tagente_modulo.disabled = 0
|
|
|
|
AND tagente_modulo.delete_pending = 0
|
|
|
|
AND tagente_estado.utimestamp != 0
|
|
|
|
ORDER BY tagente_modulo.id_module_group , tagente_modulo.nombre ASC
|
|
|
|
", $this->idAgent);
|
|
|
|
|
|
|
|
$modules = get_db_all_rows_sql ($sql);
|
|
|
|
if (empty ($modules)) {
|
|
|
|
$modules = array ();
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "<h3 class='title_h3'>" . __('Modules') . "</h3>";
|
|
|
|
|
|
|
|
$table = null;
|
2010-09-21 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php: fixed the width by default in the function
"print_table", now there isn't a default width (before it was 80%).
* include/pchart_graph.php: fixed in the function "add_events" when tryed
to add a event out the data.
* include/fgraph.php: check the user with the mobile methods.
* include/functions_db.php: in function "check_login" check the user with
the mobile methods.
* images/status_sets/default/severity_warning_pixel.png,
images/status_sets/default/severity_normal_pixel.png,
images/status_sets/default/severity_informational_pixel.png,
images/status_sets/default/severity_maintenance_pixel.png,
images/status_sets/default/severity_critical_pixel.png: added the image
files for to show in the event mobile's page.
* mobile/operation/agents/view_agents.php,
mobile/operation/agents/tactical.php,
mobile/operation/agents/view_alerts.php, mobile/operation/events/events.php,
mobile/operation/servers/view_servers.php, mobile/include/user.class.php,
mobile/include/system.class.php: changed the style the some pages to show
more clearly the pages in old m$-mobiles.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3265 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-21 10:59:01 +02:00
|
|
|
//$table->width = '100%';
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
$table->head = array();
|
|
|
|
$table->head[0] = __('Module');
|
|
|
|
$table->head[1] = '<span title="' . __('Status') . '" alt="' . __('Status') . '">' . __('S') . '</span>';
|
|
|
|
$table->head[2] = __('Data');
|
|
|
|
$table->head[3] = '<span title="' . __('Last contact') . '" alt="' . __('Last contact') . '">' . __('L') . '</span>';
|
|
|
|
|
|
|
|
$table->data = array();
|
|
|
|
|
|
|
|
$iterator = 0;
|
|
|
|
$rowPair = false;
|
|
|
|
foreach ($modules as $module) {
|
|
|
|
if ($rowPair)
|
|
|
|
$table->rowclass[$iterator] = 'rowPair';
|
|
|
|
else
|
|
|
|
$table->rowclass[$iterator] = 'rowOdd';
|
|
|
|
$rowPair = !$rowPair;
|
2010-09-17 Miguel de Dios <miguel.dedios@artica.es>
* include/fgraph.php: added function "grafico_modulo_sparse_mobile" for
to paint a mobile graph.
* include/functions_db.php: erased deprecate function "dame_grupo_icono".
* include/functions_module.php: moved the functions "format_delete",
"format_time", "format_data", "format_verbatim", "format_timestamp",
"format_delete", "format_delete_string", "format_delete_log4x" from the
file "operation/agentes/datos_agente.php" for to use in other source code
places.
* operation/agentes/datos_agente.php: extracted the functions
"format_delete", "format_time", "format_data", "format_verbatim",
"format_timestamp", "format_delete", "format_delete_string",
"format_delete_log4x" to "include/functions_module.php" for to use in other
source code.
* operation/agentes/tactical.php: cleaned source code style.
* operation/agentes/group_view.php: cleaned source code style.
* mobile/operation/agents/view_agents.php: added class "viewGraph" to show
graph and data of any module.
* mobile/operation/agents/tactical.php: added first version of page to show
tactical mobile page.
* mobile/operation/agents/view_alerts.php: added first version of page to
show alerts mobile page.
* mobile/operation/agents/group_view.php: added first version of page to
show group view mobile page.
* mobile/operation/servers/view_servers.php: added first version of page to
show servers mobile page.
* mobile/include/style/main.css: added many new styles.
* mobile/include/functions_web.php: added links into menu for new pages.
* mobile/include/system.class.php: fixed scope of method "getConfig".
* mobile/index.php: added hooks for new pages.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3250 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-17 12:56:17 +02:00
|
|
|
$iterator++;
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
|
|
|
|
$data = array();
|
|
|
|
|
2010-09-21 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php: fixed the width by default in the function
"print_table", now there isn't a default width (before it was 80%).
* include/pchart_graph.php: fixed in the function "add_events" when tryed
to add a event out the data.
* include/fgraph.php: check the user with the mobile methods.
* include/functions_db.php: in function "check_login" check the user with
the mobile methods.
* images/status_sets/default/severity_warning_pixel.png,
images/status_sets/default/severity_normal_pixel.png,
images/status_sets/default/severity_informational_pixel.png,
images/status_sets/default/severity_maintenance_pixel.png,
images/status_sets/default/severity_critical_pixel.png: added the image
files for to show in the event mobile's page.
* mobile/operation/agents/view_agents.php,
mobile/operation/agents/tactical.php,
mobile/operation/agents/view_alerts.php, mobile/operation/events/events.php,
mobile/operation/servers/view_servers.php, mobile/include/user.class.php,
mobile/include/system.class.php: changed the style the some pages to show
more clearly the pages in old m$-mobiles.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3265 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-21 10:59:01 +02:00
|
|
|
$data[] = '<a href="index.php?page=agent&action=view_module_graph&id=' . $module['id_agente_modulo'] . '">' .
|
|
|
|
printTruncateText($module["nombre"], 20, true, true) . '</a>';
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
$status = STATUS_MODULE_WARNING;
|
|
|
|
$title = "";
|
|
|
|
|
|
|
|
if ($module["estado"] == 1) {
|
|
|
|
$status = STATUS_MODULE_CRITICAL;
|
|
|
|
$title = __('CRITICAL');
|
|
|
|
} elseif ($module["estado"] == 2) {
|
|
|
|
$status = STATUS_MODULE_WARNING;
|
|
|
|
$title = __('WARNING');
|
|
|
|
} elseif ($module["estado"] == 0) {
|
|
|
|
$status = STATUS_MODULE_OK;
|
|
|
|
$title = __('NORMAL');
|
|
|
|
} elseif ($module["estado"] == 3) {
|
|
|
|
$last_status = get_agentmodule_last_status($module['id_agente_modulo']);
|
|
|
|
switch($last_status) {
|
|
|
|
case 0:
|
|
|
|
$status = STATUS_MODULE_OK;
|
|
|
|
$title = __('UNKNOWN')." - ".__('Last status')." ".__('NORMAL');
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
$status = STATUS_MODULE_CRITICAL;
|
|
|
|
$title = __('UNKNOWN')." - ".__('Last status')." ".__('CRITICAL');
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
$status = STATUS_MODULE_WARNING;
|
|
|
|
$title = __('UNKNOWN')." - ".__('Last status')." ".__('WARNING');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_numeric($module["datos"])) {
|
|
|
|
$title .= ": " . format_for_graph($module["datos"]);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$title .= ": " . substr(safe_output($module["datos"]),0,42);
|
|
|
|
}
|
|
|
|
|
2010-09-21 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php: fixed the width by default in the function
"print_table", now there isn't a default width (before it was 80%).
* include/pchart_graph.php: fixed in the function "add_events" when tryed
to add a event out the data.
* include/fgraph.php: check the user with the mobile methods.
* include/functions_db.php: in function "check_login" check the user with
the mobile methods.
* images/status_sets/default/severity_warning_pixel.png,
images/status_sets/default/severity_normal_pixel.png,
images/status_sets/default/severity_informational_pixel.png,
images/status_sets/default/severity_maintenance_pixel.png,
images/status_sets/default/severity_critical_pixel.png: added the image
files for to show in the event mobile's page.
* mobile/operation/agents/view_agents.php,
mobile/operation/agents/tactical.php,
mobile/operation/agents/view_alerts.php, mobile/operation/events/events.php,
mobile/operation/servers/view_servers.php, mobile/include/user.class.php,
mobile/include/system.class.php: changed the style the some pages to show
more clearly the pages in old m$-mobiles.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3265 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-21 10:59:01 +02:00
|
|
|
$data[] = str_replace(array('images/status_sets', '<img'),
|
|
|
|
array('../images/status_sets', '<img height="15" width="15"') , print_status_image($status, $title, true));
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
|
|
|
|
if ($module["id_tipo_modulo"] == 24) { // log4x
|
|
|
|
switch($module["datos"]) {
|
|
|
|
case 10: $salida = "TRACE"; $style="font-weight:bold; color:darkgreen;"; break;
|
|
|
|
case 20: $salida = "DEBUG"; $style="font-weight:bold; color:darkgreen;"; break;
|
|
|
|
case 30: $salida = "INFO"; $style="font-weight:bold; color:darkgreen;"; break;
|
|
|
|
case 40: $salida = "WARN"; $style="font-weight:bold; color:darkorange;"; break;
|
|
|
|
case 50: $salida = "ERROR"; $style="font-weight:bold; color:red;"; break;
|
|
|
|
case 60: $salida = "FATAL"; $style="font-weight:bold; color:red;"; break;
|
|
|
|
}
|
|
|
|
$salida = "<span style='$style'>$salida</span>";
|
|
|
|
} else {
|
|
|
|
if (is_numeric($module["datos"])){
|
|
|
|
$salida = format_numeric($module["datos"]);
|
|
|
|
} else {
|
|
|
|
$salida = "<span title='".$module['datos']."' style='white-space: nowrap;'>".substr(safe_output($module["datos"]),0,12)."</span>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$data[] = $salida;
|
|
|
|
if ($module['estado'] == 3) {
|
|
|
|
$lastTime = '<span class="redb">';
|
|
|
|
} else {
|
|
|
|
$lastTime = '<span>';
|
|
|
|
}
|
|
|
|
$lastTime .= print_timestamp ($module["utimestamp"], true, array('units' => 'tiny'));
|
|
|
|
$lastTime .= '</span>';
|
|
|
|
$data[] = $lastTime;
|
|
|
|
|
|
|
|
|
|
|
|
$table->data[] = $data;
|
|
|
|
}
|
|
|
|
|
|
|
|
print_table($table);
|
|
|
|
|
|
|
|
$table->head = array();
|
|
|
|
$table->head[0] = __('Module');
|
|
|
|
$table->head[1] = __('Template');
|
|
|
|
// $table->head[2] = __('Action');
|
|
|
|
$table->head[2] = '<span title="' . __('Last fired') . '" alt="' . __('Last fired') . '">' . __('Last') . '</span>';
|
|
|
|
$table->head[3] = '<span title="' . __('Status') . '" alt="' . __('Status') . '">' . __('S') . '</span>';
|
|
|
|
|
|
|
|
|
|
|
|
$table->align = array();
|
|
|
|
$table->align[3] = 'right';
|
|
|
|
$table->align[2] = 'center';
|
|
|
|
$table->data = array();
|
|
|
|
$table->rowclass = array();
|
|
|
|
|
|
|
|
echo "<h3 class='title_h3'>" . __('Alerts') . "</h3>";
|
|
|
|
$alertsSimple = get_agent_alerts_simple (array($this->idAgent));
|
2010-09-17 Miguel de Dios <miguel.dedios@artica.es>
* include/fgraph.php: added function "grafico_modulo_sparse_mobile" for
to paint a mobile graph.
* include/functions_db.php: erased deprecate function "dame_grupo_icono".
* include/functions_module.php: moved the functions "format_delete",
"format_time", "format_data", "format_verbatim", "format_timestamp",
"format_delete", "format_delete_string", "format_delete_log4x" from the
file "operation/agentes/datos_agente.php" for to use in other source code
places.
* operation/agentes/datos_agente.php: extracted the functions
"format_delete", "format_time", "format_data", "format_verbatim",
"format_timestamp", "format_delete", "format_delete_string",
"format_delete_log4x" to "include/functions_module.php" for to use in other
source code.
* operation/agentes/tactical.php: cleaned source code style.
* operation/agentes/group_view.php: cleaned source code style.
* mobile/operation/agents/view_agents.php: added class "viewGraph" to show
graph and data of any module.
* mobile/operation/agents/tactical.php: added first version of page to show
tactical mobile page.
* mobile/operation/agents/view_alerts.php: added first version of page to
show alerts mobile page.
* mobile/operation/agents/group_view.php: added first version of page to
show group view mobile page.
* mobile/operation/servers/view_servers.php: added first version of page to
show servers mobile page.
* mobile/include/style/main.css: added many new styles.
* mobile/include/functions_web.php: added links into menu for new pages.
* mobile/include/system.class.php: fixed scope of method "getConfig".
* mobile/index.php: added hooks for new pages.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3250 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-17 12:56:17 +02:00
|
|
|
$rowPair = false;
|
|
|
|
$iterator = 0;
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
foreach ($alertsSimple as $alert) {
|
|
|
|
if ($rowPair)
|
|
|
|
$table->rowclass[$iterator] = 'rowPair';
|
|
|
|
else
|
|
|
|
$table->rowclass[$iterator] = 'rowOdd';
|
|
|
|
$rowPair = !$rowPair;
|
2010-09-17 Miguel de Dios <miguel.dedios@artica.es>
* include/fgraph.php: added function "grafico_modulo_sparse_mobile" for
to paint a mobile graph.
* include/functions_db.php: erased deprecate function "dame_grupo_icono".
* include/functions_module.php: moved the functions "format_delete",
"format_time", "format_data", "format_verbatim", "format_timestamp",
"format_delete", "format_delete_string", "format_delete_log4x" from the
file "operation/agentes/datos_agente.php" for to use in other source code
places.
* operation/agentes/datos_agente.php: extracted the functions
"format_delete", "format_time", "format_data", "format_verbatim",
"format_timestamp", "format_delete", "format_delete_string",
"format_delete_log4x" to "include/functions_module.php" for to use in other
source code.
* operation/agentes/tactical.php: cleaned source code style.
* operation/agentes/group_view.php: cleaned source code style.
* mobile/operation/agents/view_agents.php: added class "viewGraph" to show
graph and data of any module.
* mobile/operation/agents/tactical.php: added first version of page to show
tactical mobile page.
* mobile/operation/agents/view_alerts.php: added first version of page to
show alerts mobile page.
* mobile/operation/agents/group_view.php: added first version of page to
show group view mobile page.
* mobile/operation/servers/view_servers.php: added first version of page to
show servers mobile page.
* mobile/include/style/main.css: added many new styles.
* mobile/include/functions_web.php: added links into menu for new pages.
* mobile/include/system.class.php: fixed scope of method "getConfig".
* mobile/index.php: added hooks for new pages.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3250 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-17 12:56:17 +02:00
|
|
|
$iterator++;
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
|
|
|
|
$data = array();
|
|
|
|
|
2010-09-21 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php: fixed the width by default in the function
"print_table", now there isn't a default width (before it was 80%).
* include/pchart_graph.php: fixed in the function "add_events" when tryed
to add a event out the data.
* include/fgraph.php: check the user with the mobile methods.
* include/functions_db.php: in function "check_login" check the user with
the mobile methods.
* images/status_sets/default/severity_warning_pixel.png,
images/status_sets/default/severity_normal_pixel.png,
images/status_sets/default/severity_informational_pixel.png,
images/status_sets/default/severity_maintenance_pixel.png,
images/status_sets/default/severity_critical_pixel.png: added the image
files for to show in the event mobile's page.
* mobile/operation/agents/view_agents.php,
mobile/operation/agents/tactical.php,
mobile/operation/agents/view_alerts.php, mobile/operation/events/events.php,
mobile/operation/servers/view_servers.php, mobile/include/user.class.php,
mobile/include/system.class.php: changed the style the some pages to show
more clearly the pages in old m$-mobiles.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3265 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-21 10:59:01 +02:00
|
|
|
$data[] = printTruncateText(get_agentmodule_name($alert["id_agent_module"]), 20, true, true);
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
|
|
|
|
$template = safe_output(get_alert_template ($alert['id_alert_template']));
|
2010-09-21 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php: fixed the width by default in the function
"print_table", now there isn't a default width (before it was 80%).
* include/pchart_graph.php: fixed in the function "add_events" when tryed
to add a event out the data.
* include/fgraph.php: check the user with the mobile methods.
* include/functions_db.php: in function "check_login" check the user with
the mobile methods.
* images/status_sets/default/severity_warning_pixel.png,
images/status_sets/default/severity_normal_pixel.png,
images/status_sets/default/severity_informational_pixel.png,
images/status_sets/default/severity_maintenance_pixel.png,
images/status_sets/default/severity_critical_pixel.png: added the image
files for to show in the event mobile's page.
* mobile/operation/agents/view_agents.php,
mobile/operation/agents/tactical.php,
mobile/operation/agents/view_alerts.php, mobile/operation/events/events.php,
mobile/operation/servers/view_servers.php, mobile/include/user.class.php,
mobile/include/system.class.php: changed the style the some pages to show
more clearly the pages in old m$-mobiles.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3265 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-21 10:59:01 +02:00
|
|
|
$data[] = printTruncateText(safe_output($template['name']), 20, true, true);
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
|
|
|
|
// $actions = get_alert_agent_module_actions ($alert['id'], false, false);
|
|
|
|
// if (!empty($actions)){
|
|
|
|
// $actionText = '<ul class="action_list">';
|
|
|
|
// foreach ($actions as $action) {
|
|
|
|
// $actionText .= '<li><div><span class="action_name">' . $action['name'];
|
|
|
|
// if ($action["fires_min"] != $action["fires_max"]){
|
|
|
|
// $actionText .= " (".$action["fires_min"] . " / ". $action["fires_max"] . ")";
|
|
|
|
// }
|
|
|
|
// $actionText .= '</li></span><br></div>';
|
|
|
|
// }
|
|
|
|
// $actionText .= '</div></ul>';
|
|
|
|
// }
|
|
|
|
// else {
|
|
|
|
// if ($actionDefault != "")
|
|
|
|
// $actionText = get_db_sql ("SELECT name FROM talert_actions WHERE id = $actionDefault"). " <i>(".__("Default") . ")</i>";
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// $data[] = $actionText;
|
|
|
|
$data[] = print_timestamp ($alert["last_fired"], true, array('units' => 'tiny'));
|
|
|
|
|
|
|
|
$status = STATUS_ALERT_NOT_FIRED;
|
|
|
|
$title = "";
|
|
|
|
|
|
|
|
if ($alert["times_fired"] > 0) {
|
|
|
|
$status = STATUS_ALERT_FIRED;
|
|
|
|
$title = __('Alert fired').' '.$alert["times_fired"].' '.__('times');
|
|
|
|
} elseif ($alert["disabled"] > 0) {
|
|
|
|
$status = STATUS_ALERT_DISABLED;
|
|
|
|
$title = __('Alert disabled');
|
|
|
|
} else {
|
|
|
|
$status = STATUS_ALERT_NOT_FIRED;
|
|
|
|
$title = __('Alert not fired');
|
|
|
|
}
|
|
|
|
|
2010-09-21 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php: fixed the width by default in the function
"print_table", now there isn't a default width (before it was 80%).
* include/pchart_graph.php: fixed in the function "add_events" when tryed
to add a event out the data.
* include/fgraph.php: check the user with the mobile methods.
* include/functions_db.php: in function "check_login" check the user with
the mobile methods.
* images/status_sets/default/severity_warning_pixel.png,
images/status_sets/default/severity_normal_pixel.png,
images/status_sets/default/severity_informational_pixel.png,
images/status_sets/default/severity_maintenance_pixel.png,
images/status_sets/default/severity_critical_pixel.png: added the image
files for to show in the event mobile's page.
* mobile/operation/agents/view_agents.php,
mobile/operation/agents/tactical.php,
mobile/operation/agents/view_alerts.php, mobile/operation/events/events.php,
mobile/operation/servers/view_servers.php, mobile/include/user.class.php,
mobile/include/system.class.php: changed the style the some pages to show
more clearly the pages in old m$-mobiles.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3265 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-21 10:59:01 +02:00
|
|
|
$data[] = str_replace(array('images/status_sets', '<img'),
|
|
|
|
array('../images/status_sets', '<img width="15" height="15"'), print_status_image($status, $title, true));
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
|
|
|
|
$table->data[] = $data;
|
|
|
|
}
|
|
|
|
print_table($table);
|
|
|
|
|
|
|
|
// echo "<h3 class='title_h3'>" . __('Alerts compound') . "</h3>";
|
|
|
|
//
|
|
|
|
// $alertsCombined = get_agent_alerts_compound(array($this->idAgent));
|
|
|
|
//
|
|
|
|
// $table->data = array();
|
|
|
|
// foreach ($alertsCombined as $alert) {
|
|
|
|
// $data = array();
|
|
|
|
//
|
|
|
|
// $table->data[] = $data;
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
2010-09-17 Miguel de Dios <miguel.dedios@artica.es>
* include/fgraph.php: added function "grafico_modulo_sparse_mobile" for
to paint a mobile graph.
* include/functions_db.php: erased deprecate function "dame_grupo_icono".
* include/functions_module.php: moved the functions "format_delete",
"format_time", "format_data", "format_verbatim", "format_timestamp",
"format_delete", "format_delete_string", "format_delete_log4x" from the
file "operation/agentes/datos_agente.php" for to use in other source code
places.
* operation/agentes/datos_agente.php: extracted the functions
"format_delete", "format_time", "format_data", "format_verbatim",
"format_timestamp", "format_delete", "format_delete_string",
"format_delete_log4x" to "include/functions_module.php" for to use in other
source code.
* operation/agentes/tactical.php: cleaned source code style.
* operation/agentes/group_view.php: cleaned source code style.
* mobile/operation/agents/view_agents.php: added class "viewGraph" to show
graph and data of any module.
* mobile/operation/agents/tactical.php: added first version of page to show
tactical mobile page.
* mobile/operation/agents/view_alerts.php: added first version of page to
show alerts mobile page.
* mobile/operation/agents/group_view.php: added first version of page to
show group view mobile page.
* mobile/operation/servers/view_servers.php: added first version of page to
show servers mobile page.
* mobile/include/style/main.css: added many new styles.
* mobile/include/functions_web.php: added links into menu for new pages.
* mobile/include/system.class.php: fixed scope of method "getConfig".
* mobile/index.php: added hooks for new pages.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3250 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-17 12:56:17 +02:00
|
|
|
|
|
|
|
class viewGraph {
|
|
|
|
private $system;
|
|
|
|
private $idAgentModule;
|
|
|
|
|
|
|
|
function __construct($idAgentModule = 0) {
|
|
|
|
global $system;
|
|
|
|
|
|
|
|
$this->system = $system;
|
|
|
|
$this->idAgentModule = $idAgentModule;
|
|
|
|
$this->agentModule = get_db_row_filter('tagente_modulo', array('id_agente_modulo' => $this->idAgentModule));
|
|
|
|
//$this->system->debug($this->agentModule);
|
|
|
|
$this->period = $this->system->getRequest('period', 86400);
|
|
|
|
$this->offset = $this->system->getRequest("offset", 0);
|
|
|
|
|
|
|
|
$this->agent = get_db_row_filter('tagente', array('id_agente' => $this->agentModule['id_agente']));
|
|
|
|
}
|
|
|
|
|
|
|
|
function show() {
|
|
|
|
$idGroup = $this->agent['id_grupo'];
|
|
|
|
if (! give_acl ($this->system->getConfig('id_user'), $idGroup, "AR")) {
|
|
|
|
audit_db ($this->system->getConfig('id_user'), $_SERVER['REMOTE_ADDR'], "ACL Violation",
|
|
|
|
"Trying to access (read) to agent ".get_agent_name($this->idAgent));
|
|
|
|
include ("../general/noaccess.php");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-09-21 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php: fixed the width by default in the function
"print_table", now there isn't a default width (before it was 80%).
* include/pchart_graph.php: fixed in the function "add_events" when tryed
to add a event out the data.
* include/fgraph.php: check the user with the mobile methods.
* include/functions_db.php: in function "check_login" check the user with
the mobile methods.
* images/status_sets/default/severity_warning_pixel.png,
images/status_sets/default/severity_normal_pixel.png,
images/status_sets/default/severity_informational_pixel.png,
images/status_sets/default/severity_maintenance_pixel.png,
images/status_sets/default/severity_critical_pixel.png: added the image
files for to show in the event mobile's page.
* mobile/operation/agents/view_agents.php,
mobile/operation/agents/tactical.php,
mobile/operation/agents/view_alerts.php, mobile/operation/events/events.php,
mobile/operation/servers/view_servers.php, mobile/include/user.class.php,
mobile/include/system.class.php: changed the style the some pages to show
more clearly the pages in old m$-mobiles.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3265 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-21 10:59:01 +02:00
|
|
|
$image = "../include/fgraph.php?tipo=sparse_mobile&draw_alerts=1&draw_events=1" .
|
|
|
|
'&id=' . $this->idAgentModule . "&zoom=1&label=".safe_output($this->agentModule['nombre']) .
|
2010-09-17 Miguel de Dios <miguel.dedios@artica.es>
* include/fgraph.php: added function "grafico_modulo_sparse_mobile" for
to paint a mobile graph.
* include/functions_db.php: erased deprecate function "dame_grupo_icono".
* include/functions_module.php: moved the functions "format_delete",
"format_time", "format_data", "format_verbatim", "format_timestamp",
"format_delete", "format_delete_string", "format_delete_log4x" from the
file "operation/agentes/datos_agente.php" for to use in other source code
places.
* operation/agentes/datos_agente.php: extracted the functions
"format_delete", "format_time", "format_data", "format_verbatim",
"format_timestamp", "format_delete", "format_delete_string",
"format_delete_log4x" to "include/functions_module.php" for to use in other
source code.
* operation/agentes/tactical.php: cleaned source code style.
* operation/agentes/group_view.php: cleaned source code style.
* mobile/operation/agents/view_agents.php: added class "viewGraph" to show
graph and data of any module.
* mobile/operation/agents/tactical.php: added first version of page to show
tactical mobile page.
* mobile/operation/agents/view_alerts.php: added first version of page to
show alerts mobile page.
* mobile/operation/agents/group_view.php: added first version of page to
show group view mobile page.
* mobile/operation/servers/view_servers.php: added first version of page to
show servers mobile page.
* mobile/include/style/main.css: added many new styles.
* mobile/include/functions_web.php: added links into menu for new pages.
* mobile/include/system.class.php: fixed scope of method "getConfig".
* mobile/index.php: added hooks for new pages.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3250 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-17 12:56:17 +02:00
|
|
|
"&height=120&width=240&period=" . $this->period . "&avg_only=0";
|
|
|
|
|
|
|
|
$image .= "&date=" . get_system_time ();
|
|
|
|
|
|
|
|
echo "<h3 class='title_h3'><a href='index.php?page=agent&id=" . $this->agentModule['id_agente'] . "'>" . get_agentmodule_agent_name($this->idAgentModule)."</a> / ".safe_output($this->agentModule['nombre']) . "</h3>";
|
|
|
|
|
|
|
|
echo "<h3 class='title_h3'>" . __('Graph') . "</h3>";
|
2010-09-21 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php: fixed the width by default in the function
"print_table", now there isn't a default width (before it was 80%).
* include/pchart_graph.php: fixed in the function "add_events" when tryed
to add a event out the data.
* include/fgraph.php: check the user with the mobile methods.
* include/functions_db.php: in function "check_login" check the user with
the mobile methods.
* images/status_sets/default/severity_warning_pixel.png,
images/status_sets/default/severity_normal_pixel.png,
images/status_sets/default/severity_informational_pixel.png,
images/status_sets/default/severity_maintenance_pixel.png,
images/status_sets/default/severity_critical_pixel.png: added the image
files for to show in the event mobile's page.
* mobile/operation/agents/view_agents.php,
mobile/operation/agents/tactical.php,
mobile/operation/agents/view_alerts.php, mobile/operation/events/events.php,
mobile/operation/servers/view_servers.php, mobile/include/user.class.php,
mobile/include/system.class.php: changed the style the some pages to show
more clearly the pages in old m$-mobiles.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3265 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-21 10:59:01 +02:00
|
|
|
print_image ($image, false, array ("border" => 0));
|
2010-09-17 Miguel de Dios <miguel.dedios@artica.es>
* include/fgraph.php: added function "grafico_modulo_sparse_mobile" for
to paint a mobile graph.
* include/functions_db.php: erased deprecate function "dame_grupo_icono".
* include/functions_module.php: moved the functions "format_delete",
"format_time", "format_data", "format_verbatim", "format_timestamp",
"format_delete", "format_delete_string", "format_delete_log4x" from the
file "operation/agentes/datos_agente.php" for to use in other source code
places.
* operation/agentes/datos_agente.php: extracted the functions
"format_delete", "format_time", "format_data", "format_verbatim",
"format_timestamp", "format_delete", "format_delete_string",
"format_delete_log4x" to "include/functions_module.php" for to use in other
source code.
* operation/agentes/tactical.php: cleaned source code style.
* operation/agentes/group_view.php: cleaned source code style.
* mobile/operation/agents/view_agents.php: added class "viewGraph" to show
graph and data of any module.
* mobile/operation/agents/tactical.php: added first version of page to show
tactical mobile page.
* mobile/operation/agents/view_alerts.php: added first version of page to
show alerts mobile page.
* mobile/operation/agents/group_view.php: added first version of page to
show group view mobile page.
* mobile/operation/servers/view_servers.php: added first version of page to
show servers mobile page.
* mobile/include/style/main.css: added many new styles.
* mobile/include/functions_web.php: added links into menu for new pages.
* mobile/include/system.class.php: fixed scope of method "getConfig".
* mobile/index.php: added hooks for new pages.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3250 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-17 12:56:17 +02:00
|
|
|
|
|
|
|
echo "<h3 class='title_h3'>" . __('Data') . "</h3>";
|
|
|
|
|
|
|
|
echo "<form method='post' action='index.php?page=agent&action=view_module_graph&id=" . $this->idAgentModule . "'>";
|
|
|
|
echo __("Choose period:");
|
|
|
|
$intervals = array ();
|
|
|
|
$intervals[3600] = human_time_description_raw (3600); // 1 hour
|
|
|
|
$intervals[86400] = human_time_description_raw (86400); // 1 day
|
|
|
|
$intervals[604800] = human_time_description_raw (604800); // 1 week
|
|
|
|
$intervals[2592000] = human_time_description_raw (2592000); // 1 month
|
|
|
|
echo print_extended_select_for_time ($intervals, 'period', $this->period, 'this.form.submit();', '', '0', 5) . __(" secs");
|
|
|
|
echo "</form><br />";
|
|
|
|
|
|
|
|
$moduletype_name = get_moduletype_name (get_agentmodule_type ($this->idAgentModule));
|
|
|
|
|
|
|
|
if ($moduletype_name == "log4x") {
|
|
|
|
$sql_body = sprintf ("FROM tagente_datos_log4x
|
|
|
|
WHERE id_agente_modulo = %d AND utimestamp > %d ORDER BY utimestamp DESC", $this->idAgentModule, (get_system_time () - $this->period));
|
|
|
|
|
|
|
|
$columns = array(
|
|
|
|
|
|
|
|
//"Timestamp" => array("utimestamp", "format_timestamp", "align" => "center" ),
|
|
|
|
"Sev" => array("severity", "format_data", "align" => "center", "width" => "70px"),
|
|
|
|
"Message" => array("message", "format_verbatim", "align" => "left", "width" => "45%"),
|
|
|
|
"StackTrace" => array("stacktrace", "format_verbatim", "align" => "left", "width" => "50%")
|
|
|
|
);
|
|
|
|
}
|
|
|
|
else if (preg_match ("/string/", $moduletype_name)) {
|
|
|
|
$sql_body = sprintf (" FROM tagente_datos_string
|
|
|
|
WHERE id_agente_modulo = %d AND utimestamp > %d ORDER BY utimestamp DESC", $this->idAgentModule, (get_system_time () - $this->period));
|
|
|
|
|
|
|
|
$columns = array(
|
|
|
|
//"Timestamp" => array("utimestamp", "format_timestamp", "align" => "center"),
|
|
|
|
"Data" => array("datos", "format_data", "align" => "center"),
|
|
|
|
"Time" => array("utimestamp", "format_time", "align" => "center")
|
|
|
|
);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$sql_body = sprintf (" FROM tagente_datos
|
|
|
|
WHERE id_agente_modulo = %d AND utimestamp > %d ORDER BY utimestamp DESC", $this->idAgentModule, (get_system_time () - $this->period));
|
|
|
|
|
|
|
|
$columns = array(
|
|
|
|
//"Timestamp" => array("utimestamp", "format_timestamp", "align" => "center"),
|
|
|
|
"Data" => array("datos", "format_data", "align" => "center"),
|
|
|
|
"Time" => array("utimestamp", "format_time", "align" => "center")
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
$sql_count = 'SELECT COUNT(*) ' . $sql_body;
|
|
|
|
|
|
|
|
$count = get_db_value_sql($sql_count);
|
|
|
|
|
|
|
|
$sql = 'SELECT * ' . $sql_body . ' LIMIT ' . $this->offset . ',' . $this->system->getPageSize();
|
|
|
|
|
|
|
|
$result = get_db_all_rows_sql ($sql);
|
|
|
|
|
|
|
|
|
|
|
|
$table = null;
|
|
|
|
$table->width = '100%';
|
|
|
|
$table->head = array();
|
|
|
|
$index = 0;
|
|
|
|
foreach($columns as $col => $attr) {
|
|
|
|
$table->head[$index] = $col;
|
|
|
|
|
|
|
|
if (isset($attr["align"]))
|
|
|
|
$table->align[$index] = $attr["align"];
|
|
|
|
|
|
|
|
if (isset($attr["width"]))
|
|
|
|
$table->size[$index] = $attr["width"];
|
|
|
|
|
|
|
|
$index++;
|
|
|
|
}
|
|
|
|
|
|
|
|
$table->data = array(); //$this->system->debug($result);
|
|
|
|
$rowPair = false;
|
|
|
|
$iterator = 0;
|
|
|
|
foreach ($result as $row) {
|
|
|
|
if ($rowPair)
|
|
|
|
$table->rowclass[$iterator] = 'rowPair';
|
|
|
|
else
|
|
|
|
$table->rowclass[$iterator] = 'rowOdd';
|
|
|
|
$rowPair = !$rowPair;
|
|
|
|
$iterator++;
|
|
|
|
|
|
|
|
$data = array ();
|
|
|
|
|
|
|
|
foreach($columns as $col => $attr){
|
|
|
|
$data[] = $attr[1] ($row[$attr[0]]);
|
|
|
|
//debugPrint( "\$data[] = ".$attr[1]." (".$row[$attr[0]].");");
|
|
|
|
}
|
|
|
|
|
|
|
|
array_push ($table->data, $data);
|
|
|
|
}
|
|
|
|
|
|
|
|
print_table($table);
|
|
|
|
|
|
|
|
$pagination = pagination ($count,
|
|
|
|
get_url_refresh (array ('period' => $this->period)),
|
|
|
|
0, 0, true);
|
|
|
|
|
|
|
|
$pagination = str_replace('images/go_first.png', '../images/go_first.png', $pagination);
|
|
|
|
$pagination = str_replace('images/go_previous.png', '../images/go_previous.png', $pagination);
|
|
|
|
$pagination = str_replace('images/go_next.png', '../images/go_next.png', $pagination);
|
|
|
|
$pagination = str_replace('images/go_last.png', '../images/go_last.png', $pagination);
|
|
|
|
|
|
|
|
echo $pagination;
|
|
|
|
}
|
|
|
|
}
|
2010-09-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_reporting.php: in function "get_agent_module_info" added
the return "status" and "alert_value".
* include/auth/mysql.php: in function "process_user_login" cleaned the
source code style.
* include/functions_ui.php: in function "print_timestamp" added in the
parameter $option the check of units ('large' and 'tiny' at the moment).
Added the function "print_group_icon2" that it is the same of
"print_group_icon" but it has a new parameter $path for to set the images
path.
* include/functions.php: in function "human_time_comparation" added the
parameter $units to set the type return text for time unit (at the moment
only "large" and "tiny"). And in the function "human_time_description_raw"
added the paramter $units for to set the type of return text for units, at
the moment only "large" and "tiny".
* include/functions_db.php, operation/agentes/ver_agente.php: cleaned source
code.
* mobile/index.php, mobile/operation/agents,
mobile/operation/agents/view_agents.php, mobile/include/db.class.php,
mobile/include/style, mobile/include/style/main.css,
mobile/include/user.class.php, mobile/include/functions_web.php,
mobile/include/system.class.php, mobile/images/bricks.png,
mobile/images/up.png, mobile/images/zoom.png, mobile/images/down.png: added
first version of file for Pandora Mobile version.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3246 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-09-15 17:54:59 +02:00
|
|
|
?>
|