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-11-11 Raúl Mateos <raulofpandora@gmail.com>
* general/error_install.php, general/error_perms.php, general/header.php,
general/logon_menu.php, general/logon_ok.php, include/functions_menu.php,
include/functions_ui.php, extensions/agents_modules.php,
operation/menu.php, godmode/menu.php, operation/estado_agente.php,
operation/agentes/estado_agente.php, operation/agentes/status_monitor.php,
operation/agentes/estado_monitores.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php, pandoradb_data.sql: Closed
some HTML tags, autoclose others, added alt to images, and changed some
& to "&" to help validation for XHTML 1.0 Transitional. Tested and
not error found, but needs more tests...
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3572 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-11-11 12:16:09 +01: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-07-11 13:02:20 +02:00
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
2008-04-01 15:53:11 +02:00
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
2006-03-27 05:37:27 +02:00
// Load global vars
2010-03-02 20:25:51 +01:00
global $config ;
2009-10-06 21:54:50 +02:00
2019-01-30 16:18:44 +01:00
require_once 'include/functions_agents.php' ;
2009-10-06 21:54:50 +02:00
2019-01-30 16:18:44 +01:00
require_once $config [ 'homedir' ] . '/include/functions_graph.php' ;
2011-05-11 11:08:47 +02:00
include_graphs_dependencies ();
2019-01-30 16:18:44 +01:00
require_once $config [ 'homedir' ] . '/include/functions_groups.php' ;
require_once $config [ 'homedir' ] . '/include/functions_ui.php' ;
require_once $config [ 'homedir' ] . '/include/functions_incidents.php' ;
require_once $config [ 'homedir' ] . '/include/functions_reporting_html.php' ;
2011-05-11 11:08:47 +02:00
2019-01-30 16:18:44 +01:00
require_once $config [ 'homedir' ] . '/include/functions_clippy.php' ;
2014-08-14 13:25:46 +02:00
2019-01-30 16:18:44 +01:00
check_login ();
2006-07-11 13:02:20 +02:00
2019-01-30 16:18:44 +01:00
$strict_user = ( bool ) db_get_value ( 'strict_acl' , 'tusuario' , 'id_user' , $config [ 'id_user' ]);
2011-05-11 11:08:47 +02:00
2019-01-30 16:18:44 +01:00
$id_agente = get_parameter_get ( 'id_agente' , - 1 );
2008-11-06 21:16:15 +01:00
2019-01-30 16:18:44 +01:00
$agent = db_get_row ( 'tagente' , 'id_agente' , $id_agente );
2008-11-06 21:16:15 +01:00
2013-08-30 13:21:51 +02:00
if ( empty ( $agent [ 'server_name' ])) {
2019-01-30 16:18:44 +01:00
ui_print_error_message (
__ ( 'The agent has not assigned server. Maybe agent does not run fine.' )
);
2013-08-30 13:21:51 +02:00
}
2008-11-06 21:16:15 +01:00
if ( $agent === false ) {
2019-01-30 16:18:44 +01:00
ui_print_error_message ( __ ( 'There was a problem loading agent' ));
return ;
2008-11-06 21:16:15 +01:00
}
2019-01-30 16:18:44 +01:00
$is_extra = enterprise_hook ( 'policies_is_agent_extra_policy' , [ $id_agente ]);
2011-11-24 19:19:09 +01:00
2013-01-30 17:29:49 +01:00
if ( $is_extra === ENTERPRISE_NOT_HOOK ) {
2019-01-30 16:18:44 +01:00
$is_extra = false ;
2011-11-24 19:19:09 +01:00
}
2019-01-30 16:18:44 +01:00
if ( ! check_acl_one_of_groups ( $config [ 'id_user' ], $all_groups , 'AR' ) && ! check_acl_one_of_groups ( $config [ 'id_user' ], $all_groups , 'AW' ) && ! $is_extra ) {
db_pandora_audit (
'ACL Violation' ,
'Trying to access Agent General Information'
);
include_once 'general/noaccess.php' ;
return ;
2008-07-21 14:23:28 +02:00
}
2010-04-21 19:52:08 +02:00
2013-02-22 14:48:10 +01:00
// START: TABLE AGENT BUILD
2015-05-25 13:31:10 +02:00
$table_agent = new stdClass ();
2013-02-22 14:48:10 +01:00
$table_agent -> id = 'agent_details_main' ;
2015-07-09 17:52:37 +02:00
$table_agent -> width = '95%' ;
2015-04-21 17:26:20 +02:00
$table_agent -> cellspacing = 0 ;
$table_agent -> cellpadding = 0 ;
2015-07-09 17:52:37 +02:00
$table_agent -> class = 'databox filters' ;
2013-05-20 18:43:28 +02:00
$table_agent -> style [ 0 ] = 'width: 16px; text-align:center; padding: 0px;' ;
$table_agent -> style [ 5 ] = 'width: 16px; text-align:center; padding: 0px;' ;
$table_agent -> styleTable = 'padding:0px;' ;
2019-01-30 16:18:44 +01:00
$table_agent -> data = [];
$data = [];
2013-02-22 14:48:10 +01:00
2019-01-30 16:18:44 +01:00
$agent_name = ui_print_agent_name ( $agent [ 'id_agente' ], true , 500 , 'font-size: medium;font-weight:bold' , true );
$in_planned_downtime = db_get_sql (
' SELECT executed FROM tplanned_downtime
2017-10-18 11:15:51 +02:00
INNER JOIN tplanned_downtime_agents
ON tplanned_downtime . id = tplanned_downtime_agents . id_downtime
2019-01-30 16:18:44 +01:00
WHERE tplanned_downtime_agents . id_agent = '.$agent[' id_agente '].' AND tplanned_downtime . executed = 1 '
);
2017-10-18 11:15:51 +02:00
2013-02-22 14:48:10 +01:00
2010-05-21 10:59:14 +02:00
if ( $agent [ 'disabled' ]) {
2019-01-30 16:18:44 +01:00
if ( $in_planned_downtime ) {
$agent_name = '<em>' . $agent_name . ui_print_help_tip ( __ ( 'Disabled' ), true );
} else {
$agent_name = '<em>' . $agent_name . '</em>' . ui_print_help_tip ( __ ( 'Disabled' ), true );
}
} else if ( $agent [ 'quiet' ]) {
if ( $in_planned_downtime ) {
$agent_name = " <em'> " . $agent_name . ' ' . html_print_image ( 'images/dot_blue.png' , true , [ 'border' => '0' , 'title' => __ ( 'Quiet' ), 'alt' => '' ]);
} else {
$agent_name = " <em'> " . $agent_name . ' ' . html_print_image ( 'images/dot_blue.png' , true , [ 'border' => '0' , 'title' => __ ( 'Quiet' ), 'alt' => '' ]) . '</em>' ;
}
} else {
$agent_name = $agent_name ;
2010-05-21 10:59:14 +02:00
}
2011-01-20 15:41:12 +01:00
2017-09-25 10:29:34 +02:00
if ( $in_planned_downtime && ! $agent [ 'disabled' ] && ! $agent [ 'quiet' ]) {
2019-01-30 16:18:44 +01:00
$agent_name .= '<em>' . ' ' . ui_print_help_tip ( __ ( 'Agent in planned downtime' ), true , 'images/minireloj-16.png' ) . '</em>' ;
} else if (( $in_planned_downtime && ! $agent [ 'disabled' ]) || ( $in_planned_downtime && ! $agent [ 'quiet' ])) {
$agent_name .= ' ' . ui_print_help_tip ( __ ( 'Agent in planned downtime' ), true , 'images/minireloj-16.png' ) . '</em>' ;
2017-09-25 10:25:12 +02:00
}
2019-01-30 16:18:44 +01:00
if ( ! $config [ 'show_group_name' ]) {
$data [ 0 ] = ui_print_group_icon ( $agent [ 'id_grupo' ], true );
} else {
$data [ 0 ] = '' ;
2017-09-25 10:25:12 +02:00
}
2019-01-30 16:18:44 +01:00
$table_agent -> cellstyle [ count ( $table_agent -> data )][ 0 ] = 'width: 16px; text-align:center; padding: 0px;' ;
2013-05-20 18:43:28 +02:00
$data [ 2 ] = $agent_name ;
$table_agent -> colspan [ count ( $table_agent -> data )][ 2 ] = 3 ;
2013-02-22 14:48:10 +01:00
2019-01-30 16:18:44 +01:00
$table_agent -> cellstyle [ count ( $table_agent -> data )][ 2 ] = 'width: 100px; word-break: break-all;' ;
2013-05-29 15:11:40 +02:00
2019-01-30 16:18:44 +01:00
$status_img = agents_detail_view_status_img (
$agent [ 'critical_count' ],
$agent [ 'warning_count' ],
$agent [ 'unknown_count' ],
$agent [ 'total_count' ],
$agent [ 'notinit_count' ]
);
$data [ 2 ] .= ' ' . $status_img ;
2013-02-22 14:48:10 +01:00
$table_agent -> data [] = $data ;
$table_agent -> rowclass [] = '' ;
2013-04-10 09:57:54 +02:00
2013-02-22 14:48:10 +01:00
2019-01-30 16:18:44 +01:00
$data = [];
2013-05-20 18:43:28 +02:00
2019-01-30 16:18:44 +01:00
// $data[0] = reporting_tiny_stats ($agent, true, 'agent', '<div style="height: 5px;"></div>');
// $table_agent->rowspan[count($table_agent->data)][0] = 6;
2017-11-14 12:20:28 +01:00
// Fixed width non interactive charts
2018-10-19 11:31:06 +02:00
$status_chart_width = 150 ;
$graph_width = 150 ;
2017-11-14 12:20:28 +01:00
2013-05-23 17:42:32 +02:00
$data [ 0 ] = '<div style="margin: 0 auto 6px auto; width: 150px;">' ;
2019-01-30 16:18:44 +01:00
$data [ 0 ] .= '<div id="status_pie" style="margin: auto; width: ' . $status_chart_width . 'px;">' ;
$data [ 0 ] .= graph_agent_status ( $id_agente , $graph_width , 120 , true );
2017-11-14 12:20:28 +01:00
$data [ 0 ] .= '</div>' ;
2019-01-30 16:18:44 +01:00
$data [ 0 ] .= '<br>' . reporting_tiny_stats ( $agent , true );
2013-10-09 10:42:00 +02:00
$data [ 0 ] .= ui_print_help_tip ( __ ( 'Agent statuses are re-calculated by the server, they are not shown in real time.' ), true );
2013-05-20 18:43:28 +02:00
$data [ 0 ] .= '</div>' ;
$table_agent -> rowspan [ count ( $table_agent -> data )][ 0 ] = 6 ;
$table_agent -> colspan [ count ( $table_agent -> data )][ 0 ] = 2 ;
2019-01-30 16:18:44 +01:00
$table_agent -> cellstyle [ count ( $table_agent -> data )][ 0 ] = 'width: 150px; text-align:center; padding: 0px; vertical-align: top;' ;
2013-04-10 09:57:54 +02:00
2013-05-23 17:42:32 +02:00
2019-01-30 16:18:44 +01:00
$data [ 2 ] = ui_print_os_icon ( $agent [ 'id_os' ], false , true , true , false , false , false , [ 'title' => __ ( 'OS' ) . ': ' . get_os_name ( $agent [ 'id_os' ])]);
$table_agent -> cellstyle [ count ( $table_agent -> data )][ 2 ] = 'width: 16px; text-align: right; padding: 0px;' ;
$data [ 3 ] = empty ( $agent [ 'os_version' ]) ? get_os_name (( int ) $agent [ 'id_os' ]) : $agent [ 'os_version' ];
2013-05-20 18:43:28 +02:00
$table_agent -> colspan [ count ( $table_agent -> data )][ 3 ] = 2 ;
2013-04-10 09:57:54 +02:00
$table_agent -> data [] = $data ;
$table_agent -> rowclass [] = '' ;
2013-02-22 14:48:10 +01:00
$addresses = agents_get_addresses ( $id_agente );
$address = agents_get_address ( $id_agente );
2013-08-30 13:21:51 +02:00
2013-02-27 11:22:51 +01:00
foreach ( $addresses as $k => $add ) {
2019-01-30 16:18:44 +01:00
if ( $add == $address ) {
unset ( $addresses [ $k ]);
}
2011-01-20 15:41:12 +01:00
}
2013-02-22 14:48:10 +01:00
2013-05-29 15:11:40 +02:00
if ( ! empty ( $address )) {
2019-01-30 16:18:44 +01:00
$data = [];
$data [ 2 ] = html_print_image ( 'images/world.png' , true , [ 'title' => __ ( 'IP address' )]);
$table_agent -> cellstyle [ count ( $table_agent -> data )][ 2 ] = 'width: 16px; text-align: right; padding: 0px;' ;
$data [ 3 ] = '<span style="vertical-align:top; display: inline-block;">' ;
$data [ 3 ] .= empty ( $address ) ? '<em>' . __ ( 'N/A' ) . '</em>' : $address ;
$data [ 3 ] .= '</span>' ;
$table_agent -> colspan [ count ( $table_agent -> data )][ 3 ] = 2 ;
$table_agent -> data [] = $data ;
$table_agent -> rowclass [] = '' ;
2013-04-10 09:57:54 +02:00
}
2013-02-22 14:48:10 +01:00
2019-01-30 16:18:44 +01:00
$data = [];
$data [ 2 ] = html_print_image ( 'images/version.png' , true , [ 'title' => __ ( 'Agent Version' )]);
$table_agent -> cellstyle [ count ( $table_agent -> data )][ 2 ] = 'width: 16px; text-align: right; padding: 0px;' ;
2013-05-20 18:43:28 +02:00
$data [ 3 ] = '<span style="vertical-align:top; display: inline-block;">' ;
2019-01-30 16:18:44 +01:00
$data [ 3 ] .= empty ( $agent [ 'agent_version' ]) ? '<i>' . __ ( 'N/A' ) . '</i>' : $agent [ 'agent_version' ];
2013-05-20 18:43:28 +02:00
$data [ 3 ] .= '</span>' ;
$table_agent -> colspan [ count ( $table_agent -> data )][ 3 ] = 2 ;
2013-02-22 14:48:10 +01:00
$table_agent -> data [] = $data ;
$table_agent -> rowclass [] = '' ;
2019-01-30 16:18:44 +01:00
$data = [];
$data [ 2 ] = html_print_image (
'images/default_list.png' ,
true ,
[ 'title' => __ ( 'Description' )]
);
$table_agent -> cellstyle [ count ( $table_agent -> data )][ 2 ] = 'width: 16px; text-align: right; padding: 0px;' ;
2013-05-20 18:43:28 +02:00
$data [ 3 ] = '<span style="vertical-align:top; display: inline-block;">' ;
2019-01-30 16:18:44 +01:00
$data [ 3 ] .= empty ( $agent [ 'comentarios' ]) ? '<em>' . __ ( 'N/A' ) . '</em>' : $agent [ 'comentarios' ];
2013-05-20 18:43:28 +02:00
$data [ 3 ] .= '</span>' ;
$table_agent -> colspan [ count ( $table_agent -> data )][ 3 ] = 2 ;
2013-02-28 16:12:49 +01:00
$table_agent -> data [] = $data ;
$table_agent -> rowclass [] = '' ;
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
2013-02-28 16:12:49 +01:00
// END: TABLE AGENT BUILD
// START: TABLE CONTACT BUILD
2015-05-25 13:31:10 +02:00
$table_contact = new stdClass ();
2013-02-28 16:12:49 +01:00
$table_contact -> id = 'agent_contact_main' ;
$table_contact -> width = '100%' ;
2015-04-21 17:26:20 +02:00
$table_contact -> cellspacing = 0 ;
$table_contact -> cellpadding = 0 ;
2015-04-01 13:24:53 +02:00
$table_contact -> class = 'databox data' ;
2017-02-07 17:04:24 +01:00
$table_contact -> style [ 0 ] = 'width: 30%;height:30px;' ;
2013-02-28 16:12:49 +01:00
$table_contact -> style [ 1 ] = 'width: 70%;' ;
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
2019-01-30 16:18:44 +01:00
$table_contact -> head [ 0 ] = ' <span>' . __ ( 'Agent contact' ) . '</span>' ;
2013-02-28 16:12:49 +01:00
$table_contact -> head_colspan [ 0 ] = 2 ;
2013-02-20 19:07:52 +01:00
2019-01-30 16:18:44 +01:00
$data = [];
$data [ 0 ] = '<b>' . __ ( 'Interval' ) . '</b>' ;
$data [ 1 ] = human_time_description_raw ( $agent [ 'intervalo' ]);
2013-02-28 16:12:49 +01:00
$table_contact -> data [] = $data ;
2013-02-20 19:07:52 +01:00
2019-01-30 16:18:44 +01:00
$data = [];
$data [ 0 ] = '<b>' . __ ( 'Last contact' ) . ' / ' . __ ( 'Remote' ) . '</b>' ;
$data [ 1 ] = ui_print_timestamp ( $agent [ 'ultimo_contacto' ], true );
$data [ 1 ] .= ' / ' ;
2007-04-13 20:47:58 +02:00
2019-01-30 16:18:44 +01:00
if ( $agent [ 'ultimo_contacto_remoto' ] == '01-01-1970 00:00:00' ) {
$data [ 1 ] .= __ ( 'Never' );
} else {
$data [ 1 ] .= date_w_fixed_tz ( $agent [ 'ultimo_contacto_remoto' ]);
2013-02-20 19:07:52 +01:00
}
2008-07-21 14:23:28 +02:00
2013-02-28 16:12:49 +01:00
$table_contact -> data [] = $data ;
* ChangeLog: Create this file, prior to launch final 1.2 version. For the next
versions, will use it for every branch and subproject.
* configurar_agente.php : Fixed Undefined index: combo_snmp_oid notice error.
* estado_grupo.php: Detect old "OK" monitors, but doesnt check if they are down
in time, so for example, a old monitor with OK signal but from a week old, it is
shown as GREEN (good) value, not as a DOWN (white with ? symbol). FIXED.
Now counts data modules for DOWN total account, and show grey button if ANY
type of module is down, not only monitors. Improved SQL searches.
* estado_agente.php, estado_ultimopaquete.php: Same as estado_grupo with data_modules,
included in total account, more accurate accounting. A new value shown in grey for
DOWN modules, being monitors or single data modules, no matter type. Improved SQL
searches. Individual module intervals are used to determine if a module is down,
if there is no individual module interval, global agent interval is used.
Now it's possible to have a module with higher interval than Agent interval, so
we take now the more higest interval in modules to calculate if an agent is DOWN.
* fgraph.php: updated progressbar function to show N/A when data is above 100 or below 0.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@115 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2006-07-09 22:29:44 +02:00
2019-01-30 16:18:44 +01:00
$data [ 0 ] = '<b>' . __ ( 'Next contact' ) . '</b>' ;
2013-02-28 16:12:49 +01:00
$progress = agents_get_next_contact ( $id_agente );
2019-01-30 16:18:44 +01:00
$data [ 1 ] = progress_bar ( $progress , 200 , 20 , '' , 1 , false , '#666666' );
2014-08-14 13:25:46 +02:00
if ( $progress > 100 ) {
2019-01-30 16:18:44 +01:00
$data [ 1 ] .= clippy_context_help ( 'agent_out_of_limits' );
2014-08-14 13:25:46 +02:00
}
2013-02-28 16:12:49 +01:00
$table_contact -> data [] = $data ;
// END: TABLE CONTACT BUILD
// START: TABLE DATA BUILD
2015-05-25 13:31:10 +02:00
$table_data = new stdClass ();
2013-02-28 16:12:49 +01:00
$table_data -> id = 'agent_data_main' ;
$table_data -> width = '100%' ;
2015-10-07 09:57:45 +02:00
$table_data -> styleTable = 'height:180px' ;
2015-04-21 17:26:20 +02:00
$table_data -> cellspacing = 0 ;
$table_data -> cellpadding = 0 ;
2015-04-01 13:24:53 +02:00
$table_data -> class = 'databox data' ;
2013-02-28 16:12:49 +01:00
$table_data -> style [ 0 ] = 'width: 30%;' ;
2015-10-07 09:57:45 +02:00
$table_data -> style [ 1 ] = 'width: 40%;' ;
2013-02-28 16:12:49 +01:00
2019-01-30 16:18:44 +01:00
$table_data -> head [ 0 ] = ' <span>' . __ ( 'Agent info' ) . '</span>' ;
2015-10-07 09:57:45 +02:00
$table_data -> head_colspan [ 0 ] = 3 ;
2013-02-22 14:48:10 +01:00
2019-01-30 16:18:44 +01:00
$data = [];
$data [ 0 ] = '<b>' . __ ( 'Group' ) . '</b>' ;
$data [ 1 ] = '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id=' . $agent [ 'id_grupo' ] . '">' . groups_get_name ( $agent [ 'id_grupo' ]) . '</a>' ;
2015-10-07 09:57:45 +02:00
// ACCESS RATE GRAPH
2019-01-30 16:18:44 +01:00
$access_agent = db_get_value_sql (
' SELECT COUNT ( id_agent )
2015-10-07 09:57:45 +02:00
FROM tagent_access
2019-01-30 16:18:44 +01:00
WHERE id_agent = ' . $id_agente
);
if ( $config [ 'agentaccess' ] && $access_agent > 0 ) {
$data [ 2 ] = ' < fieldset width = 99 % class = " databox agente " style = " " >
< legend > '.__(' Agent access rate ( 24 h ) ').' </ legend > '.graphic_agentaccess($id_agente, ' 95 % ', 100, SECONDS_1DAY, true).' </ fieldset > ' ;
$table_data -> style [ 0 ] = 'width: 20%;' ;
$table_data -> style [ 1 ] = 'width: 30%;' ;
$table_data -> style [ 2 ] = 'width: 50%;' ;
$table_data -> rowspan [ 0 ][ 2 ] = 5 ;
2015-10-07 09:57:45 +02:00
}
2014-06-06 13:47:33 +02:00
$table_data -> data [] = $data ;
2013-04-10 09:57:54 +02:00
if ( ! empty ( $addresses )) {
2019-01-30 16:18:44 +01:00
$data = [];
$data [ 0 ] = '<b>' . __ ( 'Other IP addresses' ) . '</b>' ;
$data [ 1 ] = '<div style="max-height: 45px; overflow-y: scroll; height:45px;">' . implode ( '<br>' , $addresses ) . '</div>' ;
$table_data -> data [] = $data ;
2013-04-10 09:57:54 +02:00
}
2019-01-30 16:18:44 +01:00
$data = [];
$data [ 0 ] = '<b>' . __ ( 'Parent' ) . '</b>' ;
if ( $agent [ 'id_parent' ] == 0 ) {
$data [ 1 ] = '<em>' . __ ( 'N/A' ) . '</em>' ;
} else {
$data [ 1 ] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $agent [ 'id_parent' ] . '">' . agents_get_alias ( $agent [ 'id_parent' ]) . '</a>' ;
2013-04-10 09:57:54 +02:00
}
$table_data -> data [] = $data ;
2019-01-30 16:18:44 +01:00
$has_remote_conf = enterprise_hook ( 'config_agents_has_remote_configuration' , [ $agent [ 'id_agente' ]]);
2013-04-10 09:57:54 +02:00
2014-10-24 11:03:45 +02:00
if ( enterprise_installed ()) {
2019-01-30 16:18:44 +01:00
$data = [];
$data [ 0 ] = '<b>' . __ ( 'Remote configuration' ) . '</b>' ;
if ( ! $has_remote_conf ) {
$data [ 1 ] = __ ( 'Disabled' );
} else {
$data [ 1 ] = __ ( 'Enabled' );
}
$table_data -> data [] = $data ;
$data = [];
$data [ 0 ] = '<b>' . __ ( 'Secondary groups' ) . '</b>' ;
$secondary_groups = enterprise_hook ( 'agents_get_secondary_groups' , [ $id_agente ]);
if ( ! $secondary_groups ) {
$data [ 1 ] = '<em>' . __ ( 'N/A' ) . '</em>' ;
} else {
$secondary_links = [];
foreach ( $secondary_groups [ 'for_select' ] as $id => $name ) {
$secondary_links [] = '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id=' . $id . '">' . $name . '</a>' ;
}
$data [ 1 ] = implode ( ', ' , $secondary_links );
}
$table_data -> data [] = $data ;
2013-04-10 09:57:54 +02:00
}
2013-02-20 19:07:52 +01:00
if ( $config [ 'activate_gis' ] || $agent [ 'url_address' ] != '' ) {
2019-01-30 16:18:44 +01:00
$data = [];
// Position Information
if ( $config [ 'activate_gis' ]) {
$dataPositionAgent = gis_get_data_last_position_agent ( $agent [ 'id_agente' ]);
$data [ 0 ] = '<b>' . __ ( 'Position (Long, Lat)' ) . '</b>' ;
if ( $dataPositionAgent === false ) {
$data [ 1 ] = __ ( 'There is no GIS data.' );
} else {
$data [ 1 ] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=gis&id_agente=' . $id_agente . '">' ;
if ( $dataPositionAgent [ 'description' ] != '' ) {
$data [ 1 ] .= $dataPositionAgent [ 'description' ];
} else {
$data [ 1 ] .= $dataPositionAgent [ 'stored_longitude' ] . ', ' . $dataPositionAgent [ 'stored_latitude' ];
}
$data [ 1 ] .= '</a>' ;
}
$table_data -> data [] = $data ;
}
// If the url description is setted
if ( $agent [ 'url_address' ] != '' ) {
$data = [];
$data [ 0 ] = '<b>' . __ ( 'Url address' ) . '</b>' ;
$data [ 1 ] = '<a href=' . $agent [ 'url_address' ] . '>' . $agent [ 'url_address' ] . '</a>' ;
$table_data -> data [] = $data ;
}
2013-02-21 15:26:00 +01:00
}
2013-02-22 14:48:10 +01:00
// Timezone Offset
if ( $agent [ 'timezone_offset' ] != 0 ) {
2019-01-30 16:18:44 +01:00
$data = [];
$data [ 0 ] = '<b>' . __ ( 'Timezone Offset' ) . '</b>' ;
$data [ 1 ] = $agent [ 'timezone_offset' ];
$table -> data [] = $data ;
2013-02-21 15:26:00 +01:00
}
2013-02-20 18:15:38 +01:00
2010-08-25 14:04:42 +02:00
// Custom fields
2014-10-24 11:03:45 +02:00
$fields = db_get_all_rows_filter (
2019-01-30 16:18:44 +01:00
'tagent_custom_fields' ,
[ 'display_on_front' => 1 ]
);
2010-10-04 13:28:31 +02:00
if ( $fields === false ) {
2019-01-30 16:18:44 +01:00
$fields = [];
2010-10-04 13:28:31 +02:00
}
2013-02-20 19:07:52 +01:00
2013-01-30 17:29:49 +01:00
foreach ( $fields as $field ) {
2019-01-30 16:18:44 +01:00
$data = [];
$data [ 0 ] = '<b>' . $field [ 'name' ] . ui_print_help_tip ( __ ( 'Custom field' ), true ) . '</b>' ;
$custom_value = db_get_all_rows_sql (
' select tagent_custom_data . description , tagent_custom_fields . is_password_type from tagent_custom_fields
INNER JOIN tagent_custom_data ON tagent_custom_fields . id_field = tagent_custom_data . id_field where tagent_custom_fields . id_field = '.$field[' id_field '].' and tagent_custom_data . id_agent = ' . $id_agente
);
if ( $custom_value [ 0 ][ 'description' ] === false || $custom_value [ 0 ][ 'description' ] == '' ) {
$custom_value [ 0 ][ 'description' ] = '<i>-' . __ ( 'empty' ) . '-</i>' ;
} else {
$custom_value [ 0 ][ 'description' ] = ui_bbcode_to_html ( $custom_value [ 0 ][ 'description' ]);
}
if ( $custom_value [ 0 ][ 'is_password_type' ]) {
$data [ 1 ] = '••••••••' ;
} else {
$data [ 1 ] = $custom_value [ 0 ][ 'description' ];
}
$table_data -> data [] = $data ;
2010-08-25 14:04:42 +02:00
}
2013-02-28 16:12:49 +01:00
// END: TABLE DATA BUILD
2014-05-05 10:27:02 +02:00
// START: TABLE INCIDENTS
2019-01-30 16:18:44 +01:00
$last_incident = db_get_row_sql (
"
2014-10-24 11:03:45 +02:00
SELECT * FROM tincidencia
WHERE estado IN ( 0 , 1 )
AND id_agent = $id_agente
2019-01-30 16:18:44 +01:00
ORDER BY actualizacion DESC "
);
2014-07-23 18:59:05 +02:00
2014-05-05 10:27:02 +02:00
if ( $last_incident != false ) {
2019-01-30 16:18:44 +01:00
$table_incident -> id = 'agent_incident_main' ;
$table_incident -> width = '100%' ;
$table_incident -> cellspacing = 0 ;
$table_incident -> cellpadding = 0 ;
$table_incident -> class = 'databox' ;
$table_incident -> style [ 0 ] = 'width: 30%;' ;
$table_incident -> style [ 1 ] = 'width: 70%;' ;
$table_incident -> head [ 0 ] = ' <span>' . '<a href="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&id=' . $last_incident [ 'id_incidencia' ] . '">' . __ ( 'Active incident on this agent' ) . '</a>' . '</span>' ;
$table_incident -> head_colspan [ 0 ] = 2 ;
$data = [];
$data [ 0 ] = '<b>' . __ ( 'Author' ) . '</b>' ;
$data [ 1 ] = $last_incident [ 'id_creator' ];
$table_incident -> data [] = $data ;
$data = [];
$data [ 0 ] = '<b>' . __ ( 'Title' ) . '</b>' ;
$data [ 1 ] = '<a href="index.php?sec=incidencias&sec2=operation/incidents/incident_detail&id=' . $last_incident [ 'id_incidencia' ] . '">' . $last_incident [ 'titulo' ] . '</a>' ;
$table_incident -> data [] = $data ;
$data = [];
$data [ 0 ] = '<b>' . __ ( 'Timestamp' ) . '</b>' ;
$data [ 1 ] = $last_incident [ 'inicio' ];
$table_incident -> data [] = $data ;
$data = [];
$data [ 0 ] = '<b>' . __ ( 'Priority' ) . '</b>' ;
$data [ 1 ] = incidents_print_priority_img ( $last_incident [ 'prioridad' ], true );
$table_incident -> data [] = $data ;
2014-05-05 10:27:02 +02:00
}
2019-01-30 16:18:44 +01:00
// END: TABLE INCIDENTS
2014-03-18 Alejandro Gallardo <alejandro.gallardo@artica.es>
* pandoradb.data.oracle.sql,
pandoradb.data.postgreSQL.sql,
pandoradb.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql:
Added the table "tmodule_relationship".
* operation/agentes/estado_generalagente.php: Added a
new table to show the network interfaces of the agent.
Minor fixes.
* include/styles/pandora.css: Added properties for the
class transparent'.
* include/ajax/module.php: Fixed an error and added code
to retrieve a module autocomplete input or add, remove
or update a module relation via ajax.
* include/functions_modules.php: Added the functions
"modules_get_relations", "modules_relation_exists",
"modules_add_relation", "modules_delete_relation" and
"modules_change_relation_lock".
* godmode/agentes/module_manager_editor_common.php:
Added a table and control to show, add or delete
relations with other modules. Added the javascript
functions "change_modules_autocomplete_input",
"add_new_relation", "change_lock_relation" and
"delete_relation".
* godmode/agentes/module_manager_editor.php: Added a
line to show the module relations table and control.
* godmode/agentes/module_manager_editor_network.php:
Minor fix.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9610 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-03-18 12:49:33 +01:00
// START: TABLE INTERFACES
2019-01-30 16:18:44 +01:00
$network_interfaces_by_agents = agents_get_network_interfaces ([ $agent ]);
2014-03-18 Alejandro Gallardo <alejandro.gallardo@artica.es>
* pandoradb.data.oracle.sql,
pandoradb.data.postgreSQL.sql,
pandoradb.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql:
Added the table "tmodule_relationship".
* operation/agentes/estado_generalagente.php: Added a
new table to show the network interfaces of the agent.
Minor fixes.
* include/styles/pandora.css: Added properties for the
class transparent'.
* include/ajax/module.php: Fixed an error and added code
to retrieve a module autocomplete input or add, remove
or update a module relation via ajax.
* include/functions_modules.php: Added the functions
"modules_get_relations", "modules_relation_exists",
"modules_add_relation", "modules_delete_relation" and
"modules_change_relation_lock".
* godmode/agentes/module_manager_editor_common.php:
Added a table and control to show, add or delete
relations with other modules. Added the javascript
functions "change_modules_autocomplete_input",
"add_new_relation", "change_lock_relation" and
"delete_relation".
* godmode/agentes/module_manager_editor.php: Added a
line to show the module relations table and control.
* godmode/agentes/module_manager_editor_network.php:
Minor fix.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9610 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-03-18 12:49:33 +01:00
2019-01-30 16:18:44 +01:00
$network_interfaces = [];
2015-02-02 13:22:35 +01:00
if ( ! empty ( $network_interfaces_by_agents ) && ! empty ( $network_interfaces_by_agents [ $id_agente ])) {
2019-01-30 16:18:44 +01:00
$network_interfaces = $network_interfaces_by_agents [ $id_agente ][ 'interfaces' ];
2015-02-02 13:22:35 +01:00
}
if ( ! empty ( $network_interfaces )) {
2019-01-30 16:18:44 +01:00
$table_interface = new stdClass ();
$table_interface -> id = 'agent_interface_info' ;
$table_interface -> class = 'databox data' ;
$table_interface -> width = '98%' ;
$table_interface -> style = [];
$table_interface -> style [ 'interface_status' ] = 'width: 30px;padding-top:0px;padding-bottom:0px;' ;
$table_interface -> style [ 'interface_graph' ] = 'width: 20px;padding-top:0px;padding-bottom:0px;' ;
$table_interface -> style [ 'interface_event_graph' ] = 'width: 100%;padding-top:0px;padding-bottom:0px;' ;
$table_interface -> align [ 'interface_event_graph' ] = 'right' ;
// $table_interface->style['interface_event_graph'] = 'width: 5%;padding-top:0px;padding-bottom:0px;';
$table_interface -> align [ 'interface_event_graph_text' ] = 'left' ;
$table_interface -> style [ 'interface_name' ] = 'width: 10%;padding-top:0px;padding-bottom:0px;' ;
$table_interface -> align [ 'interface_name' ] = 'left' ;
$table_interface -> align [ 'interface_ip' ] = 'left' ;
$table_interface -> align [ 'last_contact' ] = 'left' ;
$table_interface -> style [ 'last_contact' ] = 'width: 40%;padding-top:0px;padding-bottom:0px;' ;
$table_interface -> style [ 'interface_ip' ] = 'width: 8%;padding-top:0px;padding-bottom:0px;' ;
$table_interface -> style [ 'interface_mac' ] = 'width: 12%;padding-top:0px;padding-bottom:0px;' ;
$table_interface -> head = [];
$options = [
'class' => 'closed' ,
'style' => 'vertical-align:righ; cursor:pointer;' ,
];
$table_interface -> head [ 0 ] = html_print_image ( 'images/graphmenu_arrow.png' , true , $options ) . ' ' ;
$table_interface -> head [ 0 ] .= '<span style="vertical-align: middle;">' . __ ( 'Interface information' ) . ' (SNMP)</span>' ;
$table_interface -> head_colspan = [];
$table_interface -> head_colspan [ 0 ] = 8 ;
$table_interface -> data = [];
$event_text_cont = 0 ;
foreach ( $network_interfaces as $interface_name => $interface ) {
if ( ! empty ( $interface [ 'traffic' ])) {
$permission = check_acl_one_of_groups ( $config [ 'id_user' ], $all_groups , 'RR' );
if ( $permission ) {
$params = [
'interface_name' => $interface_name ,
'agent_id' => $id_agente ,
'traffic_module_in' => $interface [ 'traffic' ][ 'in' ],
'traffic_module_out' => $interface [ 'traffic' ][ 'out' ],
];
$params_json = json_encode ( $params );
$params_encoded = base64_encode ( $params_json );
$win_handle = dechex ( crc32 ( $interface [ 'status_module_id' ] . $interface_name ));
$graph_link = " <a href= \" javascript:winopeng('operation/agentes/interface_traffic_graph_win.php?params= $params_encoded ',' $win_handle ') \" > " . html_print_image ( 'images/chart_curve.png' , true , [ 'title' => __ ( 'Interface traffic' )]) . '</a>' ;
} else {
$graph_link = '' ;
}
} else {
$graph_link = '' ;
}
$events_limit = 5000 ;
$user_groups = users_get_groups ( $config [ 'id_user' ], 'ER' );
$user_groups_ids = array_keys ( $user_groups );
if ( empty ( $user_groups )) {
$groups_condition = ' 1 = 0 ' ;
} else {
$groups_condition = ' id_grupo IN (' . implode ( ',' , $user_groups_ids ) . ') ' ;
}
if ( ! check_acl ( $config [ 'id_user' ], 0 , 'PM' )) {
$groups_condition .= ' AND id_grupo != 0' ;
}
$status_condition = ' AND (estado = 0 OR estado = 1) ' ;
$unixtime = ( get_system_time () - SECONDS_1DAY );
// last hour
$time_condition = 'AND (utimestamp > ' . $unixtime . ')' ;
// Tags ACLS
if ( $id_group > 0 && in_array ( 0 , $user_groups_ids )) {
$group_array = ( array ) $id_group ;
} else {
$group_array = $user_groups_ids ;
}
$acl_tags = tags_get_acl_tags (
$config [ 'id_user' ],
$group_array ,
'ER' ,
'event_condition' ,
'AND' ,
'' ,
true ,
[],
true
);
$id_modules_array = [];
$id_modules_array [] = $interface [ 'status_module_id' ];
$unixtime = ( get_system_time () - SECONDS_1DAY );
// last hour
$time_condition = 'WHERE (te.utimestamp > ' . $unixtime . ')' ;
$sqlEvents = sprintf (
'
2015-10-07 09:57:45 +02:00
SELECT *
2015-10-07 11:33:12 +02:00
FROM tevento te
INNER JOIN tagente_estado tae
ON te . id_agentmodule = tae . id_agente_modulo
AND tae . id_agente_modulo IN ( % s )
2015-10-09 09:20:30 +02:00
% s
2019-01-30 16:18:44 +01:00
' ,
implode ( ',' , $id_modules_array ),
$time_condition
);
2015-10-07 09:57:45 +02:00
2019-01-30 16:18:44 +01:00
$sqlLast_contact = sprintf (
'
2015-10-07 09:57:45 +02:00
SELECT last_try
FROM tagente_estado
2019-01-30 16:18:44 +01:00
WHERE id_agente_modulo = '.$interface[' status_module_id ' ]
);
$last_contact = db_get_all_rows_sql ( $sqlLast_contact );
$last_contact = array_shift ( $last_contact );
$last_contact = array_shift ( $last_contact );
$events = db_get_all_rows_sql ( $sqlEvents );
$text_event_header = __ ( 'Events info (24hr.)' );
if ( ! $events ) {
$no_events = [ 'color' => [ 'criticity' => 2 ]];
$e_graph = reporting_get_event_histogram ( $no_events , $text_event_header );
} else {
$e_graph = reporting_get_event_histogram ( $events , $text_event_header );
}
$data = [];
$data [ 'interface_name' ] = '<strong>' . $interface_name . '</strong>' ;
$data [ 'interface_status' ] = $interface [ 'status_image' ];
$data [ 'interface_graph' ] = $graph_link ;
$data [ 'interface_ip' ] = $interface [ 'ip' ];
$data [ 'interface_mac' ] = $interface [ 'mac' ];
$data [ 'last_contact' ] = __ ( 'Last contact: ' ) . $last_contact ;
$data [ 'interface_event_graph' ] = $e_graph ;
if ( $event_text_cont == 0 ) {
$data [ 'interface_event_graph_text' ] = ui_print_help_tip ( 'Module events graph' , true );
$event_text_cont ++ ;
} else {
$data [ 'interface_event_graph_text' ] = '' ;
}
$table_interface -> data [] = $data ;
}
// This javascript piece of code is used to make expandible the body of the table
?>
< script type = " text/javascript " >
$ ( document ) . ready ( function () {
$ ( " #agent_interface_info " ) . find ( " tbody " ) . hide ();
$ ( " #agent_interface_info " ) . find ( " thead " ) . click ( function () {
var arrow = $ ( " #agent_interface_info " ) . find ( " thead " ) . find ( " img " );
if ( arrow . hasClass ( " closed " )) {
arrow . removeClass ( " closed " );
arrow . prop ( " src " , " images/arrow-down-white.png " );
$ ( " #agent_interface_info " ) . find ( " tbody " ) . show ();
} else {
arrow . addClass ( " closed " );
arrow . prop ( " src " , " images/graphmenu_arrow.png " );
$ ( " #agent_interface_info " ) . find ( " tbody " ) . hide ();
}
})
. css ( 'cursor' , 'pointer' );
});
</ script >
< ? php
2014-03-18 Alejandro Gallardo <alejandro.gallardo@artica.es>
* pandoradb.data.oracle.sql,
pandoradb.data.postgreSQL.sql,
pandoradb.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql:
Added the table "tmodule_relationship".
* operation/agentes/estado_generalagente.php: Added a
new table to show the network interfaces of the agent.
Minor fixes.
* include/styles/pandora.css: Added properties for the
class transparent'.
* include/ajax/module.php: Fixed an error and added code
to retrieve a module autocomplete input or add, remove
or update a module relation via ajax.
* include/functions_modules.php: Added the functions
"modules_get_relations", "modules_relation_exists",
"modules_add_relation", "modules_delete_relation" and
"modules_change_relation_lock".
* godmode/agentes/module_manager_editor_common.php:
Added a table and control to show, add or delete
relations with other modules. Added the javascript
functions "change_modules_autocomplete_input",
"add_new_relation", "change_lock_relation" and
"delete_relation".
* godmode/agentes/module_manager_editor.php: Added a
line to show the module relations table and control.
* godmode/agentes/module_manager_editor_network.php:
Minor fix.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9610 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-03-18 12:49:33 +01:00
}
// END: TABLE INTERFACES
2015-05-25 13:31:10 +02:00
$table = new stdClass ();
2013-02-28 16:12:49 +01:00
$table -> id = 'agent_details' ;
2015-04-01 13:24:53 +02:00
$table -> width = '100%' ;
2015-04-21 17:26:20 +02:00
$table -> cellspacing = 0 ;
$table -> cellpadding = 0 ;
2015-04-01 13:24:53 +02:00
$table -> class = 'agents' ;
2013-02-28 16:12:49 +01:00
$table -> style = array_fill ( 0 , 3 , 'vertical-align: top;' );
2019-01-30 16:18:44 +01:00
$data = [];
2015-10-07 09:57:45 +02:00
$data [ 0 ][ 0 ] = html_print_table ( $table_agent , true );
2019-01-30 16:18:44 +01:00
$data [ 0 ][ 0 ] .= ' < br /> < table width = 95 % class = " databox agente " style = " " >
< tr >< th > '.__(' Events ( 24 h ) ').' </ th ></ tr > '.' < tr >< td style = " text-align:center;padding-left:20px;padding-right:20px; " >< br /> '.graph_graphic_agentevents($id_agente, 100, 45, SECONDS_1DAY, ' ', true, true).' < br /></ td ></ tr > '.' </ table > ' ;
2013-02-28 16:12:49 +01:00
2015-09-21 09:51:00 +02:00
$table -> style [ 0 ] = 'width:40%; vertical-align:top;' ;
2015-10-07 09:57:45 +02:00
$data [ 0 ][ 1 ] = html_print_table ( $table_contact , true );
2019-01-30 16:18:44 +01:00
$data [ 0 ][ 1 ] .= empty ( $table_data -> data ) ? '' : '<br>' . html_print_table ( $table_data , true );
$data [ 0 ][ 1 ] .= ! isset ( $table_incident ) ? '' : '<br>' . html_print_table ( $table_incident , true );
2014-03-18 Alejandro Gallardo <alejandro.gallardo@artica.es>
* pandoradb.data.oracle.sql,
pandoradb.data.postgreSQL.sql,
pandoradb.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql:
Added the table "tmodule_relationship".
* operation/agentes/estado_generalagente.php: Added a
new table to show the network interfaces of the agent.
Minor fixes.
* include/styles/pandora.css: Added properties for the
class transparent'.
* include/ajax/module.php: Fixed an error and added code
to retrieve a module autocomplete input or add, remove
or update a module relation via ajax.
* include/functions_modules.php: Added the functions
"modules_get_relations", "modules_relation_exists",
"modules_add_relation", "modules_delete_relation" and
"modules_change_relation_lock".
* godmode/agentes/module_manager_editor_common.php:
Added a table and control to show, add or delete
relations with other modules. Added the javascript
functions "change_modules_autocomplete_input",
"add_new_relation", "change_lock_relation" and
"delete_relation".
* godmode/agentes/module_manager_editor.php: Added a
line to show the module relations table and control.
* godmode/agentes/module_manager_editor_network.php:
Minor fix.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9610 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-03-18 12:49:33 +01:00
2015-10-07 09:57:45 +02:00
$table -> rowspan [ 1 ][ 0 ] = 0 ;
2014-03-18 Alejandro Gallardo <alejandro.gallardo@artica.es>
* pandoradb.data.oracle.sql,
pandoradb.data.postgreSQL.sql,
pandoradb.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql:
Added the table "tmodule_relationship".
* operation/agentes/estado_generalagente.php: Added a
new table to show the network interfaces of the agent.
Minor fixes.
* include/styles/pandora.css: Added properties for the
class transparent'.
* include/ajax/module.php: Fixed an error and added code
to retrieve a module autocomplete input or add, remove
or update a module relation via ajax.
* include/functions_modules.php: Added the functions
"modules_get_relations", "modules_relation_exists",
"modules_add_relation", "modules_delete_relation" and
"modules_change_relation_lock".
* godmode/agentes/module_manager_editor_common.php:
Added a table and control to show, add or delete
relations with other modules. Added the javascript
functions "change_modules_autocomplete_input",
"add_new_relation", "change_lock_relation" and
"delete_relation".
* godmode/agentes/module_manager_editor.php: Added a
line to show the module relations table and control.
* godmode/agentes/module_manager_editor_network.php:
Minor fix.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9610 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-03-18 12:49:33 +01:00
2015-10-07 09:57:45 +02:00
$data [ 0 ][ 2 ] = '<div style="width:100%; text-align:right">' ;
2019-01-30 16:18:44 +01:00
$data [ 0 ][ 2 ] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $id_agente . '&refr=60">' . html_print_image ( 'images/refresh.png' , true , [ 'border' => '0' , 'title' => __ ( 'Refresh data' ), 'alt' => '' ]) . '</a><br>' ;
if ( check_acl_one_of_groups ( $config [ 'id_user' ], $all_groups , 'AW' )) {
$data [ 0 ][ 2 ] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&flag_agent=1&id_agente=' . $id_agente . '">' . html_print_image ( 'images/target.png' , true , [ 'border' => '0' , 'title' => __ ( 'Force remote checks' ), 'alt' => '' ]) . '</a>' ;
}
2015-10-07 09:57:45 +02:00
$data [ 0 ][ 2 ] .= '</div>' ;
2013-02-28 16:12:49 +01:00
2015-10-07 09:57:45 +02:00
$table -> data = $data ;
2013-02-28 16:12:49 +01:00
$table -> rowclass [] = '' ;
2014-03-18 Alejandro Gallardo <alejandro.gallardo@artica.es>
* pandoradb.data.oracle.sql,
pandoradb.data.postgreSQL.sql,
pandoradb.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql:
Added the table "tmodule_relationship".
* operation/agentes/estado_generalagente.php: Added a
new table to show the network interfaces of the agent.
Minor fixes.
* include/styles/pandora.css: Added properties for the
class transparent'.
* include/ajax/module.php: Fixed an error and added code
to retrieve a module autocomplete input or add, remove
or update a module relation via ajax.
* include/functions_modules.php: Added the functions
"modules_get_relations", "modules_relation_exists",
"modules_add_relation", "modules_delete_relation" and
"modules_change_relation_lock".
* godmode/agentes/module_manager_editor_common.php:
Added a table and control to show, add or delete
relations with other modules. Added the javascript
functions "change_modules_autocomplete_input",
"add_new_relation", "change_lock_relation" and
"delete_relation".
* godmode/agentes/module_manager_editor.php: Added a
line to show the module relations table and control.
* godmode/agentes/module_manager_editor_network.php:
Minor fix.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9610 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-03-18 12:49:33 +01:00
$table -> cellstyle [ 1 ][ 0 ] = 'text-align:center;' ;
2013-02-20 19:07:52 +01:00
html_print_table ( $table );
2019-01-30 16:18:44 +01:00
$data2 [ 1 ][ 0 ] = ! isset ( $table_interface ) ? '' : html_print_table ( $table_interface , true );
2015-10-07 09:57:45 +02:00
$table -> data = $data2 ;
$table -> styleTable = '' ;
html_print_table ( $table );
2013-02-20 19:07:52 +01:00
unset ( $table );
2019-01-30 16:18:44 +01:00