From 13a6c44aa471fe006570e0021cae08f10a117d0a Mon Sep 17 00:00:00 2001 From: digimer Date: Sat, 20 Jan 2024 16:33:27 -0500 Subject: [PATCH 1/3] Updated Cluster->parse_cib() to support new in_ccm and crmd values Signed-off-by: digimer --- Anvil/Tools/Cluster.pm | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/Anvil/Tools/Cluster.pm b/Anvil/Tools/Cluster.pm index 6021918e..13aabc84 100644 --- a/Anvil/Tools/Cluster.pm +++ b/Anvil/Tools/Cluster.pm @@ -3585,26 +3585,46 @@ sub parse_cib # The "coming up" order is 'in_ccm' then 'crmd' then 'join'. my $node_id = $anvil->data->{cib}{parsed}{data}{node}{$node_name}{id}; my $maintenance_mode = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'maintenance-mode'} eq "on" ? 1 : 0; # 'on' or 'off' - Node is not monitoring resources - my $in_ccm = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{in_ccm} eq "true" ? 1 : 0; # 'true' or 'false' - Corosync member - my $crmd = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{crmd} eq "online" ? 1 : 0; # 'online' or 'offline' - In corosync process group - my $join = $anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'join'} eq "member" ? 1 : 0; # 'member' or 'down' - Completed controller join process - my $ready = (($in_ccm) && ($crmd) && ($join)) ? 1 : 0; # Our summary of if the node is "up" $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { 's1:node_name' => $node_name, 's2:node_id' => $node_id, 's3:maintenance_mode' => $maintenance_mode, - 's4:in_ccm' => $in_ccm, - 's5:crmd' => $crmd, - 's6:join' => $join, - 's7:ready' => $ready, }}); + ### These have changed. In older clusters, these are 'true/false' or 'online/offline', but now show as a timestamp. + # in_ccm - Corosync member + my $in_ccm = 0; + if (($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{in_ccm} eq "true") or ($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{in_ccm} =~ /^\d+$/)) + { + $in_ccm = 1; + } + # crmd - In corosync process group + my $crmd = 0; + if (($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{crmd} eq "online") or ($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{crmd} =~ /^\d+$/)) + { + $crmd = 1; + } + # join - Completed controller join process + my $join = 0; + if (($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'join'} eq "member") or ($anvil->data->{cib}{parsed}{cib}{node_state}{$node_id}{'join'} =~ /^\d+$/)) + { + $join = 1; + } + # If the global maintenance mode is set, set maintenance mode to true. if (($anvil->data->{cib}{parsed}{data}{cluster}{'maintenance-mode'}) && ($anvil->data->{cib}{parsed}{data}{cluster}{'maintenance-mode'} eq "true")) { $maintenance_mode = 1; $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { maintenance_mode => $maintenance_mode }}); } + # Our summary of if the node is "up" + my $ready = (($in_ccm) && ($crmd) && ($join)) ? 1 : 0; + $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => $debug, list => { + 's1:in_ccm' => $in_ccm, + 's2:crmd' => $crmd, + 's3:join' => $join, + 's4:ready' => $ready, + }}); $anvil->data->{cib}{parsed}{data}{node}{$node_name}{node_state}{pacemaker_id} = $node_id; $anvil->data->{cib}{parsed}{data}{node}{$node_name}{node_state}{'maintenance-mode'} = $maintenance_mode; From e4fc8312842b03e3245460b4b78ec40263619ae5 Mon Sep 17 00:00:00 2001 From: digimer Date: Sat, 20 Jan 2024 16:39:08 -0500 Subject: [PATCH 2/3] Added a missing variable to an alert. Signed-off-by: digimer --- scancore-agents/scan-server/scan-server | 1 + 1 file changed, 1 insertion(+) diff --git a/scancore-agents/scan-server/scan-server b/scancore-agents/scan-server/scan-server index 28392333..b3233196 100755 --- a/scancore-agents/scan-server/scan-server +++ b/scancore-agents/scan-server/scan-server @@ -184,6 +184,7 @@ sub connect_to_virsh clear => 1, message => $key, set_by => $THIS_FILE, + variables => $variables, }); } } From c5e72797fd53996c38e1dffc2185558aab8b132a Mon Sep 17 00:00:00 2001 From: digimer Date: Sat, 20 Jan 2024 16:43:35 -0500 Subject: [PATCH 3/3] Made the match for the partition 'swap' more flexible. Signed-off-by: digimer --- scancore-agents/scan-filesystems/scan-filesystems | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scancore-agents/scan-filesystems/scan-filesystems b/scancore-agents/scan-filesystems/scan-filesystems index 513ecc4f..6585cef0 100755 --- a/scancore-agents/scan-filesystems/scan-filesystems +++ b/scancore-agents/scan-filesystems/scan-filesystems @@ -487,7 +487,7 @@ INSERT INTO { # First time we've fallen under 5% my $alert_level = "warning"; - if ($new_mount_point eq "") + if ($new_mount_point =~ /swap/) { $alert_level = "notice"; }