Changed the agent name by its alias

This commit is contained in:
Alejandro Gallardo Escobar 2017-02-22 16:43:28 +01:00
parent b184a75065
commit 3d8af42834
17 changed files with 28 additions and 29 deletions

View File

@ -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 '<div id="alerts_details_'.$id.'" title="'.__('Agent').': '.$agent.' / '.__('Template').': '.$template.'" style="display:none">'.$content.'</div>';

View File

@ -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 = '';

View File

@ -382,8 +382,10 @@ foreach ($items as $item) {
$module_name_db = implode('<br>',$modules);
}
else {
$alias = db_get_value ("alias","tagente","id_agente",agents_get_agent_id_by_module_id($item['id_agent_module']));
$agent_name_db = '<span title='. agents_get_name(agents_get_agent_id_by_module_id($item['id_agent_module'])) . '>' .$alias . '</span>';
$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 = '<span title='. $agent_name . '>' .$alias . '</span>';
$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] = '<span title='. agents_get_name($item['id_agent']) . '>' .$alias . '</span>';
if ($item['id_agent_module'] == '') {

View File

@ -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 .= '</td>';
$data .= '<td class="datos">';
$data .= ui_print_truncate_text($agent_name, 'agent_small', false, true, true, '[&hellip;]');
$data .= ui_print_truncate_text($agent_alias, 'agent_small', false, true, true, '[&hellip;]');
$data .= '</td>';
$data .= '</tr>';
}

View File

@ -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"];
}

View File

@ -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 .= '<div class="agent_reporting">';
$output .= '<h3 style="text-decoration: underline">' .
__('Agent') . ' - ' . agents_get_name ($id_agent) . '</h3>';
__('Agent') . ' - ' . agents_get_alias($id_agent) . '</h3>';
$output .= '<h4>'.__('Modules').'</h3>';
$table_modules = reporting_get_agent_modules_table ($id_agent, $period, $date);
$table_modules->width = '99%';

View File

@ -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 = "<div " .
"id='hidden_value_module_" . $id_agente_module . "'

View File

@ -2776,7 +2776,7 @@ function visual_map_get_items_parents($idVisual) {
foreach ($items as $item) {
$agent = null;
if ($item['id_agent'] != 0) {
$agent = io_safe_output(agents_get_name($item['id_agent']));
$agent = io_safe_output(agents_get_alias($item['id_agent']));
}
$return[$item['id']] = visual_map_create_internal_name_item(

View File

@ -162,7 +162,7 @@ if (($config['dbtype'] == 'oracle') && ($result !== false)) {
}
}
$header_title = __('Received data from')." ".modules_get_agentmodule_agent_name ($module_id)." / ".modules_get_agentmodule_name ($module_id);
$header_title = __('Received data from')." ".modules_get_agentmodule_agent_alias($module_id)." / ".modules_get_agentmodule_name ($module_id);
echo "<form method='post' action='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=" . $agentId . "&tab=data_view&id=" . $module_id . "'>";

View File

@ -280,7 +280,7 @@ if ($agent["id_parent"] == 0) {
$data[1] = '<em>' . __('N/A') . '</em>';
}
else {
$data[1] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$agent["id_parent"].'">'.agents_get_name ($agent["id_parent"]).'</a>';
$data[1] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$agent["id_parent"].'">'.agents_get_alias($agent["id_parent"]).'</a>';
}
$table_data->data[] = $data;

View File

@ -80,7 +80,7 @@ $interface_traffic_modules = array(
}
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Pandora FMS Graph (<?php echo agents_get_name($agent_id) . ' - ' . $interface_name; ?>)</title>
<title>Pandora FMS Graph (<?php echo agents_get_alias($agent_id) . ' - ' . $interface_name; ?>)</title>
<link rel="stylesheet" href="../../include/styles/pandora_minimal.css" type="text/css" />
<script type='text/javaScript' src='../../include/javascript/calendar.js'></script>
<script type='text/javascript' src='../../include/javascript/pandora.js'></script>

View File

@ -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');

View File

@ -818,7 +818,7 @@ HAVING count(nombre) = (SELECT count(nombre) FROM tagente_modulo))';
echo $modulegroup.'<br />';
}
echo '<strong>'.__('Agent').':</strong> ';
echo ui_print_truncate_text(modules_get_agentmodule_agent_name($module['id_agente_modulo']), 'agent_small', false, true, false).'<br />';
echo ui_print_truncate_text(modules_get_agentmodule_agent_alias($module['id_agente_modulo']), 'agent_small', false, true, false).'<br />';
if ($module['id_tipo_modulo'] == 18) {
echo '<strong>'.__('Address').':</strong> ';

View File

@ -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();

View File

@ -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');

View File

@ -213,7 +213,7 @@ switch ($opt) {
$returnJSON = array();
$returnJSON['correct'] = 1;
$returnJSON['content'] = __('Agent') . ': <a style="font-weight: bolder;" href="?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $row['tagente_id_agente'] . '">'.agents_get_name($row['tagente_id_agente']).'</a><br />';
$returnJSON['content'] = __('Agent') . ': <a style="font-weight: bolder;" href="?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $row['tagente_id_agente'] . '">'.agents_get_alias($row['tagente_id_agente']).'</a><br />';
$returnJSON['content'] .= __('Position (Lat, Long, Alt)') . ': (' . $row['latitude'] . ', ' . $row['longitude'] . ', ' . $row['altitude'] . ') <br />';
$returnJSON['content'] .= __('Start contact') . ': ' . $row['start_timestamp'] . '<br />';
$returnJSON['content'] .= __('Last contact') . ': ' . $row['end_timestamp'] . '<br />';

View File

@ -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
));