Fixed macro address on network server modules

This commit is contained in:
Luis 2021-06-08 10:53:15 +00:00 committed by Daniel Rodriguez
parent bc6b4acd8b
commit 72cb359133
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

@ -161,6 +161,11 @@ sub data_consumer ($$) {
else {
$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'};