Create an event when an agent can't be created because it can't be assigned to a group.

This commit is contained in:
Ramon Novoa 2014-09-16 16:55:07 +02:00
parent 24fea04c8f
commit 15fb7ff2e3
1 changed files with 2 additions and 0 deletions

View File

@ -301,10 +301,12 @@ sub process_xml_data ($$$$$) {
if (defined ($data->{'group'}) && $data->{'group'} ne '') {
$group_id = get_group_id ($dbh, $data->{'group'});
if (! defined (get_group_name ($dbh, $group_id))) {
pandora_event ($pa_config, "Unable to create agent '$agent_name': group '" . $data->{'group'} . "' does not exist.", 0, 0, 0, 0, 0, 'error', 0, $dbh);
logger($pa_config, "Group " . $data->{'group'} . " does not exist.", 3);
return;
}
} else {
pandora_event ($pa_config, "Unable to create agent '$agent_name': autocreate_group $group_id does not exist. Edit the pandora_server.conf file and change it.", 0, 0, 0, 0, 0, 'error', 0, $dbh);
logger($pa_config, "Group id $group_id does not exist (check autocreate_group config token).", 3);
return;
}