ClusterLabs / crmsh

Command-line interface for High-Availability cluster management on GNU/Linux systems.
GNU General Public License v2.0
131 stars 94 forks source link

wishlist: filter `crm configure show` by type of the primitive #819

Closed klaernie closed 1 year ago

klaernie commented 3 years ago

it would be really neat if crm configure show could be filtered by the type of the primitive, so that one could for example filter down to only the IPaddr2 resources.

My specific use case is scanning multiple machines to keep an inventory database up to date, where it would be nice to filter out which IPs are used by the clusters.

Right now I use the following one liner to grab the information needed, but this isn't the most practical to maintain:

env PAGER=cat crm configure show | perl -pe 's/\\\n//' | perl -ne 'if(m/prm_([^\s]+)_IP\sIPaddr2.*ip=([\d.]+).*cidr_netmask=(\d+)/){ print "$1|$2/$3\n" }'

I realize that this is a pure wishlist item, maybe it's a good first contribution for someone to get their feet wet.

liangxin1300 commented 3 years ago

Hi @klaernie , Currently crmsh support crm configure show type:primitive, is that what you want?

klaernie commented 3 years ago

Hi @liangxin1300

That helps partially, but of cause still lists more resources than in my case the IP addresses. Most of the clusters I run scans for have 5-10 LVM volume groups and logical volumes, 2-3 application resources and only one IPaddr2 resource.

liangxin1300 commented 3 years ago

Hi @liangxin1300

That helps partially, but of cause still lists more resources than in my case the IP addresses. Most of the clusters I run scans for have 5-10 LVM volume groups and logical volumes, 2-3 application resources and only one IPaddr2 resource.

Seems like this issue https://github.com/ClusterLabs/crmsh/issues/698 I will put this into my backlog Thank you @klaernie !