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 %} +