checkmk icon indicating copy to clipboard operation
checkmk copied to clipboard

fix postgres check to work when postgres is running in docker container

Open hatzfdaSICKAG opened this issue 2 years ago • 2 comments

With the current state of mk_postgres.py, we had warnings in checkmk that the database could not be found due it running in a docker container. As a workaround we had to add the host environment variable "PGHOST=127.0.0.1".

The proposed changes make it possible to add the PGHOST variable directly to the .env file that is parsed by the script and not having to set the environment variable globally anymore. It works similar to how the variables pg_version or pg_host get parsed and given over to the psql command as additional arguments: pg_host is set in the code with the "-h" flag, like e.g. pg_port is set with the "-p" flag.

These changes are only implemented and tested for Linux.

hatzfdaSICKAG avatar Nov 21 '23 13:11 hatzfdaSICKAG

This PR is stale because it has been open for 14 days with no activity and the Github Actions are not passing.

github-actions[bot] avatar Jun 14 '24 01:06 github-actions[bot]

This PR is stale because it has been open for 14 days with no activity and the Github Actions are not passing.

github-actions[bot] avatar Jul 04 '24 01:07 github-actions[bot]

This PR was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Jul 18 '24 01:07 github-actions[bot]