From 9941f4644f60fa1bff63efd53f14d739d823e82f Mon Sep 17 00:00:00 2001 From: Ludovic Cartier Date: Fri, 14 Nov 2025 14:54:20 +0100 Subject: [PATCH] pg - add host to check port --- defaults/main.yml | 2 +- templates/nrpe.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 04a7a35..d2aa138 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -24,7 +24,7 @@ nrpe_smtp_host: localhost nrpe_eth_warning: '12M' nrpe_eth_critical: '15M' -nrpe_postgresql_host: locahost +nrpe_postgresql_host: localhost nrpe_postgresql_port: 5432 nrpe_postgresql_user: nagios nrpe_postgresql_password: changeme_ diff --git a/templates/nrpe.j2 b/templates/nrpe.j2 index 4cb6386..044ee24 100644 --- a/templates/nrpe.j2 +++ b/templates/nrpe.j2 @@ -37,7 +37,7 @@ command[check_mysql_longqueries]=/usr/lib/nagios/plugins/check_mysql_longqueries {% if nrpe_postgresql is defined %} # postgresql -command[check_pgsql_port]=/usr/lib/nagios/plugins/check_tcp -p {{ nrpe_postgresql_port }} +command[check_pgsql_port]=/usr/lib/nagios/plugins/check_tcp -p {{ nrpe_postgresql_port }} -H {{ nrpe_postgresql_host }} command[check_proc_postgresql]=/usr/lib/nagios/plugins/check_systemd_service postgresql command[check_pgsql_connection]=/usr/lib/nagios/plugins/check_postgresql -H {{ nrpe_postgresql_host }} -p {{ nrpe_postgresql_port }} --dbuser={{ nrpe_postgresql_user }} --dbpass={{ nrpe_postgresql_password }} --action=connection command[check_pgsql_backends]=/usr/lib/nagios/plugins/check_postgresql -H {{ nrpe_postgresql_host }} -p {{ nrpe_postgresql_port }} --dbuser={{ nrpe_postgresql_user }} --dbpass={{ nrpe_postgresql_password }} --action=backends -w {{ nrpe_postgresql_backend_warning }} -c {{ nrpe_postgresql_backend_critical }}