From 72cb3591332df4e5e2214f25f1b2c5a0f89c87dc Mon Sep 17 00:00:00 2001 From: Luis Date: Tue, 8 Jun 2021 10:53:15 +0000 Subject: [PATCH] Fixed macro address on network server modules --- pandora_server/lib/PandoraFMS/NetworkServer.pm | 2 +- pandora_server/lib/PandoraFMS/WMIServer.pm | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/NetworkServer.pm b/pandora_server/lib/PandoraFMS/NetworkServer.pm index d7b6519109..be8a96a9f9 100644 --- a/pandora_server/lib/PandoraFMS/NetworkServer.pm +++ b/pandora_server/lib/PandoraFMS/NetworkServer.pm @@ -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'}; } diff --git a/pandora_server/lib/PandoraFMS/WMIServer.pm b/pandora_server/lib/PandoraFMS/WMIServer.pm index 74b32f50a0..c8a8759bd8 100644 --- a/pandora_server/lib/PandoraFMS/WMIServer.pm +++ b/pandora_server/lib/PandoraFMS/WMIServer.pm @@ -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'};