Redis: On stretch, make sure nrpe will use check_redis instead of check_tcp
check_redis was added in nagios-plugins-contrib in strech.
This commit is contained in:
parent
7fa2dcbb28
commit
eab2c3946a
|
@ -8,3 +8,8 @@
|
|||
service:
|
||||
name: munin-node
|
||||
state: restarted
|
||||
|
||||
- name: restart nagios-nrpe-server
|
||||
service:
|
||||
name: nagios-nrpe-server
|
||||
state: restarted
|
||||
|
|
|
@ -34,3 +34,12 @@
|
|||
|
||||
- include: munin.yml
|
||||
when: _munin_installed.stat.exists and _munin_installed.stat.isdir
|
||||
|
||||
- name: is NRPE present ?
|
||||
stat:
|
||||
path: /etc/nagios/nrpe.d/evolix.cfg
|
||||
check_mode: no
|
||||
register: nrpe_evolix_config
|
||||
|
||||
- include: nrpe_stretch.yml
|
||||
when: ansible_distribution_release == "stretch" and nrpe_evolix_config == true
|
||||
|
|
15
redis/tasks/nrpe_stretch.yml
Normal file
15
redis/tasks/nrpe_stretch.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
- name: Install perl lib-redis (needed by check_redis)
|
||||
apt:
|
||||
name: libredis-perl
|
||||
state: present
|
||||
tags:
|
||||
- redis
|
||||
- nrpe
|
||||
|
||||
- name: Replace check_tcp by check_redis for NRPE
|
||||
replace:
|
||||
dest: /etc/nagios/nrpe.d/evolix.cfg
|
||||
regexp: '^command\[check_redis\]=\/usr\/lib\/nagios\/plugins\/check_tcp -p 6379'
|
||||
replace: 'command[check_redis]=/usr/lib/nagios/plugins/check_redis -H 127.0.0.1'
|
||||
notify: restart nagios-nrpe-server
|
Loading…
Reference in a new issue