From d0c34e2ce7dd2ec9260fc4c6ea64b15478b2162b Mon Sep 17 00:00:00 2001 From: fermin831 Date: Wed, 4 Apr 2018 16:05:18 +0200 Subject: [PATCH] [Secondary groups] Added secondary groups to linux agent and server --- pandora_agents/unix/pandora_agent | 6 +++++- pandora_server/lib/PandoraFMS/DataServer.pm | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index b3f4098a21..fa3c12173d 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -3065,7 +3065,11 @@ while (1) { if (defined ($Conf{'parent_agent_name'})) { $xml_header .= "' parent_agent_name='" .$Conf{'parent_agent_name'}; } - + + if (defined ($Conf{'secondary_groups'})) { + $xml_header .= "' secondary_groups='" .$Conf{'secondary_groups'}; + } + if (defined ($Conf{'agent_mode'})) { if ($Conf{'agent_mode'} =~ m/no.?learn/ig) { $xml_header .= "' agent_mode='0"; diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index 56bfc90d9e..189b8952d8 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -369,6 +369,9 @@ sub process_xml_data ($$$$$) { if (! defined ($agent_id)) { return; } + + # Update the secondary groups + enterprise_hook('add_secondary_groups_name', [$pa_config, $dbh, $agent_id, $data->{'secondary_groups'}]); # This agent is new. $new_agent = 1;