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 1363907 - allow crm_mon option to specify what sections to display
Summary: allow crm_mon option to specify what sections to display
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pacemaker
Version: 8.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: pre-dev-freeze
: 8.3
Assignee: Chris Lumens
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1774888
TreeView+ depends on / blocked
 
Reported: 2016-08-03 22:23 UTC by Ken Gaillot
Modified: 2020-11-04 04:01 UTC (History)
9 users (show)

Fixed In Version: pacemaker-2.0.4-2.el8
Doc Type: No Doc Update
Doc Text:
The eventual corresponding functionality in pcs will be what's documented
Clone Of: 1361533
: 1774888 (view as bug list)
Environment:
Last Closed: 2020-11-04 04:00:53 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ken Gaillot 2016-08-03 22:23:20 UTC
+++ This bug was initially created as a clone of Bug #1361533 +++

--- Additional comment from Tomas Jelinek on 2016-08-03 07:09:39 EDT ---

(In reply to Ken Gaillot from comment #3)
> I'll try to fix the header issue for 7.3, but understand that the console
> output changes from one pacemaker version to another, so it can't be relied
> on in the long term.
> 
> Is your goal to display only certain sections of the crm_mon output? For
> example, just the resources, or just the resources and the failcounts. If

yes

> that's the case, I have an idea for an enhancement that could make it into
> 7.4. We could add an --include option to crm_mon that would take a
> comma-separated list of sections you want to display. E.g. "crm_mon
> --include resources,failcounts". Would that be sufficient?

That would be great!

Comment 2 Ken Gaillot 2017-03-15 17:25:06 UTC
Unfortunately, due to capacity constraints, this will not be ready for 7.4. It will be a priority for 7.5.

Comment 3 Ken Gaillot 2017-08-29 21:18:05 UTC
Due to a short time frame and limited capacity, this will not make 7.5.

Comment 4 Ken Gaillot 2019-01-15 17:32:45 UTC
Bumping to 8.1 due to devel/QA capacity constraints

Comment 5 Ken Gaillot 2019-11-20 15:59:14 UTC
To summarize the current plan, the following design will take care of this bz, Bug 1300597, and Bug 1300604:

crm_mon will gain new "--include" and "--exclude" options to select what sections are shown. For example, to show only the top summary and the nodes status, you could use "crm_mon --include=none,summary,nodes". Or to show just the resources section, you could use "crm_mon --include=none,resources". (The "none" is to clear the defaults. You could equally keep the defaults and use "--exclude" to specify everything you don't want to see.)

Some of these section names will take an optional qualifier as "SECTION:QUALIFIER". For "nodes" and "resources", this qualifier will be an XML ID, either of a particular node or resource, or of a tag. When a qualifier is given, crm_mon will show only the requested nodes and/or resources.

For example, to show just the status of node1, you could use "crm_mon --include=none,nodes:node1". Or just the status of rsc1, "crm_mon --include=none,resources:rsc1".

For an explanation of how tagging works in the Pacemaker configuration, see the "Tagging configuration elements" section of the upstream "Pacemaker Explained" documentation:

    https://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/2.0/html-single/Pacemaker_Explained/index.html#_tagging_configuration_elements

pcs will need the ability to set tags (Bug 1684676) as well as new options to use this new selection syntax.

Comment 6 Ken Gaillot 2020-02-27 21:28:33 UTC
Fixed upstream as of https://github.com/ClusterLabs/pacemaker/pull/1944

QA: For this BZ, we are not concerned with the single resource/node selection described in Comment 5 (which will likely have a different syntax), just the section selection part. Run "crm_mon -1 --include=list" to see a list of what sections are available. Example: "crm_mon --include=none,resources,failures" shows just active resources and past operation failures (not the top summary, nodes section, etc.).

Comment 7 Patrik Hagara 2020-03-23 08:44:20 UTC
qa_ack+, how to test in comment#6

Comment 11 Markéta Smazová 2020-09-24 16:13:08 UTC
    [root@virt-023 11:09:12 ~]# rpm -q pacemaker
>   pacemaker-2.0.4-6.el8.x86_64


Check that the new command is documented in crm_mon man/help.

>   [root@virt-023 11:08:55 ~]# crm_mon --help-display
>   Usage:
>     crm_mon [OPTION?]
>
>   Provides a summary of cluster's current state.
>
>   Outputs varying levels of detail in a number of different formats.
>
>   Display Options:
>     -I, --include=SECTION(s)          A list of sections to include in the output.
>                                       See `Output Control` help for more information.
>     -U, --exclude=SECTION(s)          A list of sections to exclude from the output.
>                                       See `Output Control` help for more information.
>   [...]
>
>   Output Control:

>   By default, a certain list of sections are written to the output destination.
>   The default varies based on the output format - XML includes everything, while
>   other output formats will display less.  This list can be modified with the
>   --include and --exclude command line options.  Each option may be given multiple
>   times on the command line, and each can give a comma-separated list of sections.
>   The options are applied to the default set, from left to right as seen on the
>   command line.  For a list of valid sections, pass --include=list or --exclude=list.
>
>   [...]


>   [root@virt-023 11:09:49 ~]# crm_mon --include=list
>   Usage:
>     crm_mon [OPTION…]
>
>   Provides a summary of cluster's current state.
>
>   Outputs varying levels of detail in a number of different formats.
>
>   [...]
>
>   crm_mon: --include options: all, attributes, bans[:PREFIX], counts, dc, default, failcounts, failures, fencing, fencing-failed, fencing-pending, fencing-succeeded, nodes, none, operations, options, resources, stack, summary, tickets, times


>   [root@virt-023 11:11:34 ~]# crm_mon --exclude=list
>   Usage:
>     crm_mon [OPTION…]
>
>   Provides a summary of cluster's current state.
>
>   Outputs varying levels of detail in a number of different formats.
>
>   [...]
>
>   crm_mon: --exclude options: all, attributes, bans, counts, dc, failcounts, failures, fencing, fencing-failed, fencing-pending, fencing-succeeded, nodes, none, operations, options, resources, stack, summary, tickets, times


>   [root@virt-023 11:16:53 ~]# man crm_mon
>   PACEMAKER(8)                                      System Administration Utilities                                      PACEMAKER(8)
>
>   NAME
>          Pacemaker - Part of the Pacemaker cluster resource manager
>
>   SYNOPSIS
>          crm_mon mode [options]
>
>   DESCRIPTION
>          Provides a summary of cluster's current state.
>
>          Outputs varying levels of detail in a number of different formats.
>
>   OPTIONS
>
>   [...]
>
>      Display Options:
>          -I, --include=SECTION(s)
>                 A list of sections to include in the output.  See `Output Control` help for more information.
>
>          -U, --exclude=SECTION(s)
>                 A list of sections to exclude from the output.  See `Output Control` help for more information.
>
>   [...]
>
>   OUTPUT CONTROL
>          By default, a certain list of sections are written to the output destination.  The default varies based on the output format
>          - XML includes everything, while other output formats will display less.  This list can be modified with the  --include  and
>          --exclude command line options.  Each option may be given multiple times on the command line, and each can give a comma-sep‐
>          arated list of sections.  The options are applied to the default set, from left to right as seen on the command line.  For a
>          list of valid sections, pass --include=list or --exclude=list.


Command `crm_mon --include=default` gives the same results as the default `crm_mon`. When there are any "Failed Fencing Actions" 
(fencing-failed) and "Failed Resource Actions" (failures), those will be displayed in the default view too. Also the updates about "Pending Fencing" 
are displayed as they occur.

>   [root@virt-023 ~]# crm_mon --include=default
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC:	virt-024 (version 2.0.4-6.el8-2deceaa3ae) - partition with quorum
>     * Last updated: Wed Sep 23 16:06:08 2020
>     * Last change:  Wed Sep 23 15:59:01 2020 by root via crm_resource on virt-024
>     * 3 nodes configured
>     * 8 resource instances configured
>
>   Node List:
>     * Online: [ virt-023 virt-024 ]
>     * RemoteOnline: [ virt-031 ]
>
>   Active Resources:
>     * fence-virt-023	(stonith:fence_xvm):     Started virt-023
>     * fence-virt-024	(stonith:fence_xvm):     Started virt-024
>     * fence-virt-031	(stonith:fence_xvm):     Started virt-023
>     * virt-031    (ocf::pacemaker:remote):         Started virt-024
>     * dummy2	(ocf::pacemaker:Dummy):  Started virt-031
>     * dummy3	(ocf::pacemaker:Dummy):  Started virt-031
>     * dummy4	(ocf::pacemaker:Dummy):  Started virt-031
>
>   Failed Resource Actions:
>     * dummy1_start_0 on virt-031 'not configured' (6): call=11976, status='complete', exitreason='', last-rc-change='2020-09-23 15:59:02 +02:00', queued=0ms, exec=3ms
>
>   Failed Fencing Actions:
>     * reboot of virt-023 failed: delegate=virt-024, client=pacemaker-controld.1238, origin=virt-024, last-failed='2020-09-21 17:05:45 +02:00'


Adding a new section to the default view can be done by `crm_mon --include=default,SECTION(s)` or `crm_mon --include=SECTION(s)`.
For example `crm_mon --include=options,failcounts,fencing-succeeded` adds the cluster "options", 
"Migration Summary" (failcounts) and "Fencing History" (fencing-succeeded) sections to the default `crm_mon` view.

>   [root@virt-023 15:19:19 ~]# crm_mon --include=options,failcounts,fencing-succeeded
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC: virt-024 (version 2.0.4-6.el8-2deceaa3ae) - partition with quorum
>     * Last updated: Thu Sep 24 15:26:48 2020
>     * Last change:  Wed Sep 23 15:59:01 2020 by root via crm_resource on virt-024
>     * 3 nodes configured
>     * 8 resource instances configured
>     * STONITH of failed nodes enabled
>     * Cluster is symmetric
>     * No quorum policy: Stop ALL resources
>
>   Node List:
>     * Online: [ virt-023 virt-024 ]
>     * RemoteOnline: [ virt-031 ]
>
>   Active Resources:
>     * fence-virt-023	(stonith:fence_xvm):	 Started virt-023
>     * fence-virt-024	(stonith:fence_xvm):	 Started virt-024
>     * fence-virt-031	(stonith:fence_xvm):	 Started virt-023
>     * virt-031	(ocf::pacemaker:remote):	 Started virt-024
>     * dummy2	(ocf::pacemaker:Dummy):	 Started virt-031
>     * dummy3	(ocf::pacemaker:Dummy):	 Started virt-031
>     * dummy4	(ocf::pacemaker:Dummy):	 Started virt-031
>
>   Migration Summary:
>     * Node: virt-031:
>       * dummy1: migration-threshold=1000000 fail-count=1000000 last-failure='Wed Sep 23 15:59:02 2020'
>
>   Failed Resource Actions:
>     * dummy1_start_0 on virt-031 'not configured' (6): call=11976, status='complete', exitreason='', last-rc-change='2020-09-23 15:59:02 +02:00', queued=0ms, exec=3ms
>
>   Failed Fencing Actions:
>     * reboot of virt-023 failed: delegate=virt-024, client=pacemaker-controld.1238, origin=virt-024, last-failed='2020-09-21 17:05:45 +02:00' 
>
>   Fencing History:
>     * reboot of virt-023 successful: delegate=virt-024, client=pacemaker-controld.1238, origin=virt-024, last-successful='2020-09-21 17:24:49 +02:00'

The `--include=none` option is used to clear the defaults. The defaults can be also cleared by `--exclude=all`. For example, 
to see only the resources and failures, command `crm_mon --include=none,resources,failures` can be used as well as 
`crm_mon --exclude=all --include=resources,failures`. Running just `crm_mon --exclude=all` or `crm_mon --include=none` displays nothing.

>   [root@virt-023 14:56:20 ~]# crm_mon --include=none,resources,failures
>   Active Resources:
>     * fence-virt-023	(stonith:fence_xvm):	 Started virt-023
>     * fence-virt-024	(stonith:fence_xvm):	 Started virt-024
>     * fence-virt-031	(stonith:fence_xvm):	 Started virt-023
>     * virt-031	(ocf::pacemaker:remote):	 Started virt-024
>     * dummy2	(ocf::pacemaker:Dummy):	 Started virt-031
>     * dummy3	(ocf::pacemaker:Dummy):	 Started virt-031
>     * dummy4	(ocf::pacemaker:Dummy):	 Started virt-031
>
>   Failed Resource Actions:
>     * dummy1_start_0 on virt-031 'not configured' (6): call=11976, status='complete', exitreason='', last-rc-change='2020-09-23 15:59:02 +02:00', queued=0ms, exec=3ms

Use `--exclude` to keep the defaults and specify sections that should not be displayed.

>   [root@virt-023 16:39:48 ~]# crm_mon --exclude=summary,nodes
>   Active Resources:
>     * fence-virt-023	(stonith:fence_xvm):	 Started virt-023
>     * fence-virt-024	(stonith:fence_xvm):	 Started virt-024
>     * fence-virt-031	(stonith:fence_xvm):	 Started virt-023
>     * virt-031	(ocf::pacemaker:remote):	 Started virt-024
>     * dummy2	(ocf::pacemaker:Dummy):	 Started virt-031
>     * dummy3	(ocf::pacemaker:Dummy):	 Started virt-031
>     * dummy4	(ocf::pacemaker:Dummy):	 Started virt-031
>
>   Failed Resource Actions:
>     * dummy1_start_0 on virt-031 'not configured' (6): call=11976, status='complete', exitreason='', last-rc-change='2020-09-23 15:59:02 +02:00', queued=0ms, exec=3ms
>
>   Failed Fencing Actions:
>     * reboot of virt-023 failed: delegate=virt-024, client=pacemaker-controld.1238, origin=virt-024, last-failed='2020-09-21 17:05:45 +02:00' 

Try to give both `--include` and `--exclude` options multiple times.

>   [root@virt-031 16:31:42 ~]# crm_mon --exclude=all --include=nodes --include=attributes
>       Node List:
>         * Online: [ virt-023 virt-024 ]
>         * RemoteOnline: [ virt-031 ]
>
>       Node Attributes:
>         * Node: virt-023:
>           * location                        	: office    
>         * Node: virt-024:
>           * location                        	: office    
>         * Node: virt-031:
>           * location                        	: remote

>   [root@virt-023 14:52:00 ~]# crm_mon --exclude=fencing-failed --exclude=failures --exclude=nodes
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC: virt-024 (version 2.0.4-6.el8-2deceaa3ae) - partition with quorum
>     * Last updated: Thu Sep 24 14:52:31 2020
>     * Last change:  Wed Sep 23 15:59:01 2020 by root via crm_resource on virt-024
>     * 3 nodes configured
>     * 8 resource instances configured
>
>   Active Resources:
>     * fence-virt-023	(stonith:fence_xvm):	 Started virt-023
>     * fence-virt-024	(stonith:fence_xvm):	 Started virt-024
>     * fence-virt-031	(stonith:fence_xvm):	 Started virt-023
>     * virt-031	(ocf::pacemaker:remote):	 Started virt-024
>     * dummy2	(ocf::pacemaker:Dummy):	 Started virt-031
>     * dummy3	(ocf::pacemaker:Dummy):	 Started virt-031
>     * dummy4	(ocf::pacemaker:Dummy):	 Started virt-031

Try to display all sections. Both `crm_mon --include=all` and `crm_mon --exclude=none` commands work.

>   [root@virt-023 16:40:44 ~]# crm_mon --include=all
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC: virt-024 (version 2.0.4-6.el8-2deceaa3ae) - partition with quorum
>     * Last updated: Wed Sep 23 16:55:55 2020
>     * Last change:  Wed Sep 23 15:59:01 2020 by root via crm_resource on virt-024
>     * 3 nodes configured
>     * 8 resource instances configured
>
>   Node List:
>     * Online: [ virt-023 virt-024 ]
>     * RemoteOnline: [ virt-031 ]
>
>   Active Resources:
>     * fence-virt-023	(stonith:fence_xvm):	 Started virt-023
>     * fence-virt-024	(stonith:fence_xvm):	 Started virt-024
>     * fence-virt-031	(stonith:fence_xvm):	 Started virt-023
>     * virt-031	(ocf::pacemaker:remote):	 Started virt-024
>     * dummy2	(ocf::pacemaker:Dummy):	 Started virt-031
>     * dummy3	(ocf::pacemaker:Dummy):	 Started virt-031
>     * dummy4	(ocf::pacemaker:Dummy):	 Started virt-031
>
>   Node Attributes:
>     * Node: virt-023:
>       * location                        	: office
>     * Node: virt-024:
>       * location                        	: office
>     * Node: virt-031:
>       * location                        	: remote
>
>   Operations:
>     * Node: virt-023:
>       * fence-virt-031: migration-threshold=1000000:
>         * (15) start
>         * (37) monitor: interval="60000ms"
>       * fence-virt-023: migration-threshold=1000000:
>         * (10) start
>         * (17) monitor: interval="60000ms"
>       * dummy4: migration-threshold=1000000:
>         * (47) monitor: interval="10000ms"
>         * (50) stop
>     * Node: virt-024:
>       * fence-virt-031: migration-threshold=1000000:
>         * (193) stop
>       * virt-031: migration-threshold=1000000:
>         * (2) start
>         * (3) monitor: interval="60000ms"
>       * fence-virt-023: migration-threshold=1000000:
>         * (191) stop
>       * fence-virt-024: migration-threshold=1000000:
>         * (43) start
>         * (45) monitor: interval="60000ms"
>     * Node: virt-031:
>       * dummy1: migration-threshold=1000000 fail-count=1000000 last-failure='Wed Sep 23 15:59:02 2020':
>         * (7113) monitor: interval="10000ms"
>         * (11976) start
>         * (11977) stop
>       * dummy2: migration-threshold=1000000:
>         * (7115) probe
>         * (7115) probe
>         * (7116) monitor: interval="10000ms"
>       * dummy3: migration-threshold=1000000:
>         * (7118) probe
>         * (7118) probe
>         * (7119) monitor: interval="10000ms"
>       * dummy4: migration-threshold=1000000:
>         * (9701) start
>         * (9702) monitor: interval="10000ms"
>
>   Failed Resource Actions:
>     * dummy1_start_0 on virt-031 'not configured' (6): call=11976, status='complete', exitreason='', last-rc-change='2020-09-23 15:59:02 +02:00', queued=0ms, exec=3ms
>
>   Failed Fencing Actions:
>     * reboot of virt-023 failed: delegate=virt-024, client=pacemaker-controld.1238, origin=virt-024, last-failed='2020-09-21 17:05:45 +02:00' 
>
>   Fencing History:
>     * reboot of virt-023 successful: delegate=virt-024, client=pacemaker-controld.1238, origin=virt-024, last-successful='2020-09-21 17:24:49 +02:00'


marking verified in pacemaker-2.0.4-6.el8

Comment 16 errata-xmlrpc 2020-11-04 04:00:53 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-2020:4804


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