Ludovic Poujol
1f52700b47
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good
Also some cleanup & split of tasks between single and multi instance Note: Munin part seems still broken at the time
50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
---
|
|
|
|
- name: Is nrpe present ?
|
|
stat:
|
|
path: /etc/nagios/nrpe.d/evolix.cfg
|
|
register: nrpe_evolix_config
|
|
|
|
- block:
|
|
- name: Install dependencies
|
|
apt:
|
|
name:
|
|
- libcache-memcached-perl
|
|
- libmemcached11
|
|
|
|
- include_role:
|
|
name: evolix/remount-usr
|
|
|
|
- name: Copy Nagios check for memcached
|
|
copy:
|
|
src: check_memcached.pl
|
|
dest: /usr/local/lib/nagios/plugins/
|
|
mode: "0755"
|
|
|
|
- name: install check_memcached_instances
|
|
copy:
|
|
src: check_memcached_instances.sh
|
|
dest: /usr/local/lib/nagios/plugins/check_memcached_instances
|
|
force: yes
|
|
mode: "0755"
|
|
owner: root
|
|
group: root
|
|
|
|
- name: Add NRPE check (single instance)
|
|
lineinfile:
|
|
name: /etc/nagios/nrpe.d/evolix.cfg
|
|
regexp: '^command\[check_memcached\]='
|
|
line: 'command[check_memcached]=/usr/local/lib/nagios/plugins/check_memcached.pl -H 127.0.0.1 -p {{ memcached_port }}'
|
|
notify: restart nagios-nrpe-server
|
|
when: memcached_instance_name is undefined
|
|
|
|
- name: Add NRPE check (multi instance)
|
|
lineinfile:
|
|
name: /etc/nagios/nrpe.d/evolix.cfg
|
|
regexp: '^command\[check_memcached\]='
|
|
line: 'command[check_memcached]=/usr/local/lib/nagios/plugins/check_memcached_instances'
|
|
notify: restart nagios-nrpe-server
|
|
when: memcached_instance_name is defined
|
|
|
|
when: nrpe_evolix_config.stat.exists
|