sensu-plugins / sensu-plugins-rabbitmq

This plugin provides native RabbitMQ instrumentation for monitoring and metrics collection, including: service health, message, consumer, and queue health/metrics via `rabbitmq_management`, and more.
http://sensu-plugins.io
MIT License
23 stars 67 forks source link

check-rabbitmq-queue-drain-time.rb match virtualhost #74

Open lbeucher opened 7 years ago

lbeucher commented 7 years ago

We use this check with the option vhost. We have two virtualHost (xxx and xxx-test). The problems is this check queue in virtualhost xxx and xxx-test. To correct the problem, i have replace: return queues.select { |x| x['vhost'].match(config[:vhost]) }

By return queues.select { |x| x['vhost']==config[:vhost] }.

Can you integrate this modification ?

majormoses commented 7 years ago

I think that we could maybe add an option to do exact match rather than regex. Also you could pass a regex that would exclude the test one. I would be happy to accept a PR to do this.

lbeucher commented 7 years ago

Hum, i'm not an ruby's expert.

majormoses commented 7 years ago

You can use --filter 'xxx$' to anchor your regex I believe.

lbeucher commented 7 years ago

The problems, we have two virtual host with same name of queue. With the --filter option, the check return value for: truc of xxx and truc of xxx-test