rabbitmq-zabbix icon indicating copy to clipboard operation
rabbitmq-zabbix copied to clipboard

Support for wildcard filters

Open skibbipl opened this issue 7 years ago • 2 comments

Hello, I need to filter several queues starting with specific string so I modified your code a bit: Removed this line: https://github.com/jasonmcintosh/rabbitmq-zabbix/blob/fe59d5a5c3d7cce3a0fdc2feb5f9b37eba498e05/scripts/rabbitmq/api.py#L50 And replaced this line: https://github.com/jasonmcintosh/rabbitmq-zabbix/blob/fe59d5a5c3d7cce3a0fdc2feb5f9b37eba498e05/scripts/rabbitmq/api.py#L51 with:

shared_items = [(x, y) for x, y in queue.items() if x == u'name' and y.startswith(_filter['name'])]

And the same goes for lines: https://github.com/jasonmcintosh/rabbitmq-zabbix/blob/fe59d5a5c3d7cce3a0fdc2feb5f9b37eba498e05/scripts/rabbitmq/api.py#L138-L139 Perhaps you could consider adding possibility to use wildcard filters for queues/shovels?

skibbipl avatar Nov 07 '17 15:11 skibbipl

Eventually would like to get a regex option :) There's already minimal filtering available, it's just not where I'd like it to be... will review this when I can.

jasonmcintosh avatar Nov 07 '17 16:11 jasonmcintosh

https://github.com/jasonmcintosh/rabbitmq-zabbix/issues/22 btw for what I was originally thinking :) Also... please feel free to work on this and contribute ;)

jasonmcintosh avatar Nov 13 '17 22:11 jasonmcintosh