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:
Ludovic Poujol 2017-09-27 18:41:21 +02:00
parent 7fa2dcbb28
commit eab2c3946a
3 changed files with 29 additions and 0 deletions

View file

@ -8,3 +8,8 @@
service:
name: munin-node
state: restarted
- name: restart nagios-nrpe-server
service:
name: nagios-nrpe-server
state: restarted

View file

@ -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

View 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