From ae17604335ea249a01f9fc5904d827f6ff6ccb8b Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 27 Jun 2017 16:04:02 +0200 Subject: [PATCH] library/roles/smartgears/resource_checker_se_plugin/templates/check_missing_resources.sh.j2: Go to critical if the resources file is older than two hours. It means that the service is not working. --- .../templates/check_missing_resources.sh.j2 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/smartgears/resource_checker_se_plugin/templates/check_missing_resources.sh.j2 b/smartgears/resource_checker_se_plugin/templates/check_missing_resources.sh.j2 index 2481e020..4c2c0c7c 100644 --- a/smartgears/resource_checker_se_plugin/templates/check_missing_resources.sh.j2 +++ b/smartgears/resource_checker_se_plugin/templates/check_missing_resources.sh.j2 @@ -3,6 +3,13 @@ COMMON_SH_LIB={{ nagios_isti_plugdir }}/check_library.sh RESOURCES_STATUS_FILE={{ smartgears_user_home }}/missing_resources/identifiers +# First things first: check if the service is running +RUNNING_FILE=$( find /{{ smartgears_user_home }}/missing_resources/identifiers -mmin -120 ) +if [ -z $RUNNING_FILE ] ; then + echo "CRITICAL - The resource checker did not update for more than two hours" + exit $NAGIOS_CRITICAL +fi + if [ -f $COMMON_SH_LIB ] ; then . $COMMON_SH_LIB else