diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 8f8320e3c6..caf64eb1f0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,20 @@ +2013-02-19 Miguel de Dios + + * include/functions_api.php, include/functions_agents.php, + include/functions_config.php, include/ajax/reporting.ajax.php, + include/functions_snmp_browser.php, + operation/agentes/status_monitor.php: improved code style. + + * include/functions_graph.php, include/graphs/fgraph.php, + include/graphs/flot/jquery.flot.pie.js, + include/graphs/flot/jquery.flot.pie.min.js, + include/graphs/flot/pandora.flot.js, + include/graphs/functions_flot.php: fixed the pie graphs, added the + expanded version of flot pie js file with some changes for the + last version of jQuery. + + Fixes: #3604555 + 2013-02-18 Sergio Martin * include/functions_html.php diff --git a/pandora_console/include/ajax/reporting.ajax.php b/pandora_console/include/ajax/reporting.ajax.php index 5dcacdc20f..c33f0abca5 100644 --- a/pandora_console/include/ajax/reporting.ajax.php +++ b/pandora_console/include/ajax/reporting.ajax.php @@ -148,14 +148,14 @@ if ($get_metaconsole_hash_data) { $server = enterprise_hook('metaconsole_get_connection', array($server_name)); // Bad data - if (empty($server)){ + if (empty($server)) { echo ''; return; } // Deserialization of auth_token $auth_serialized = json_decode($server['auth_token'] ,true); - + $auth_token = ''; if (is_array($auth_serialized)) { @@ -163,7 +163,7 @@ if ($get_metaconsole_hash_data) { $api_password = $auth_serialized["api_password"]; $console_user = $auth_serialized["console_user"]; $console_password = $auth_serialized["console_password"]; - } + } $pwd = $auth_token; // Create HASH login info $user = $config["id_user"]; diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 1462bc44e2..c986c30920 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -708,7 +708,7 @@ function agents_common_modules_with_alerts ($id_agent, $filter = false, $indexed } else { $where .= $filter; } - } + } if (! empty ($id_agent)) { // Get module_name-template repetitions over agents selected @@ -724,7 +724,7 @@ function agents_common_modules_with_alerts ($id_agent, $filter = false, $indexed AND id_agente IN (%s) %s group by nombre, id_alert_template %s' , implode (",", (array) $id_agent) , $where - ,$group_by); + ,$group_by); $result_tmp = db_get_all_rows_sql ($sql); @@ -732,27 +732,27 @@ function agents_common_modules_with_alerts ($id_agent, $filter = false, $indexed if ($result_tmp != false) { foreach ($result_tmp as $module_template) { - - $sql_modules = sprintf ('SELECT t1.id_agente_modulo - FROM tagente_modulo t1, talert_template_modules t2 - WHERE t1.id_agente_modulo = t2.id_agent_module - AND delete_pending = 0 - AND t1.nombre = \'%s\' AND t2.id_alert_template = %s' - , $module_template['nombre'] - , $module_template['id_alert_template']); - - $id_modules_template = db_get_all_rows_sql ($sql_modules); - - if ($id_modules_template != false) - foreach ($id_modules_template as $id_module_template) - $result[] = $id_module_template; - + + $sql_modules = sprintf ('SELECT t1.id_agente_modulo + FROM tagente_modulo t1, talert_template_modules t2 + WHERE t1.id_agente_modulo = t2.id_agent_module + AND delete_pending = 0 + AND t1.nombre = \'%s\' AND t2.id_alert_template = %s' + , $module_template['nombre'] + , $module_template['id_alert_template']); + + $id_modules_template = db_get_all_rows_sql ($sql_modules); + + if ($id_modules_template != false) + foreach ($id_modules_template as $id_module_template) + $result[] = $id_module_template; + } - } + } } else { - + $sql = sprintf ('SELECT DISTINCT(t1.id_agente_modulo) FROM tagente_modulo t1, talert_template_modules t2 %s @@ -761,7 +761,7 @@ function agents_common_modules_with_alerts ($id_agent, $filter = false, $indexed $result = db_get_all_rows_sql ($sql); } - + if (empty ($result)) { return array (); } @@ -947,10 +947,10 @@ function agents_get_group_agents ($id_group = 0, $search = false, $case = "lower $search_sql .= ' AND UPPER(nombre) LIKE UPPER(\'' . $name . '\') '; break; } - + unset ($search["name"]); } - + if (! empty ($search)) { $search_sql .= ' AND '.db_format_array_where_clause_sql ($search); } @@ -978,7 +978,7 @@ function agents_get_group_agents ($id_group = 0, $search = false, $case = "lower if ($result === false) return array (); //Return an empty array - + $agents = array (); foreach ($result as $row) { switch ($case) { @@ -1550,7 +1550,7 @@ function agents_get_addresses ($id_agent) { */ function agents_get_status_from_counts($agent) { // Check if in the data there are all the necessary values - if(!isset($agent['normal_count']) && + if (!isset($agent['normal_count']) && !isset($agent['warning_count']) && !isset($agent['critical_count']) && !isset($agent['unknown_count']) && @@ -1558,7 +1558,7 @@ function agents_get_status_from_counts($agent) { !isset($agent['total_count'])) { return -1; } - + if($agent['critical_count'] > 0) { return AGENT_MODULE_STATUS_CRITICAL_BAD; } @@ -1593,7 +1593,7 @@ function agents_get_status($id_agent = 0, $noACLs = false) { if (!$noACLs) { $modules = agents_get_modules ($id_agent, 'id_agente_modulo', array('disabled' => 0), true, false); } - else{ + else { $filter_modules['id_agente'] = $id_agent; $filter_modules['disabled'] = 0; $filter_modules['delete_pending'] = 0; @@ -1612,7 +1612,7 @@ function agents_get_status($id_agent = 0, $noACLs = false) { $modules_status = array(); $modules_async = 0; - foreach($modules as $module) { + foreach ($modules as $module) { $modules_status[] = modules_get_agentmodule_status($module); $module_type = modules_get_agentmodule_type($module); @@ -1847,7 +1847,8 @@ function agents_get_count_incidents ($id_agent) { return false; } - return db_get_value('count(*)', 'tincidencia', 'id_agent', $id_agent); + return db_get_value('count(*)', 'tincidencia', 'id_agent', + $id_agent); } /** @@ -1864,7 +1865,9 @@ function agents_monitor_critical ($id_agent, $filter="") { $filter = " AND ".$filter; } - return db_get_sql ("SELECT critical_count FROM tagente WHERE id_agente = $id_agent" . $filter); + return db_get_sql ("SELECT critical_count + FROM tagente + WHERE id_agente = $id_agent" . $filter); } // Get warning monitors by using the status code in modules. @@ -1875,7 +1878,9 @@ function agents_monitor_warning ($id_agent, $filter="") { $filter = " AND ".$filter; } - return db_get_sql ("SELECT warning_count FROM tagente WHERE id_agente = $id_agent" . $filter); + return db_get_sql ("SELECT warning_count + FROM tagente + WHERE id_agente = $id_agent" . $filter); } // Get unknown monitors by using the status code in modules. @@ -1886,7 +1891,9 @@ function agents_monitor_unknown ($id_agent, $filter="") { $filter = " AND ".$filter; } - return db_get_sql ("SELECT unknown_count FROM tagente WHERE id_agente = $id_agent" . $filter); + return db_get_sql ("SELECT unknown_count + FROM tagente + WHERE id_agente = $id_agent" . $filter); } // Get ok monitors by using the status code in modules. @@ -1896,7 +1903,9 @@ function agents_monitor_ok ($id_agent, $filter="") { $filter = " AND ".$filter; } - return db_get_sql ("SELECT normal_count FROM tagente WHERE id_agente = $id_agent" . $filter); + return db_get_sql ("SELECT normal_count + FROM tagente + WHERE id_agente = $id_agent" . $filter); } /** @@ -1912,8 +1921,13 @@ function agents_monitor_disabled ($id_agent, $filter="") { if ($filter) { $filter = " AND ".$filter; } - - return db_get_sql ("SELECT COUNT( DISTINCT tagente_modulo.id_agente_modulo) FROM tagente, tagente_modulo WHERE tagente_modulo.id_agente = tagente.id_agente AND tagente_modulo.disabled = 1 AND tagente.id_agente = $id_agent".$filter); + + return db_get_sql(" + SELECT COUNT( DISTINCT tagente_modulo.id_agente_modulo) + FROM tagente, tagente_modulo + WHERE tagente_modulo.id_agente = tagente.id_agente + AND tagente_modulo.disabled = 1 + AND tagente.id_agente = $id_agent".$filter); } /** @@ -1929,8 +1943,10 @@ function agents_monitor_notinit ($id_agent, $filter="") { if (!empty($filter)) { $filter = " AND ".$filter; } - - return db_get_sql ("SELECT notinit_count FROM tagente WHERE id_agente = $id_agent" . $filter); + + return db_get_sql ("SELECT notinit_count + FROM tagente + WHERE id_agente = $id_agent" . $filter); } /** diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 4f35cd6880..7ef9d8627a 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1986,36 +1986,36 @@ function api_set_new_snmp_component($id, $thrash1, $other, $thrash2) { */ function api_set_new_local_component($id, $thrash1, $other, $thrash2) { - - if ($id == ""){ + + if ($id == "") { returnError('error_set_new_local_component', __('Error creating local component. Local component name cannot be left blank.')); - return; + return; } - if ($other['data'][1] == ""){ + if ($other['data'][1] == "") { returnError('error_set_new_local_component', __('Error creating local component. Local component group cannot be left blank.')); - return; - } + return; + } $values = array ( 'description' => $other['data'][0], 'id_network_component_group' => $other['data'][1] - ); - + ); + $name_check = enterprise_hook('local_components_get_local_components', array(array('name' => $id), 'name')); - + if ($name_check === ENTERPRISE_NOT_HOOK) { returnError('error_set_new_local_component', __('Error creating local component.')); return; } - if ($name_check !== false){ + if ($name_check !== false) { returnError('error_set_new_local_component', __('Error creating local component. This local component already exists.')); - return; + return; } $id = enterprise_hook('local_components_create_local_component', array($id, $other['data'][3], $other['data'][1], $values)); - + if (!$id) returnError('error_set_new_local_component', 'Error creating local component.'); else @@ -2036,24 +2036,24 @@ function api_set_new_local_component($id, $thrash1, $other, $thrash2) { */ function api_get_module_value_all_agents($id, $thrash1, $other, $thrash2) { - - if ($id == ""){ + + if ($id == "") { returnError('error_get_module_value_all_agents', __('Error getting module value from all agents. Module name cannot be left blank.')); - return; + return; } - + $id_module = db_get_value ('id_agente_modulo', 'tagente_modulo', 'nombre', $id); - - if ($id_module === false){ + + if ($id_module === false) { returnError('error_get_module_value_all_agents', __('Error getting module value from all agents. Module name doesn\'t exists.')); - return; + return; } - + $sql = sprintf("SELECT agent.id_agente, agent.nombre, module_state.datos FROM tagente agent, tagente_modulo module, tagente_estado module_state WHERE agent.id_agente = module.id_agente AND module.id_agente_modulo=module_state.id_agente_modulo AND module.nombre = '%s'", $id); - + $module_values = db_get_all_rows_sql($sql); - - if (!$module_values){ + + if (!$module_values) { returnError('error_get_module_value_all_agents', 'Error getting module values from all agents.'); } else{ @@ -2093,7 +2093,7 @@ function api_set_create_alert_template($name, $thrash1, $other, $thrash3) { $type = $other['data'][0]; - if ($other['data'][2] != ""){ + if ($other['data'][2] != "") { $values = array( 'description' => $other['data'][1], 'id_alert_action' => $other['data'][2], @@ -2119,10 +2119,11 @@ function api_set_create_alert_template($name, $thrash1, $other, $thrash3) { 'recovery_notify' => $other['data'][22], 'field2_recovery' => $other['data'][23], 'field3_recovery' => $other['data'][24], - 'priority' => $other['data'][25], - 'id_group' => $other['data'][26] + 'priority' => $other['data'][25], + 'id_group' => $other['data'][26] ); - } else { + } + else { $values = array( 'description' => $other['data'][1], 'field1' => $other['data'][3], @@ -2147,9 +2148,9 @@ function api_set_create_alert_template($name, $thrash1, $other, $thrash3) { 'recovery_notify' => $other['data'][22], 'field2_recovery' => $other['data'][23], 'field3_recovery' => $other['data'][24], - 'priority' => $other['data'][25], - 'id_group' => $other['data'][26] - ); + 'priority' => $other['data'][25], + 'id_group' => $other['data'][26] + ); } $id_template = alerts_create_alert_template($template_name, $type, $values); @@ -2181,41 +2182,49 @@ function api_set_create_alert_template($name, $thrash1, $other, $thrash3) { * @param $thrash3 Don't use */ function api_set_update_alert_template($id_template, $thrash1, $other, $thrash3) { - + if ($id_template == "") { - returnError('error_update_alert_template', __('Error updating alert template. Id_template cannot be left blank.')); + returnError('error_update_alert_template', + __('Error updating alert template. Id_template cannot be left blank.')); return; } - + $result_template = alerts_get_alert_template_name($id_template); - if (!$result_template){ - returnError('error_update_alert_template', __('Error updating alert template. Id_template doesn\'t exists.')); + if (!$result_template) { + returnError('error_update_alert_template', + __('Error updating alert template. Id_template doesn\'t exists.')); return; } - $fields_template = array('name', 'type', 'description', 'id_alert_action', 'field1', 'field2', 'field3', 'value', 'matches_value', - 'max_value', 'min_value', 'time_threshold', 'max_alerts', 'min_alerts', 'time_from', 'time_to', - 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday', 'recovery_notify', - 'field2_recovery', 'field3_recovery', 'priority', 'id_group'); - + $fields_template = array('name', 'type', 'description', + 'id_alert_action', 'field1', 'field2', 'field3', 'value', + 'matches_value', 'max_value', 'min_value', 'time_threshold', + 'max_alerts', 'min_alerts', 'time_from', 'time_to', 'monday', + 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', + 'sunday', 'recovery_notify', 'field2_recovery', + 'field3_recovery', 'priority', 'id_group'); + $cont = 0; - foreach ($fields_template as $field){ - if ($other['data'][$cont] != ""){ + foreach ($fields_template as $field) { + if ($other['data'][$cont] != "") { $values[$field] = $other['data'][$cont]; } $cont++; } - + $id_template = alerts_update_alert_template($id_template, $values); if (is_error($id_template)) { // TODO: Improve the error returning more info - returnError('error_create_alert_template', __('Error updating alert template.')); + returnError('error_create_alert_template', + __('Error updating alert template.')); } else { - returnData('string', array('type' => 'string', 'data' => __('Correct updating of alert template'))); + returnData('string', + array('type' => 'string', + 'data' => __('Correct updating of alert template'))); } } @@ -2233,20 +2242,23 @@ function api_set_update_alert_template($id_template, $thrash1, $other, $thrash3) * @param $thrash3 Don't use */ function api_set_delete_alert_template($id_template, $thrash1, $other, $thrash3) { - + if ($id_template == "") { - returnError('error_delete_alert_template', __('Error deleting alert template. Id_template cannot be left blank.')); + returnError('error_delete_alert_template', + __('Error deleting alert template. Id_template cannot be left blank.')); return; } - + $result = alerts_delete_alert_template($id_template); if ($result == 0) { // TODO: Improve the error returning more info - returnError('error_create_alert_template', __('Error deleting alert template.')); + returnError('error_create_alert_template', + __('Error deleting alert template.')); } else { - returnData('string', array('type' => 'string', 'data' => __('Correct deleting of alert template.'))); + returnData('string', array('type' => 'string', + 'data' => __('Correct deleting of alert template.'))); } } @@ -2263,23 +2275,24 @@ function api_set_delete_alert_template($id_template, $thrash1, $other, $thrash3) * @param $thrash3 Don't use. */ function api_get_all_alert_templates($thrash1, $thrash2, $other, $thrash3) { - + if (!isset($other['data'][0])) $separator = ';'; // by default else $separator = $other['data'][0]; - + $filter_templates = false; - + $template = alerts_get_alert_templates(); if ($template !== false) { $data['type'] = 'array'; $data['data'] = $template; } - + if (!$template) { - returnError('error_get_all_alert_templates', __('Error getting all alert templates.')); + returnError('error_get_all_alert_templates', + __('Error getting all alert templates.')); } else { returnData('csv', $data, $separator); @@ -2302,19 +2315,21 @@ function api_get_all_alert_templates($thrash1, $thrash2, $other, $thrash3) { function api_get_alert_template($id_template, $thrash1, $other, $thrash3) { $filter_templates = false; - + if ($id_template != "") { $result_template = alerts_get_alert_template_name($id_template); - + if (!$result_template){ - returnError('error_get_alert_template', __('Error getting alert template. Id_template doesn\'t exists.')); + returnError('error_get_alert_template', + __('Error getting alert template. Id_template doesn\'t exists.')); return; } $filter_templates = array('id' => $id_template); - } - - $template = alerts_get_alert_templates($filter_templates, array('id', 'name', 'description', 'id_alert_action', 'type', 'id_group')); + } + + $template = alerts_get_alert_templates($filter_templates, + array('id', 'name', 'description', 'id_alert_action', 'type', 'id_group')); if ($template !== false) { $data['type'] = 'array'; @@ -2322,7 +2337,8 @@ function api_get_alert_template($id_template, $thrash1, $other, $thrash3) { } if (!$template) { - returnError('error_get_alert_template', __('Error getting alert template.')); + returnError('error_get_alert_template', + __('Error getting alert template.')); } else { returnData('csv', $data, ';'); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index e102b234a7..13b669f504 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -152,10 +152,10 @@ function config_update_config () { $inventory_changes_blacklist = get_parameter('inventory_changes_blacklist', array()); config_update_value ('inventory_changes_blacklist', implode(',',$inventory_changes_blacklist)); - - } - break; - case 'pass': + + } + break; + case 'pass': if (isset($config['enterprise_installed']) && $config['enterprise_installed'] == 1) { config_update_value ('enable_pass_policy', get_parameter('enable_pass_policy')); config_update_value ('pass_size', get_parameter('pass_size')); @@ -268,12 +268,12 @@ function config_update_config () { // Add new interval value if is provided $interval_value = (float) get_parameter ('interval_value', 0); - - if($interval_value > 0) { + + if ($interval_value > 0) { $interval_unit = (int) get_parameter ('interval_unit'); $new_interval = $interval_value * $interval_unit; - - if($interval_values === '') { + + if ($interval_values === '') { $interval_values = $new_interval; } else { @@ -284,21 +284,21 @@ function config_update_config () { } } } - + // Delete interval value if is required $interval_to_delete = (float) get_parameter('interval_to_delete'); - if($interval_to_delete > 0) { + if ($interval_to_delete > 0) { $interval_values_array = explode(',',$interval_values); - foreach($interval_values_array as $k => $iva) { - if($interval_to_delete == $iva) { + foreach ($interval_values_array as $k => $iva) { + if ($interval_to_delete == $iva) { unset($interval_values_array[$k]); } } $interval_values = implode(',',$interval_values_array); } - + config_update_value ('interval_values', $interval_values); - + break; case 'net': config_update_value ('netflow_path', get_parameter ('netflow_path')); @@ -309,15 +309,15 @@ function config_update_config () { config_update_value ('netflow_max_resolution', (int)get_parameter ('netflow_max_resolution')); config_update_value ('netflow_disable_custom_lvfilters', get_parameter ('netflow_disable_custom_lvfilters')); config_update_value ('netflow_max_lifetime', (int) get_parameter ('netflow_max_lifetime')); - break; + break; case 'log': config_update_value ('log_dir', get_parameter('log_dir')); config_update_value ('log_max_lifetime', (int)get_parameter('log_max_lifetime')); - break; + break; - } - - + } + + } enterprise_include_once('include/functions_policies.php'); @@ -334,7 +334,7 @@ function config_process_config () { global $config; $configs = db_get_all_rows_in_table ('tconfig'); - + if (empty ($configs)) { include ($config["homedir"]."/general/error_emptyconfig.php"); exit; @@ -497,11 +497,11 @@ function config_process_config () { if (!isset ($config["log_collector"])) { config_update_value ('log_collector', 0); } - + if (!isset ($config["log_dir"])) { config_update_value ('log_dir', '/var/spool/pandora/data_in/log'); } - + if (!isset ($config["log_max_lifetime"])) { config_update_value ('log_max_lifetime', 15); } @@ -612,11 +612,11 @@ function config_process_config () { if (!isset ($config['netflow_daemon'])) { config_update_value ( 'netflow_daemon', '/usr/bin/nfcapd'); } - + if (!isset ($config['netflow_nfdump'])) { config_update_value ( 'netflow_nfdump', '/usr/bin/nfdump'); } - + if (!isset ($config['netflow_nfexpire'])) { config_update_value ( 'netflow_nfexpire', '/usr/bin/nfexpire'); } @@ -884,7 +884,7 @@ function config_process_config () { if (!isset($config['referer_security'])) { config_update_value ('referer_security', 0); } - + if (!isset($config['event_storm_protection'])) { config_update_value ('event_storm_protection', 0); } diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 48e95cb21a..9d5b5da9f6 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1892,9 +1892,12 @@ function graph_events_validated($width = 300, $height = 200, $url = "", $meta = $data_graph = reporting_get_count_events_validated( array('id_group' => array_keys(users_get_groups()))); + $water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png", + 'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false, false)); + echo pie3d_graph( true, $data_graph, $width, $height, __("other"), "", - $config['homedir'] . "/images/logo_vertical_water.png", + $water_mark, $config['fontpath'], $config['font_size']); } @@ -1922,7 +1925,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = $url = str_ireplace ($badstrings, "", $url); // Choose the table where search if metaconsole or not - if($meta) { + if ($meta) { if($history) { $event_table = 'tmetaconsole_event_history'; } @@ -1937,7 +1940,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = $field_extra = ''; $groupby_extra = ''; } - + //This will give the distinct id_agente, give the id_grupo that goes //with it and then the number of times it occured. GROUP BY statement //is required if both DISTINCT() and COUNT() are in the statement @@ -2008,7 +2011,7 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = $water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png", 'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false, false)); - + return pie3d_graph($config['flash_charts'], $data, $width, $height, __('Other'), '', $water_mark, $config['fontpath'], $config['font_size']); @@ -2065,7 +2068,8 @@ function grafico_eventos_total($filter = "") { asort ($data); - $water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png", + $water_mark = array( + 'file' => $config['homedir'] . "/images/logo_vertical_water.png", 'url' => ui_get_full_url("/images/logo_vertical_water.png")); return pie3d_graph($config['flash_charts'], $data, 320, 200, @@ -2094,10 +2098,12 @@ function grafico_eventos_usuario ($width, $height) { ORDER BY 1 DESC LIMIT %d', $max_items); break; case "oracle": - $sql = sprintf ('SELECT * FROM (SELECT COUNT(id_evento) events, id_usuario - FROM tevento - GROUP BY id_usuario - ORDER BY 1 DESC) WHERE rownum <= %d', $max_items); + $sql = sprintf ('SELECT * + FROM (SELECT COUNT(id_evento) events, id_usuario + FROM tevento + GROUP BY id_usuario + ORDER BY 1 DESC) + WHERE rownum <= %d', $max_items); break; } $events = db_get_all_rows_sql ($sql); @@ -2107,7 +2113,10 @@ function grafico_eventos_usuario ($width, $height) { } foreach($events as $event) { - if($event['id_usuario'] == '0') { + if ($event['id_usuario'] == '0') { + $data[__('System')] = $event['events']; + } + elseif ($event['id_usuario'] == '') { $data[__('System')] = $event['events']; } else { @@ -2115,7 +2124,8 @@ function grafico_eventos_usuario ($width, $height) { } } - $water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png", + $water_mark = array( + 'file' => $config['homedir'] . "/images/logo_vertical_water.png", 'url' => ui_get_full_url("/images/logo_vertical_water.png")); return pie3d_graph($config['flash_charts'], $data, $width, $height, diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index a6dd8baf7e..7f4f9d3474 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -44,14 +44,15 @@ function snmp_browser_print_tree ($tree, $id = 0, $depth = 0, $last = 0, $last_a if ($depth > 0) { echo "