diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 9c311c9c5d..d2d54b9756 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -976,7 +976,9 @@ sub pandora_execute_action ($$$$$$$$$;$) { _field13_ => $field13, _field14_ => $field14, _field15_ => $field15, - _agent_ => (defined ($agent)) ? $agent->{'alias'} : '', + _agentname_ => (defined ($agent)) ? $agent->{'nombre'} : '', + _agentalias_ => (defined ($agent)) ? $agent->{'alias'} : '', + _agent_ => (defined ($agent)) ? ($agent->{'alias'} ? $agent->{'alias'} : $agent->{'nombre'}) : '', _agentcustomid_ => (defined ($agent)) ? $agent->{'custom_id'} : '', '_agentcustomfield_\d+_' => undef, _agentdescription_ => (defined ($agent)) ? $agent->{'comentarios'} : '', @@ -1216,6 +1218,9 @@ sub pandora_execute_action ($$$$$$$$$;$) { } $agent_name = subst_alert_macros ($agent_name, \%macros, $pa_config, $dbh, $agent, $module); my $fullagent = get_agent_from_name ($dbh, $agent_name); + if( ! $fullagent && $macros{'_agentname_'} ) { + $fullagent = get_agent_from_name ($dbh, $macros{'_agentname_'} ); + } # Field 5 (priority) my $priority = $field5; @@ -3426,6 +3431,7 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) { if (defined($this_agent)){ %agent = ( 'nombre' => $this_agent->{'nombre'}, + 'alias' => $this_agent->{'alias'}, 'id_agente' => $this_agent->{'id_agente'}, 'direccion' => $trap_agent, 'id_grupo' => $this_agent->{'id_grupo'},