RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2078611 - [RFE] "enabled" meta-attribute for alerts
Summary: [RFE] "enabled" meta-attribute for alerts
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pacemaker
Version: 8.6
Hardware: All
OS: All
unspecified
low
Target Milestone: rc
: 8.9
Assignee: Reid Wahl
QA Contact: cluster-qe
Steven J. Levine
URL:
Whiteboard:
Depends On:
Blocks: 2078265
TreeView+ depends on / blocked
 
Reported: 2022-04-25 19:26 UTC by Ken Gaillot
Modified: 2023-11-14 16:51 UTC (History)
13 users (show)

Fixed In Version: pacemaker-2.1.6-1.el8
Doc Type: Enhancement
Doc Text:
.New `enabled` alert meta option to disable a Pacemaker alert Pacemaker alerts and alert recipients now support an `enabled` meta option. * Setting the `enabled` meta option to `false` for an alert disables the alert. * Setting the `enabled` meta option to `true` for an alert and `false` for a particular recipient disables the alert for that recipient. The default value for the `enabled` meta option is `true`. You can use this option to temporarily disable an alert for any reason, such as planned maintenance.
Clone Of: 2078265
Environment:
Last Closed: 2023-11-14 15:32:34 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CLUSTERQE-6694 0 None None None 2023-05-16 13:10:43 UTC
Red Hat Issue Tracker RHELPLAN-119887 0 None None None 2022-04-25 19:34:48 UTC
Red Hat Knowledge Base (Solution) 6955674 0 None None None 2022-04-29 02:30:18 UTC
Red Hat Product Errata RHEA-2023:6970 0 None None None 2023-11-14 15:33:21 UTC

Description Ken Gaillot 2022-04-25 19:26:55 UTC
+++ This bug was initially created as a clone of Bug #2078265 +++

Description of problem:
When there is a need of performing any manual activity involving multiple disable/enable of resources & has 'pcs alert' configured, it send across multiple email notifications to the recipients.

RFE is to allow system admin to take control over the alert notifications where the alerts can be disabled temporarily and enabled later.

####

The suggested implementation is an "enabled" meta-attribute that could be set for an <alert> or an individual <recipient>.

Comment 1 Reid Wahl 2023-03-16 21:16:44 UTC
Added upstream by commit 30970ac

Comment 6 jrehova 2023-07-28 16:28:50 UTC
Version of pacemaker:

> [root@virt-503:~]# rpm -q pacemaker
> pacemaker-2.1.6-5.el8.x86_64

Setting of 2-node cluster with Dummy resource:

> [root@virt-503:~]# pcs status
> Cluster name: STSRHTS17786
> Cluster Summary:
>   * Stack: corosync (Pacemaker is running)
>   * Current DC: virt-503 (version 2.1.6-5.el8-6fdc9deea29) - partition with quorum
>   * Last updated: Fri Jul 28 16:44:05 2023 on virt-503
>   * Last change:  Fri Jul 28 16:44:01 2023 by root via cibadmin on virt-503
>   * 2 nodes configured
>   * 3 resource instances configured
> 
> Node List:
>   * Online: [ virt-503 virt-509 ]
> 
> Full List of Resources:
>   * fence-virt-503	(stonith:fence_xvm):	 Started virt-503
>   * fence-virt-509	(stonith:fence_xvm):	 Started virt-509
>   * dummy	(ocf::heartbeat:Dummy):	 Started virt-503
> 
> Daemon Status:
>   corosync: active/disabled
>   pacemaker: active/disabled
>   pcsd: active/enabled

Installing and configuring sample alert agent on each node in cluster for 3 recipients:

> [root@virt-503:~]# install --mode=0755 /usr/share/pacemaker/alerts/alert_file.sh.sample /var/lib/pacemaker/alert_file.sh
> [root@virt-503:~]# touch /var/log/pcmk_alert_file_default.log
> [root@virt-503:~]# chown hacluster:haclient /var/log/pcmk_alert_file_default.log
> [root@virt-503:~]# chmod 600 /var/log/pcmk_alert_file_default.log

> [root@virt-503:~]# touch /var/log/pcmk_alert_file_enabled.log
> [root@virt-503:~]# chown hacluster:haclient /var/log/pcmk_alert_file_enabled.log
> [root@virt-503:~]# chmod 600 /var/log/pcmk_alert_file_enabled.log

> [root@virt-503:~]# touch /var/log/pcmk_alert_file_disabled.log
> [root@virt-503:~]# chown hacluster:haclient /var/log/pcmk_alert_file_disabled.log
> [root@virt-503:~]# chmod 600 /var/log/pcmk_alert_file_disabled.log

