diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 54f932b71c..866a0acf91 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2012-01-11 Sergio Martin + + * util/pandora_manage.pl: Added icon to the create + group option + 2012-01-11 Sergio Martin * util/pandora_manage.pl: Fixed a little bug in diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index dca9a203a7..f16b0fa92c 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -479,7 +479,7 @@ sub help_screen{ help_screen_line('--delete_not_policy_modules', '', 'Delete all modules without policy from configuration file'); help_screen_line('--apply_policy', '', 'Force apply a policy'); help_screen_line('--disable_policy_alerts', '', 'Disable all the alerts of a policy'); - help_screen_line('--create_group', ' []', 'Create an agent group'); + help_screen_line('--create_group', ' [ ]', 'Create an agent group'); help_screen_line('--add_agent_to_policy', ' ', 'Add an agent to a policy'); help_screen_line('--disable_user', '', 'Disable a given user'); help_screen_line('--enable_user', '', 'Enable a given user'); @@ -1663,20 +1663,21 @@ sub cli_policy_add_agent() { ############################################################################## sub cli_create_group() { - my ($group_name,$parent_group_name) = @ARGV[2..3]; - + my ($group_name,$parent_group_name,$icon) = @ARGV[2..4]; + my $group_id = get_group_id($dbh,$group_name); - non_exist_check($group_id, 'group name', $group_name); my $parent_group_id = 0; - if(defined($parent_group_name)) { + if(defined($parent_group_name) && $parent_group_name ne 'All') { $parent_group_id = get_group_id($dbh,$parent_group_name); exist_check($parent_group_id, 'group name', $parent_group_name); } - $group_id = pandora_create_group ($group_name, '', $parent_group_id, 0, 0, '', 0, $dbh); + $icon = '' unless defined($icon); + + $group_id = pandora_create_group ($group_name, $icon, $parent_group_id, 0, 0, '', 0, $dbh); if($group_id == -1) { print "[ERROR] A problem has been ocurred creating group '$group_name'\n\n"; @@ -1978,7 +1979,7 @@ sub pandora_manage_main ($$$) { cli_disable_policy_alerts(); } elsif ($param eq '--create_group') { - param_check($ltotal, 2, 1); + param_check($ltotal, 3, 2); cli_create_group(); } elsif ($param eq '--add_agent_to_policy') {