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 1300597 - add option to crm_mon to display status of a single resource
Summary: add option to crm_mon to display status of a single resource
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pacemaker
Version: 8.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.4
Assignee: Chris Lumens
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On: 1682116 1752538 1885645
Blocks: 1290830 1679810
TreeView+ depends on / blocked
 
Reported: 2016-01-21 09:23 UTC by Tomas Jelinek
Modified: 2023-12-15 15:50 UTC (History)
12 users (show)

Fixed In Version: pacemaker-2.0.5-1.el8
Doc Type: No Doc Update
Doc Text:
The corresponding pcs functionality should be documented instead
Clone Of: 1290830
Environment:
Last Closed: 2021-05-18 15:26:41 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2066323 0 None None None 2018-08-06 16:04:57 UTC

Comment 1 Tomas Jelinek 2016-01-21 09:26:32 UTC
Cloning for pacemaker to add an option to crm_mon which would crm_mon make display status of a single resource. It may be nice to display the resource's parents and children as well or have it controlled by another option.

Comment 3 Ken Gaillot 2016-05-26 20:04:43 UTC
This will not be ready in the 7.3 timeframe.

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

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

Comment 6 Jan Pokorný [poki] 2017-12-03 10:19:25 UTC
It might be a good idea to make the "query language" equivalent to
"constraint specification language", for resources, it means,
for instance:

- #rsc-pattern eq ip-.*
- #pattern:value:port eq 80

On the other hand, if we are going to mix tagging for the query purposes
([bug 1513550]) in, we shoud conversely reflect that also at the level of
the constraints:

- #tag eq precious_svcs

Comment 7 Jan Pokorný [poki] 2017-12-03 10:23:22 UTC
s/#param:value:port eq 80/#param:value:port eq 80/

Comment 10 Ken Gaillot 2018-12-18 20:28:33 UTC
Moving to RHEL 8 only, as this will not make 7.7, which will be the last RHEL 7 feature release

Comment 11 Patrik Hagara 2019-09-30 19:07:41 UTC
Setting QA CondNAK due to capacity constraints.

Comment 12 Ken Gaillot 2019-11-20 15:58:12 UTC
To summarize the current plan, the following design will take care of this bz, Bug 1300604, and Bug 1363907:

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 13 Ken Gaillot 2020-03-17 14:32:27 UTC
The --include/--exclude options have been merged as described, but the single-resource/single-node is likely to change from what is described in Comment 12

Comment 14 Patrik Hagara 2020-03-23 11:09:30 UTC
re-adding qa_ack+

Comment 17 Ken Gaillot 2020-08-21 17:45:54 UTC
New feature merged upstream as of https://github.com/ClusterLabs/pacemaker/pull/2092

Comment 19 Jaroslav Kortus 2020-10-09 15:42:57 UTC
Just out of curiosity - could we get rid of the --include=none? It's counter-intuitive for me. If I'm specifying --include I'm already willing to get filtered results. Having to specify "none" all the time feels useless. --exclude does not have it either (like --exclude=all,...), right? I would simply assume the "none" is there by default and clearing all defaults, delivering only the specified sections.

