add PGHOST variable to env files so mk_postgres can use type local co…#792
add PGHOST variable to env files so mk_postgres can use type local co…#792robertdahlem wants to merge 2 commits intoCheckmk:masterfrom
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA. |
|
@mo-ki I see failing tests here. Do I need to change/add something? |
|
For transparency: I so far only identified the colleague responsible for this area; I made no further assessment of this PR. What I can say: You changed the function to return a 4-tuple instead of a 3-tuple, which means you will have to adjust the type hint in line 1218. I think it should be |
Done. |
|
Can this be merged? Just asking before it gets one year old. :-) |
0bde2cf to
9b7659c
Compare
9b7659c to
87aa190
Compare
|
Thanks for the contribution! Merged to master (and sorry for the delay...) |
General information
This adds an optional
PGHOSTvariable to the .env file ofmk_postgres.pyIt answers my own question at the Checkmk forum.
This is useful when connecting to databases that only LISTEN on a socket and not on a TCP port. Set
PGHOSTto a directory where the socket.s.PGSQL.$PGPORTis located and you can use connections that are configured inpg_hba.confas typelocal.In theory you could also set
PGHOSTto the name of a remote host where a database resides. This might be useful in cases where you are not allowed to install a Checkmk agent on a database machine.here is an example for monitoring a GitLab PostgreSQL instance:
postgres.sql:
gitlabhq_production.env:
Also I deleted the mentioning of
exportin the description of .env files. It created the false appearance that you could export environment variables tomk_postgres.py.