]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
long_running_cluster: Create tasks to install ceph-nagios-plugins
authorDavid Galloway <dgallowa@redhat.com>
Thu, 31 Aug 2017 23:26:51 +0000 (19:26 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Wed, 28 Mar 2018 15:23:45 +0000 (11:23 -0400)
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/long_running_cluster/tasks/nagios.yml [new file with mode: 0644]

diff --git a/roles/long_running_cluster/tasks/nagios.yml b/roles/long_running_cluster/tasks/nagios.yml
new file mode 100644 (file)
index 0000000..7f6f517
--- /dev/null
@@ -0,0 +1,27 @@
+---
+- name: Clone ceph-nagios-plugins on MON nodes
+  git:
+    repo: https://github.com/ceph/ceph-nagios-plugins.git
+    dest: "{{ nagios_plugins_directory }}/ceph-nagios-plugins"
+    update: yes
+
+- name: Make install ceph-nagios-plugins
+  shell: "cd /tmp/ceph-nagios-plugins && make libdir={{ nagios_plugins_directory|replace('/nagios/plugins', '') }} install"
+
+- name: Check for nagios ceph keyring
+  stat:
+    path: /etc/ceph/client.nagios.keyring
+  register: nagios_keyring
+
+- name: Create nagios ceph keyring
+  shell: "ceph auth get-or-create client.nagios mon 'allow r' > /etc/ceph/client.nagios.keyring && chown ceph:ceph /etc/ceph/client.nagios.keyring"
+  when: nagios_keyring.stat.exists == false
+
+- name: Write nrpe config for ceph health checks
+  lineinfile:
+    dest: /etc/nagios/nrpe_local.cfg
+    regexp: '.*check_ceph_health.*'
+    line: "command[check_ceph_health]={{ nagios_plugins_directory }}/check_ceph_health --name client.nagios -k /etc/ceph/client.nagios.keyring --whitelist 'failing to respond to cache pressure|requests are blocked'"
+    state: present
+    create: yes
+  notify: restart nagios-nrpe-server