Comment 22 Ken Gaillot 2020-10-12 15:20:41 UTC
(In reply to Jaroslav Kortus from comment #19)
> Just out of curiosity - could we get rid of the --include=none? It's
> counter-intuitive for me. If I'm specifying --include I'm already willing to
> get filtered results. Having to specify "none" all the time feels useless.
> --exclude does not have it either (like --exclude=all,...), right? I would
> simply assume the "none" is there by default and clearing all defaults,
> delivering only the specified sections.

We do have --exclude=all, which is identical to --include=none.

Most of the time, users don't want to clear the defaults, but add on top of them, so that's how --include/--exclude work by default. It's similar to how previously, if you gave "crm_mon --failcounts", it would show fail counts as well as the usual information -- "crm_mon --include=failcounts" works the same way.

In the less common case someone wants to show *only* one section, then they have to specify --include=none,<section> or --exclude=all --include=<section>.

Comment 28 Markéta Smazová 2020-11-09 16:23:42 UTC
Check that the new option is documented in crm_mon man/help.

>   [root@virt-245 ~]# rpm -q pacemaker
>   pacemaker-2.0.5-2.el8.x86_64

>   [root@virt-245 ~]# 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.

>          --node=NODE
>                 When  displaying information about nodes, show only what's related to the given node, or to all nodes
>                 tagged with the given tag

>          --resource=RSC
>                 When displaying information about resources, show only what's related to the given  resource,  or  to
>                 all resources tagged with the given tag

>   [root@virt-245 ~]# 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.
>     --node=NODE                       When displaying information about nodes, show only what's related to the given
>                                       node, or to all nodes tagged with the given tag
>     --resource=RSC                    When displaying information about resources, show only what's related to the given
>                                       resource, or to all resources tagged with the given tag
>   [...]

Display a single resource.

>   [root@virt-245 ~]# crm_mon --resource=dummy --one-shot
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC: virt-246 (version 2.0.5-2.el8-31aa4f5515) - partition with quorum
>     * Last updated: Mon Nov  9 14:49:04 2020
>     * Last change:  Mon Nov  9 14:48:14 2020 by root via cibadmin on virt-245
>     * 2 nodes configured
>     * 3 resource instances configured

>   Node List:
>     * Online: [ virt-245 virt-246 ]

>   Active Resources:
>     * dummy	(ocf::pacemaker:Dummy):	 Started virt-245

Display resource group.

>   [root@virt-245 ~]# crm_mon --resource=dummy-group -1
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC:	virt-246 (version 2.0.5-2.el8-31aa4f5515) - partition with quorum
>     * Last updated: Mon Nov  9 16:01:05 2020
>     * Last change:  Mon Nov  9 16:00:57 2020 by root via cibadmin on virt-246
>     * 2 nodes configured
>     * 6 resource instances configured (2 DISABLED)

>   Node List:
>     * Online: [ virt-245 virt-246 ]

>   Active Resources:
>     * Resource Group: dummy-group:
>       * dummy5    (ocf::pacemaker:Dummy):  Started virt-245
>       * dummy6    (ocf::pacemaker:Dummy):  Started virt-245

Display cloned resource.

>   [root@virt-245 ~]# crm_mon --resource=dummy-clone -1
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC: virt-246 (version 2.0.5-2.el8-31aa4f5515) - partition with quorum
>     * Last updated: Mon Nov  9 15:40:19 2020
>     * Last change:  Mon Nov  9 15:40:04 2020 by root via cibadmin on virt-245
>     * 2 nodes configured
>     * 4 resource instances configured

>   Node List:
>     * Online: [ virt-245 virt-246 ]

>   Active Resources:
>     * Clone Set: dummy-clone [dummy]:
>       * Started: [ virt-245 virt-246 ]

Use `--include=none,resources` option to display only the resource section of crm_mon and view only "dummy-clone".

>   [root@virt-245 ~]# crm_mon --include=none,resources --resource=dummy-clone -1
>   Active Resources:
>     * Clone Set: dummy-clone [dummy]:
>       * Started: [ virt-245 virt-246 ]

Try using two `--resource` options in one command. 
The `--resource` option accepts a resource name or a tag as argument. Only a single `--resource` option is accepted by 
crm_mon command (latter instances overwrite earlier ones, ie. `--resource=rsc1 --resource=rsc2` shows status for resource rsc2).

>   [root@virt-245 ~]# crm_mon  --resource=dummy-group --resource=dummy-clone -1
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC: virt-246 (version 2.0.5-2.el8-31aa4f5515) - partition with quorum
>     * Last updated: Mon Nov  9 15:44:32 2020
>     * Last change:  Mon Nov  9 15:40:04 2020 by root via cibadmin on virt-245
>     * 2 nodes configured
>     * 4 resource instances configured

>   Node List:
>     * Online: [ virt-245 virt-246 ]

>   Active Resources:
>     * Clone Set: dummy-clone [dummy]:
>       * Started: [ virt-245 virt-246 ]

Display resources tagged with `pcs tag`.

>   [root@virt-246 ~]# pcs tag create tagged_resources dummy1 dummy2
>   [root@virt-245 ~]# crm_mon --resource=tagged_resources -1
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC: virt-246 (version 2.0.5-2.el8-31aa4f5515) - partition with quorum
>     * Last updated: Mon Nov  9 16:11:16 2020
>     * Last change:  Mon Nov  9 16:10:43 2020 by root via cibadmin on virt-246
>     * 2 nodes configured
>     * 8 resource instances configured

>   Node List:
>     * Online: [ virt-245 virt-246 ]

>   Active Resources:
>     * dummy1	(ocf::pacemaker:Dummy):	 Started virt-246
>     * dummy2	(ocf::pacemaker:Dummy):	 Started virt-246

Display disabled resource. In order to see details of disabled resource, option `--inactive` must be added as well.

>   [root@virt-245 ~]# pcs resource disable dummy-clone
>   [root@virt-245 ~]# crm_mon --resource=dummy-clone --one-shot
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC: virt-246 (version 2.0.5-2.el8-31aa4f5515) - partition with quorum
>     * Last updated: Mon Nov  9 15:53:02 2020
>     * Last change:  Mon Nov  9 15:52:44 2020 by root via cibadmin on virt-245
>     * 2 nodes configured
>     * 5 resource instances configured (2 DISABLED)

>   Node List:
>     * Online: [ virt-245 virt-246 ]

>   Active Resources:
>     * No active resources

>   [root@virt-245 ~]# crm_mon --resource=dummy-clone --one-shot --inactive
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC: virt-246 (version 2.0.5-2.el8-31aa4f5515) - partition with quorum
>     * Last updated: Mon Nov  9 15:53:21 2020
>     * Last change:  Mon Nov  9 15:52:44 2020 by root via cibadmin on virt-245
>     * 2 nodes configured
>     * 5 resource instances configured (2 DISABLED)

>   Node List:
>     * Online: [ virt-245 virt-246 ]

>   Full List of Resources:
>     * Clone Set: dummy-clone [dummy] (disabled):
>       * Stopped (disabled): [ virt-245 virt-246 ]

Display pacemaker remote resource "virt-484".

>   [root@virt-482 ~]# crm_mon --resource=virt-484 -1
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC: virt-482 (version 2.0.5-2.el8-31aa4f5515) - partition with quorum
>     * Last updated: Mon Nov  9 16:15:10 2020
>     * Last change:  Mon Nov  9 16:14:41 2020 by root via cibadmin on virt-482
>     * 3 nodes configured
>     * 4 resource instances configured

>   Node List:
>     * Online: [ virt-482 virt-483 ]
>     * RemoteOnline: [ virt-484 ]

>   Active Resources:
>     * virt-484	(ocf::pacemaker:remote):	 Started virt-482

Display resource "dummy" running on Pacemaker remote node.

>   [root@virt-482 ~]# crm_mon --resource=dummy -1
>   Cluster Summary:
>     * Stack: corosync
>     * Current DC: virt-482 (version 2.0.5-2.el8-31aa4f5515) - partition with quorum
>     * Last updated: Mon Nov  9 16:17:30 2020
>     * Last change:  Mon Nov  9 16:16:23 2020 by virt-484 via cibadmin on virt-482
>     * 3 nodes configured
>     * 5 resource instances configured

>   Node List:
>     * Online: [ virt-482 virt-483 ]
>     * RemoteOnline: [ virt-484 ]

>   Active Resources:
>     * dummy	(ocf::pacemaker:Dummy):	 Started virt-484

Try running the command without specifying the resource name.

>   [root@virt-245 ~]# crm_mon --resource
>   crm_mon: Missing argument for --resource

Try displaying non-existing resource "dummy5", allow crm_mon to display updates (option `--one-shot` is not used).

>   [root@virt-245 ~]# crm_mon --resource=dummy5
>      Cluster Summary:
>   * Stack: corosync
>   * Current DC:	virt-246 (version 2.0.5-2.el8-31aa4f5515) - partition with quorum
>   * Last updated: Mon Nov  9 15:49:00 2020
>   * Last change:  Mon Nov  9 15:40:04 2020 by root via cibadmin on virt-245
>   * 2 nodes configured
>   * 4 resource instances configured

>   Node List:
>     * Online: [ virt-245 virt-246 ]

>   Active Resources:
>     * No active resources

Resource "dummy5" is not found, but when it is later added, crm_mon is updated with information about it. 

>   [root@virt-246 ~]# pcs resource create dummy5 ocf:pacemaker:Dummy
>   [root@virt-245 ~]# crm_mon --resource=dummy5
>    Cluster Summary:
>     * Stack: corosync
>     * Current DC:	virt-246 (version 2.0.5-2.el8-31aa4f5515) - partition with quorum
>     * Last updated: Mon Nov  9 15:49:45 2020
>     * Last change:  Mon Nov  9 15:49:43 2020 by root via cibadmin on virt-246
>     * 2 nodes configured
>     * 5 resource instances configured

>   Node List:
>     * Online: [ virt-245 virt-246 ]

>   Active Resources:
>     * dummy5	(ocf::pacemaker:Dummy):  Started virt-245

marking verified in pacemaker-2.0.5-2.el8

Comment 30 errata-xmlrpc 2021-05-18 15:26:41 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-2021:1782


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