---
- name: rabbit process check
  sensu_process_check: service=rabbitmq
  notify: restart sensu-client

- name: rabbit cluster check
  sensu_check: name=rabbitmq-cluster plugin=check-rabbitmq-cluster.rb
               args="--expected 2" use_sudo=true
  notify: restart sensu-client
  when: rabbitmq.cluster

- name: rabbit queues check
  sensu_check: name=rabbitmq-queues plugin=check-rabbitmq-queues.rb
               use_sudo=true
  notify: restart sensu-client

- name: set cluster count fact
  set_fact: cluster_node_count={{ groups['all'] | count }}

- name: rabbit queue num check
  sensu_check: name=rabbitmq-numqueues plugin=check-rabbitmq-queues.rb
               args="-t number -w {{ cluster_node_count|int * 50 }}
                     -c {{ cluster_node_count|int * 100 }}
                     --timeout 2"
               use_sudo=true
  notify: restart sensu-client

- name: rabbit metrics
  template: src=etc/collectd/plugins/rabbitmq.conf dest=/etc/collectd/plugins/rabbitmq.conf
  notify: restart collectd
  when: collectd is defined and collectd.enabled|bool
  tags: collectd

---
- name: rabbit process check
  sensu_process_check: service=rabbitmq
  notify: restart sensu-client

- name: rabbit cluster check
  sensu_check: name=rabbitmq-cluster plugin=check-rabbitmq-cluster.rb
               args="--expected 2" use_sudo=true
  notify: restart sensu-client
  when: rabbitmq.cluster

- name: rabbit queues check
  sensu_check: name=rabbitmq-queues plugin=check-rabbitmq-queues.rb
               args="--timeout 2"
               use_sudo=true
  notify: restart sensu-client

- name: set cluster count fact
  set_fact: cluster_node_count={{ groups['all'] | count }}

- name: rabbit queue num check
  sensu_check: name=rabbitmq-numqueues plugin=check-rabbitmq-queues.rb
               args="-t number -w {{ cluster_node_count|int * 50 }}
                     -c {{ cluster_node_count|int * 100 }}
                     --timeout 2"
               use_sudo=true
  notify: restart sensu-client

- name: rabbit metrics
  template: src=etc/collectd/plugins/rabbitmq.conf dest=/etc/collectd/plugins/rabbitmq.conf
  notify: restart collectd
  when: collectd is defined and collectd.enabled|bool
  tags: collectd

Add a 2 second timeout to the other rabbit check
Add a 2 second timeout to the other rabbit check

We added a 2 second timeout for checking number of queues, but didn't
add one for the general queue check. This adds it to keep things
consistent and to keep sensu/pager duty quiet.
