jasonmcintosh / rabbitmq-zabbix

Zabbix RabbitMQ Configuration
Apache License 2.0
251 stars 168 forks source link

Support for wildcard filters #77

Open skibbipl opened 6 years ago

skibbipl commented 6 years ago

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?

jasonmcintosh commented 6 years ago

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 commented 6 years ago

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 ;)