#8224 centralised node check added

This commit is contained in:
Daniel Maya 2021-11-23 12:23:27 +01:00
parent fee6b06a2a
commit c5588197f2
1 changed files with 26 additions and 1 deletions

View File

@ -353,6 +353,11 @@ sub pandora_disable_group ($$$) {
my @agents_bd = [];
my $result = 0;
if(is_metaconsole($conf) != 1 && pandora_get_tconfig_token ($dbh, 'centralized_management', '')) {
print_log "[ERROR] This node is configured with centralized mode. To disable a group go to metaconsole. \n\n";
exit;
}
if ($group == 0){
# Extract all the names of the pandora agents if it is for all = 0.
@agents_bd = get_db_rows ($dbh, 'SELECT nombre FROM tagente');
@ -390,6 +395,11 @@ sub pandora_enable_group ($$$) {
my @agents_bd = [];
my $result = 0;
if(is_metaconsole($conf) != 1 && pandora_get_tconfig_token ($dbh, 'centralized_management', '')) {
print_log "[ERROR] This node is configured with centralized mode. To enable a group go to metaconsole. \n\n";
exit;
}
if ($group == 0){
# Extract all the names of the pandora agents if it is for all = 0.
@agents_bd = get_db_rows ($dbh, 'SELECT nombre FROM tagente');
@ -5850,7 +5860,12 @@ sub cli_get_planned_downtimes_items() {
sub cli_create_group() {
my ($group_name,$parent_group_name,$icon,$description) = @ARGV[2..5];
if(is_metaconsole($conf) != 1 && pandora_get_tconfig_token ($dbh, 'centralized_management', '')) {
print_log "[ERROR] This node is configured with centralized mode. To create a group go to metaconsole. \n\n";
exit;
}
my $group_id = get_group_id($dbh,$group_name);
non_exist_check($group_id, 'group name', $group_name);
@ -5922,6 +5937,11 @@ sub cli_create_group() {
sub cli_delete_group() {
my ($group_name) = @ARGV[2];
if(is_metaconsole($conf) != 1 && pandora_get_tconfig_token ($dbh, 'centralized_management', '')) {
print_log "[ERROR] This node is configured with centralized mode. To delete a group go to metaconsole. \n\n";
exit;
}
my $group_id = get_group_id($dbh,$group_name);
exist_check($group_id, 'group name', $group_name);
@ -5946,6 +5966,11 @@ sub cli_update_group() {
my ($group_id,$group_name,$parent_group_name,$icon,$description) = @ARGV[2..6];
my $result;
if(is_metaconsole($conf) != 1 && pandora_get_tconfig_token ($dbh, 'centralized_management', '')) {
print_log "[ERROR] This node is configured with centralized mode. To update a group go to metaconsole. \n\n";
exit;
}
$result = get_db_value ($dbh, 'SELECT * FROM tgrupo WHERE id_grupo=?', $group_id);
if($result == "0E0"){