From d414d516bee264489764ac9b49f01c02ccf18efe Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 7 Mar 2017 16:36:06 +0100 Subject: [PATCH] library/roles/nagios/templates/postgresql-nrpe.cfg.j2: Do not fail when psql_db_data is not defined. --- nagios/templates/postgresql-nrpe.cfg.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nagios/templates/postgresql-nrpe.cfg.j2 b/nagios/templates/postgresql-nrpe.cfg.j2 index fd2e56af..03623906 100644 --- a/nagios/templates/postgresql-nrpe.cfg.j2 +++ b/nagios/templates/postgresql-nrpe.cfg.j2 @@ -13,6 +13,7 @@ command[{{ monitoring_group_name }}_check_postgresql_commitratio]=/usr/bin/sudo command[{{ monitoring_group_name }}_check_postgresql_database_size]=/usr/bin/sudo -u postgres /usr/bin/check_postgres_database_size -db template1 -w {{ nagios_psql_db_size_w }} -c {{ nagios_psql_db_size_c }} +{% if psql_db_data is defined %} {% for db in psql_db_data %} command[{{ monitoring_group_name }}_check_postgresql_{{ db.name }}_query]=/usr/bin/sudo -u postgres /usr/bin/check_postgres_query_time -db {{ db.name }} -w {{ nagios_psql_query_time_w }} -c {{ nagios_psql_query_time_c }} @@ -20,3 +21,5 @@ command[{{ monitoring_group_name }}_check_postgresql_{{ db.name }}_dbstats]=/usr command[{{ monitoring_group_name }}_check_postgresql_{{ db.name }}_sequence]=/usr/bin/sudo -u postgres /usr/bin/check_postgres_sequence -t 520 -db {{ db.name }} {% endfor %} +{% endif %} +