Merge branch 'ent-7617-macro-address-no-funciona-en-modulos-de-red' into 'develop'

Fixed macro address on network server modules

See merge request artica/pandorafms!4170
This commit is contained in:
Daniel Rodriguez 2021-06-08 10:53:15 +00:00
commit 4fa8e5cf29
2 changed files with 6 additions and 1 deletions

View File

@ -480,7 +480,7 @@ sub exec_network_module ($$$$) {
}
# Use the agent address by default
if (! defined($ip_target) || $ip_target eq '' || $ip_target eq 'auto') {
if (! defined($ip_target) || $ip_target eq '' || $ip_target eq 'auto'|| $ip_target eq '_address_') {
$ip_target = $agent_row->{'direccion'};
}

View File

@ -162,6 +162,11 @@ sub data_consumer ($$) {
$wmi_command = $pa_config->{'wmi_client'} . ' -N';
}
#Check ip_taget macro
if ($module->{'ip_target'} eq '_address_') {
$module->{'ip_target'} = get_db_value($dbh, "SELECT direccion FROM tagente WHERE id_agente=?", $module->{'id_agente'});
}
# Use a custom namespace
my $namespace = $module->{'tcp_send'};
if (defined($namespace) && $namespace ne '') {