> [root@virt-509:~]# install --mode=0755 /usr/share/pacemaker/alerts/alert_file.sh.sample /var/lib/pacemaker/alert_file.sh
> [root@virt-509:~]# touch /var/log/pcmk_alert_file_default.log
> [root@virt-509:~]# chown hacluster:haclient /var/log/pcmk_alert_file_default.log
> [root@virt-509:~]# chmod 600 /var/log/pcmk_alert_file_default.log

> [root@virt-509:~]# touch /var/log/pcmk_alert_file_enabled.log
> [root@virt-509:~]# chown hacluster:haclient /var/log/pcmk_alert_file_enabled.log
> [root@virt-509:~]# chmod 600 /var/log/pcmk_alert_file_enabled.log

> [root@virt-509:~]# touch /var/log/pcmk_alert_file_disabled.log
> [root@virt-509:~]# chown hacluster:haclient /var/log/pcmk_alert_file_disabled.log
> [root@virt-509:~]# chmod 600 /var/log/pcmk_alert_file_disabled.log

Creating a cluster alert and adding 3 alert recipients that have "enabled" meta-attributes - default, enabled=true and enabled=false:

> [root@virt-503:~]# pcs alert create id=alert_file path=/var/lib/pacemaker/alert_file.sh

> [root@virt-503:~]# pcs alert recipient add alert_file id=recipient_default value=/var/log/pcmk_alert_file_default.log meta enabled=
> [root@virt-503:~]# pcs alert recipient add alert_file id=recipient_enabled value=/var/log/pcmk_alert_file_enabled.log meta enabled=true
> [root@virt-503:~]# pcs alert recipient add alert_file id=recipient_disabled value=/var/log/pcmk_alert_file_disabled.log meta enabled=false

Setting "enabled" meta-attributes for a cluster alert, then disabling and enabling Dummy resourse:

> [root@virt-503:~]# pcs alert update alert_file meta enabled=
> [root@virt-503:~]# pcs resource disable dummy
> [root@virt-503:~]# pcs resource enable dummy
> [root@virt-503:~]# pcs alert update alert_file meta enabled=false
> [root@virt-503:~]# pcs resource disable dummy
> [root@virt-503:~]# pcs resource enable dummy
> [root@virt-503:~]# pcs alert update alert_file meta enabled=true
> [root@virt-503:~]# pcs resource disable dummy
> [root@virt-503:~]# pcs resource enable dummy

Logging for each options:

> [root@virt-503:~]# tail -f /var/log/pcmk_alert_file_default.log
> 17:22:56.727687: Resource operation 'stop' for 'dummy' on 'virt-503': ok
> 17:24:03.866507: Resource operation 'start' for 'dummy' on 'virt-503': ok
> 17:24:03.913507: Resource operation 'monitor (10000)' for 'dummy' on 'virt-503': ok
> 17:32:00.011228: Resource operation 'stop' for 'dummy' on 'virt-503': ok
> 17:34:22.084844: Resource operation 'start' for 'dummy' on 'virt-503': ok
> 17:34:22.121843: Resource operation 'monitor (10000)' for 'dummy' on 'virt-503': ok
> 
> [root@virt-503:~]# tail -f /var/log/pcmk_alert_file_enabled.log
> 17:22:56.727687: Resource operation 'stop' for 'dummy' on 'virt-503': ok
> 17:24:03.866507: Resource operation 'start' for 'dummy' on 'virt-503': ok
> 17:24:03.913507: Resource operation 'monitor (10000)' for 'dummy' on 'virt-503': ok
> 17:32:00.011228: Resource operation 'stop' for 'dummy' on 'virt-503': ok
> 17:34:22.084844: Resource operation 'start' for 'dummy' on 'virt-503': ok
> 17:34:22.121843: Resource operation 'monitor (10000)' for 'dummy' on 'virt-503': ok
> 
> [root@virt-503:~]# tail -f /var/log/pcmk_alert_file_disabled.log
> 
> 

 Results: 

 alert meta-attributes        recipient meta-attributes          Should it be written to the log file?      Does it works?
 =====================        =========================          =====================================      ==============
 default                      default                            yes                                        yes
                              enabled                            yes                                        yes
                              disabled                           no                                         yes
__________________________________________________________________________________________________________________________

 enabled                      default                            yes                                        yes
                              enabled                            yes                                        yes
                              disabled                           no                                         yes
__________________________________________________________________________________________________________________________

 disabled                     default                            no                                         yes
                              enabled                            no                                         yes
                              disabled                           no                                         yes

Comment 12 errata-xmlrpc 2023-11-14 15:32:34 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (pacemaker bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2023:6970


Note You need to log in before you can comment on or make changes to this bug.