From 5807e554593d8207137d182489d55d886c62a976 Mon Sep 17 00:00:00 2001 From: Hirofumi Kosaka Date: Fri, 19 May 2017 16:49:54 +0900 Subject: [PATCH] Modified SNMP Console to prefer agent aliases as SNMP agent if registered. #149 --- pandora_console/operation/snmpconsole/snmp_view.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/operation/snmpconsole/snmp_view.php b/pandora_console/operation/snmpconsole/snmp_view.php index 26fb5d102c..202933d082 100755 --- a/pandora_console/operation/snmpconsole/snmp_view.php +++ b/pandora_console/operation/snmpconsole/snmp_view.php @@ -162,7 +162,7 @@ $severities = get_priorities (); $alerted = array (__('Not fired'), __('Fired')); foreach ($all_traps as $trap) { $agent = agents_get_agent_with_ip ($trap['source']); - $agents[$trap["source"]] = $agent !== false ? $agent["nombre"] : $trap["source"]; + $agents[$trap["source"]] = $agent !== false ? ($agent["alias"] ? $agent["alias"] : $agent["nombre"]) : $trap["source"]; $oid = enterprise_hook ('get_oid', array ($trap)); if ($oid === ENTERPRISE_NOT_HOOK) { $oid = $trap["oid"]; @@ -678,7 +678,7 @@ if ($traps !== false) { continue; } $data[1] = ''; - $data[1] .= ''.$agent["nombre"].ui_print_help_tip($trap['source'], true, "images/tip-blanco.png");''; + $data[1] .= ''.($agent["alias"] ? $agent["alias"] : $agent["nombre"]).ui_print_help_tip($trap['source'], true, "images/tip-blanco.png");''; } //OID @@ -1014,4 +1014,4 @@ echo '
 
'; } } - \ No newline at end of file +