crmsh icon indicating copy to clipboard operation
crmsh copied to clipboard

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

Open klaernie opened this issue 3 years ago • 3 comments

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.

klaernie avatar May 28 '21 19:05 klaernie

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

liangxin1300 avatar May 31 '21 02:05 liangxin1300

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.

klaernie avatar Jun 01 '21 05:06 klaernie

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 !

liangxin1300 avatar Jun 02 '21 00:06 liangxin1300