[Solved] zabbix Monitor postgres Error: “sh:psql command not found”

1. Error: “sh:psql command not found”

2. How to Solve

After investigation, it is because the postgres installation directory is under /home/, and the zabbix user monitoring causes insufficient permissions.

Note: Do not try to modify the permissions with: chmod,chown, that is useless, I have tested it

3. solution:

Put the postgres installation directory in a directory other than /home, usually it can be put in the /usr/local directory, and then authorize the soft connection and it is OK, the data storage directory is not required.

mv /home/postgres/postgres-13  /usr/local/

ln -s //usr/local/postgres-13/bin/psql /bin/psql

The rest of the environment variables can be modified by yourself, so I won't explain them.

Similar Posts: