Add a nagios NRPE handler to restart the tomcat instance when it dies.

This commit is contained in:
Andrea Dell'Amico 2017-08-28 19:46:16 +02:00
parent 0dc8227536
commit defbf77503
2 changed files with 11 additions and 0 deletions

View File

@ -121,3 +121,10 @@
service: name='tomcat-instance-{{ smartgears_http_port }}' state=restarted
when: smartgears_force_restart is defined and smartgears_force_restart
tags: [ 'smartgears', 'smartgears_conf', 'tomcat' ]
- name: Install the Nagios NRPE configuration for smartgears
template: src=smartgears-nrpe.cfg.j2 dest=/etc/nagios/nrpe.d/smartgears-nrpe.cfg owner=root group=root mode=444
notify: Reload NRPE server
when: nagios_enabled
tags: [ 'smartgears', 'smartgears_nrpe', 'nagios', 'nagios_nrpe' ]

View File

@ -0,0 +1,4 @@
# Restart SmartGears (via handler)
command[global_restart_smartgears]=/usr/bin/sudo /etc/init.d/tomcat-instance-{{ smartgears_http_port }} start