From 1fd205a3836bcfea1fdac62ac7ca386e627c8d83 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 27 Jun 2017 20:01:24 +0200 Subject: [PATCH] library/roles/orientdb: Add a nagios handler to restart the service after it dies. See https://support.d4science.org/issues/8858 --- orientdb/tasks/main.yml | 8 ++++++++ orientdb/templates/orientdb-nrpe.cfg.j2 | 3 +++ 2 files changed, 11 insertions(+) create mode 100644 orientdb/templates/orientdb-nrpe.cfg.j2 diff --git a/orientdb/tasks/main.yml b/orientdb/tasks/main.yml index 2e7017f9..f96b686e 100644 --- a/orientdb/tasks/main.yml +++ b/orientdb/tasks/main.yml @@ -64,6 +64,14 @@ notify: Restart orientdb tags: [ 'orientdb', 'orientdb_config' ] + - name: Install the nagios nrpe configuration + template: src=orientdb-nrpe.cfg.j2 dest={{ nrpe_include_dir }}/orientdb-nrpe.cfg owner=root group=root mode=0444 + notify: Reload NRPE server + when: + - nrpe_include_dir is defined + - nagios_enabled is defined and nagios_enabled + tags: [ 'orientdb', 'orientdb_nagios' ] + - name: Ensure that the service is enabled and running service: name=orientdb state=started enabled=yes when: orientdb_enabled diff --git a/orientdb/templates/orientdb-nrpe.cfg.j2 b/orientdb/templates/orientdb-nrpe.cfg.j2 new file mode 100644 index 00000000..09d14d39 --- /dev/null +++ b/orientdb/templates/orientdb-nrpe.cfg.j2 @@ -0,0 +1,3 @@ + +# Restart orientdb (via handler) +command[global_restart_orientdb]=/usr/bin/sudo /etc/init.d/orientdb restart