diff --git a/pandora_console/extensions/agents_alerts.php b/pandora_console/extensions/agents_alerts.php index 32c92053b0..72e5db9e40 100755 --- a/pandora_console/extensions/agents_alerts.php +++ b/pandora_console/extensions/agents_alerts.php @@ -339,7 +339,7 @@ function print_alerts_summary_modal_window($id, $alerts) { $content = html_print_table($table,true); - $agent = modules_get_agentmodule_agent_name($alerts[0]['id_agent_module']); + $agent = modules_get_agentmodule_agent_alias($alerts[0]['id_agent_module']); $template = alerts_get_alert_template_name($alerts[0]['id_alert_template']); echo ''; diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 828800fca7..4b6864108f 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -1531,7 +1531,7 @@ function print_SLA_list($width, $action, $idItem = null) { $idAgent = db_get_value_filter('id_agente', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module'])); - $nameAgent = agents_get_name ($idAgent); + $nameAgent = agents_get_alias($idAgent); $nameModule = db_get_value_filter('nombre', 'tagente_modulo', @@ -1744,7 +1744,7 @@ function print_General_list($width, $action, $idItem = null, $type = 'general') 'id_agente', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module'])); - $nameAgent = agents_get_name ($idAgent); + $nameAgent = agents_get_alias($idAgent); $nameModule = db_get_value_filter('nombre', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module'])); $server_name_element = ''; diff --git a/pandora_console/godmode/reporting/reporting_builder.list_items.php b/pandora_console/godmode/reporting/reporting_builder.list_items.php index c66ff26f0d..de837beb7d 100755 --- a/pandora_console/godmode/reporting/reporting_builder.list_items.php +++ b/pandora_console/godmode/reporting/reporting_builder.list_items.php @@ -382,8 +382,10 @@ foreach ($items as $item) { $module_name_db = implode('
',$modules); } else { - $alias = db_get_value ("alias","tagente","id_agente",agents_get_agent_id_by_module_id($item['id_agent_module'])); - $agent_name_db = '' .$alias . ''; + $agent_id = agents_get_agent_id_by_module_id($item['id_agent_module']); + $agent_name = agents_get_name($agent_id); + $agent_alias = agents_get_alias($agent_id); + $agent_name_db = '' .$alias . ''; $module_name_db = db_get_value_filter('nombre', 'tagente_modulo', array('id_agente_modulo' => $item['id_agent_module'])); $module_name_db = ui_print_truncate_text(io_safe_output($module_name_db), 'module_small'); } @@ -393,7 +395,7 @@ foreach ($items as $item) { } } else { - $alias = db_get_value ("alias","tagente","id_agente",$item['id_agent']); + $alias = agents_get_alias($item['id_agent']); $row[2] = '' .$alias . ''; if ($item['id_agent_module'] == '') { diff --git a/pandora_console/include/ajax/alert_list.ajax.php b/pandora_console/include/ajax/alert_list.ajax.php index f4611bc530..de34dbdeea 100644 --- a/pandora_console/include/ajax/alert_list.ajax.php +++ b/pandora_console/include/ajax/alert_list.ajax.php @@ -112,9 +112,8 @@ if ($show_update_action_menu) { $id_agent = (int) get_parameter ('id_agent'); $id_alert = (int) get_parameter ('id_alert'); - $module_name = modules_get_agentmodule_name ($id_agent_module); - $id_agent = modules_get_agentmodule_agent ($id_agent_module); - $agent_name = agents_get_name ($id_agent); + $module_name = modules_get_agentmodule_name($id_agent_module); + $agent_alias = modules_get_agentmodule_agent_alias($id_agent); $id_action = (int) get_parameter ('id_action'); @@ -131,7 +130,7 @@ if ($show_update_action_menu) { $data .= __('Agent'); $data .= ''; $data .= ''; - $data .= ui_print_truncate_text($agent_name, 'agent_small', false, true, true, '[…]'); + $data .= ui_print_truncate_text($agent_alias, 'agent_small', false, true, true, '[…]'); $data .= ''; $data .= ''; } diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index 3f5b7adc93..2dae0fa720 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -3133,9 +3133,8 @@ function grafico_eventos_grupo ($width = 300, $height = 200, $url = "", $meta = $name = mb_substr (io_safe_output($row['agent_name']), 0, 14)." (".$row["count"].")"; } else { - $alias = db_get_value ("alias","tagente","id_agente",$row["id_agente"]); - //$name = mb_substr (agents_get_name ($row["id_agente"], "lower"), 0, 14)." (".$row["count"].")"; - $name = mb_substr ($alias, 0, 14)." (".$row["count"].")"; + $alias = agents_get_alias($row["id_agente"]); + $name = mb_substr($alias, 0, 14)." #".$row["id_agente"]." (".$row["count"].")"; } $data[$name] = $row["count"]; } diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index c343620bda..0db5593715 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -870,7 +870,7 @@ function reporting_html_event_report_group($table, $item, $pdf = 0) { $data[] = events_print_type_img ($event["event_type"], true); if (!empty($event['id_agente'])) - $data[] = agents_get_name($event['id_agente']); + $data[] = agents_get_alias($event['id_agente']); else $data[] = __('Pandora System'); $data[] = get_priority_name ($event['criticity']); @@ -2876,7 +2876,7 @@ function reporting_get_fired_alerts_table ($alerts_fired) { $alert_module = $tuple[0]; $template = $tuple[1]; if (! isset ($data[0])) - $data[0] = agents_get_name ($id_agent); + $data[0] = agents_get_alias($id_agent); else $data[0] = ''; $data[1] = $template['name']; @@ -3038,7 +3038,7 @@ function reporting_get_monitors_down_table ($monitors_down) { $data = array (); foreach ($monitors as $monitor) { if (! isset ($data[0])) - $data[0] = agents_get_name ($id_agent); + $data[0] = agents_get_alias($id_agent); else $data[0] = ''; if ($monitor['descripcion'] != '') { @@ -3230,7 +3230,7 @@ function reporting_get_agent_detailed ($id_agent, $period = 0, $date = 0, $retur /* Show modules in agent */ $output .= '
'; $output .= '

' . - __('Agent') . ' - ' . agents_get_name ($id_agent) . '

'; + __('Agent') . ' - ' . agents_get_alias($id_agent) . ''; $output .= '

'.__('Modules').'

'; $table_modules = reporting_get_agent_modules_table ($id_agent, $period, $date); $table_modules->width = '99%'; diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 08406405f9..0417c54cea 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3727,7 +3727,7 @@ function ui_print_module_string_value($value, $id_agente_module, } else { $title_dialog = - modules_get_agentmodule_agent_name($id_agente_module) . + modules_get_agentmodule_agent_alias($id_agente_module) . " / " . $module_name; $salida = "
"; diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index 05039bf72c..e1bc7bd28b 100755 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -280,7 +280,7 @@ if ($agent["id_parent"] == 0) { $data[1] = '' . __('N/A') . ''; } else { - $data[1] = ''.agents_get_name ($agent["id_parent"]).''; + $data[1] = ''.agents_get_alias($agent["id_parent"]).''; } $table_data->data[] = $data; diff --git a/pandora_console/operation/agentes/interface_traffic_graph_win.php b/pandora_console/operation/agentes/interface_traffic_graph_win.php index b3fc71a68a..2472be7cea 100644 --- a/pandora_console/operation/agentes/interface_traffic_graph_win.php +++ b/pandora_console/operation/agentes/interface_traffic_graph_win.php @@ -80,7 +80,7 @@ $interface_traffic_modules = array( } ?> - Pandora FMS Graph (<?php echo agents_get_name($agent_id) . ' - ' . $interface_name; ?>) + Pandora FMS Graph (<?php echo agents_get_alias($agent_id) . ' - ' . $interface_name; ?>) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 16c7335aa6..3f010a25c6 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -81,7 +81,7 @@ if (!empty($ag_custom_fields)) { if ($id_module) { $status = -1; $ag_modulename = modules_get_agentmodule_name($id_module); - $ag_freestring = modules_get_agentmodule_agent_name($id_module); + $ag_freestring = modules_get_agentmodule_agent_alias($id_module); } enterprise_hook('open_meta_frame'); diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index c426aa4f93..4758da5e9d 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -818,7 +818,7 @@ HAVING count(nombre) = (SELECT count(nombre) FROM tagente_modulo))'; echo $modulegroup.'
'; } echo ''.__('Agent').': '; - echo ui_print_truncate_text(modules_get_agentmodule_agent_name($module['id_agente_modulo']), 'agent_small', false, true, false).'
'; + echo ui_print_truncate_text(modules_get_agentmodule_agent_alias($module['id_agente_modulo']), 'agent_small', false, true, false).'
'; if ($module['id_tipo_modulo'] == 18) { echo ''.__('Address').': '; diff --git a/pandora_console/operation/events/events.build_table.php b/pandora_console/operation/events/events.build_table.php index 7106aa2d0b..449854ab52 100644 --- a/pandora_console/operation/events/events.build_table.php +++ b/pandora_console/operation/events/events.build_table.php @@ -87,7 +87,7 @@ if ($group_rep == 2) { $res['total'] . __(' events.'); else $table->data[$key][1] = __('The Agent: ') . '"' . - agents_get_name ($res['id_agent']) . '", ' . __(' has ') . + agents_get_alias($res['id_agent']) . '", ' . __(' has ') . $res['total'] . __(' events.'); $uniq = uniqid(); diff --git a/pandora_console/operation/events/events_rss.php b/pandora_console/operation/events/events_rss.php index 426d13fb34..bb81462dbe 100644 --- a/pandora_console/operation/events/events_rss.php +++ b/pandora_console/operation/events/events_rss.php @@ -179,7 +179,7 @@ foreach ($result as $row) { } elseif ($row["id_agente"] > 0) { // Agent name - $agent_name = agents_get_name ($row["id_agente"]); + $agent_name = agents_get_alias($row["id_agente"]); } else { $agent_name = __('Alert').__('SNMP'); diff --git a/pandora_console/operation/gis_maps/ajax.php b/pandora_console/operation/gis_maps/ajax.php index 74f669cd96..bfaf8b3dcd 100644 --- a/pandora_console/operation/gis_maps/ajax.php +++ b/pandora_console/operation/gis_maps/ajax.php @@ -213,7 +213,7 @@ switch ($opt) { $returnJSON = array(); $returnJSON['correct'] = 1; - $returnJSON['content'] = __('Agent') . ': '.agents_get_name($row['tagente_id_agente']).'
'; + $returnJSON['content'] = __('Agent') . ': '.agents_get_alias($row['tagente_id_agente']).'
'; $returnJSON['content'] .= __('Position (Lat, Long, Alt)') . ': (' . $row['latitude'] . ', ' . $row['longitude'] . ', ' . $row['altitude'] . ')
'; $returnJSON['content'] .= __('Start contact') . ': ' . $row['start_timestamp'] . '
'; $returnJSON['content'] .= __('Last contact') . ': ' . $row['end_timestamp'] . '
'; diff --git a/pandora_console/operation/search_alerts.php b/pandora_console/operation/search_alerts.php index afa7ed628b..bebb9a44ff 100755 --- a/pandora_console/operation/search_alerts.php +++ b/pandora_console/operation/search_alerts.php @@ -80,8 +80,7 @@ else { array_push($table->data, array( $disabledCell, - //print_agent_name ($alert["id_agente"], true, "upper"), - agents_get_name($alert["id_agente"]), + ui_print_agent_name($alert["id_agente"], true), $alert["module_name"], $alert["template_name"],$actionCell ));