From 8b771f6a35b5c808968456e9ba0ae7198d2f87ed Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 7 Oct 2019 17:35:20 +0200 Subject: [PATCH] Minor fix --- pandora_server/lib/PandoraFMS/DiscoveryServer.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm index a98cd2cd69..6762e79b4f 100644 --- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm +++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm @@ -584,6 +584,8 @@ sub PandoraFMS::Recon::Base::create_agent($$) { # Resolve hostnames. my $host_name = (($self->{'resolve_names'} == 1) ? gethostbyaddr(inet_aton($device), AF_INET) : $device); + # Fallback to device IP if host name could not be resolved. + $host_name = $device if (!defined($host_name) || $host_name == ''); my $agent = locate_agent($self->{'pa_config'}, $self->{'dbh'}, $host_name); my ($agent_id, $agent_learning);