library/roles/nagios/templates/postgresql-nrpe.cfg.j2: Do not fail when psql_db_data is not defined.

This commit is contained in:
Andrea Dell'Amico 2017-03-07 16:36:06 +01:00
parent f8254e1a82
commit d414d516be
1 changed files with 3 additions and 0 deletions

View File

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