2017-11-26 19:30:24 +01:00
|
|
|
---
|
|
|
|
|
2021-05-02 01:14:06 +02:00
|
|
|
- name: python-requests is installed (check_rabbitmq dependency)
|
2017-11-26 19:30:24 +01:00
|
|
|
apt:
|
|
|
|
name: python-requests
|
2018-05-18 09:33:25 +02:00
|
|
|
state: present
|
2021-09-30 17:05:10 +02:00
|
|
|
when: ansible_python_version is version('3', '<')
|
2021-05-02 01:14:06 +02:00
|
|
|
|
|
|
|
- name: python3-requests is installed (check_rabbitmq dependency)
|
|
|
|
apt:
|
|
|
|
name: python3-requests
|
|
|
|
state: present
|
2021-09-30 17:05:10 +02:00
|
|
|
when: ansible_python_version is version('3', '>=')
|
2017-11-26 19:30:24 +01:00
|
|
|
|
2017-11-28 10:43:15 +01:00
|
|
|
- include_role:
|
2019-11-29 14:00:25 +01:00
|
|
|
name: evolix/remount-usr
|
2017-11-28 10:43:15 +01:00
|
|
|
|
2017-11-26 19:30:24 +01:00
|
|
|
# https://raw.githubusercontent.com/CaptPhunkosis/check_rabbitmq/master/check_rabbitmq
|
|
|
|
- name: check_rabbitmq is installed
|
|
|
|
copy:
|
|
|
|
src: check_rabbitmq
|
|
|
|
dest: /usr/local/lib/nagios/plugins/check_rabbitmq
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0755"
|
|
|
|
force: yes
|
2022-08-01 17:43:00 +02:00
|
|
|
when: ansible_distribution_major_version is version('11', '<=')
|
|
|
|
|
|
|
|
- name: check_rabbitmq (Python 3 version) is installed
|
|
|
|
copy:
|
|
|
|
src: check_rabbitmq.python3
|
|
|
|
dest: /usr/local/lib/nagios/plugins/check_rabbitmq
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0755"
|
|
|
|
force: yes
|
|
|
|
when: ansible_distribution_major_version is version('11', '==')
|
2017-11-26 19:30:24 +01:00
|
|
|
|
|
|
|
- name: check_rabbitmq is available for NRPE
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/nagios/nrpe.d/evolix.cfg
|
|
|
|
regexp: 'command\[check_rab_connection_count\]'
|
|
|
|
line: 'command[check_rab_connection_count]=sudo /usr/local/lib/nagios/plugins/check_rabbitmq -a connection_count -C {{ rabbitmq_connections_critical }} -W {{ rabbitmq_connections_warning }}'
|
|
|
|
notify: restart nagios-nrpe-server
|
|
|
|
|
|
|
|
- name: sudo without password for nagios
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/sudoers.d/evolinux
|
|
|
|
regexp: 'check_rabbitmq'
|
|
|
|
line: 'nagios ALL = NOPASSWD: /usr/local/lib/nagios/plugins/check_rabbitmq'
|
|
|
|
insertafter: '^nagios'
|
|
|
|
validate: "visudo -cf %s"
|