mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
#8224 centralised node check added
This commit is contained in:
parent
fee6b06a2a
commit
c5588197f2
@ -353,6 +353,11 @@ sub pandora_disable_group ($$$) {
|
|||||||
my @agents_bd = [];
|
my @agents_bd = [];
|
||||||
my $result = 0;
|
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){
|
if ($group == 0){
|
||||||
# Extract all the names of the pandora agents if it is for all = 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');
|
@agents_bd = get_db_rows ($dbh, 'SELECT nombre FROM tagente');
|
||||||
@ -390,6 +395,11 @@ sub pandora_enable_group ($$$) {
|
|||||||
my @agents_bd = [];
|
my @agents_bd = [];
|
||||||
my $result = 0;
|
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){
|
if ($group == 0){
|
||||||
# Extract all the names of the pandora agents if it is for all = 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');
|
@agents_bd = get_db_rows ($dbh, 'SELECT nombre FROM tagente');
|
||||||
@ -5850,7 +5860,12 @@ sub cli_get_planned_downtimes_items() {
|
|||||||
|
|
||||||
sub cli_create_group() {
|
sub cli_create_group() {
|
||||||
my ($group_name,$parent_group_name,$icon,$description) = @ARGV[2..5];
|
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);
|
my $group_id = get_group_id($dbh,$group_name);
|
||||||
non_exist_check($group_id, 'group name', $group_name);
|
non_exist_check($group_id, 'group name', $group_name);
|
||||||
|
|
||||||
@ -5922,6 +5937,11 @@ sub cli_create_group() {
|
|||||||
sub cli_delete_group() {
|
sub cli_delete_group() {
|
||||||
my ($group_name) = @ARGV[2];
|
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);
|
my $group_id = get_group_id($dbh,$group_name);
|
||||||
exist_check($group_id, 'group name', $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 ($group_id,$group_name,$parent_group_name,$icon,$description) = @ARGV[2..6];
|
||||||
my $result;
|
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);
|
$result = get_db_value ($dbh, 'SELECT * FROM tgrupo WHERE id_grupo=?', $group_id);
|
||||||
|
|
||||||
if($result == "0E0"){
|
if($result == "0E0"){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user