From 56f2acbbf16fb6fa9815e5b579a7b27ae850f34c Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 4 Apr 2019 16:05:16 +0200 Subject: [PATCH] discovery.app.mysql rc1 Former-commit-id: 51304e872d375b480cbbf88d058b1804106afb98 --- pandora_server/lib/PandoraFMS/DiscoveryServer.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm index eef7fa85f0..6179fbc4c3 100644 --- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm +++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm @@ -453,13 +453,18 @@ sub PandoraFMS::Recon::Base::create_agents($$) { } my $agent_id; + my $os_id = get_os_id($dbh, $agent->{'os'}); + + if (!$os_id) { + $os_id = get_os_id($dbh, 'Other'); + } if (!$current_agent) { # Create agent. $agent_id = pandora_create_agent( $pa_config, $pa_config->{'servername'}, $agent->{'agent_name'}, $agent->{'address'}, $agent->{'id_group'}, $parent_id, - get_os_id($dbh, $agent->{'os'}), $agent->{'description'}, + $os_id, $agent->{'description'}, $agent->{'interval'}, $dbh, $agent->{'timezone_offset'} );