Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to monitor pg log? postgresql log iteam failed. #38

Open
lishengxian opened this issue Mar 16, 2017 · 3 comments
Open

how to monitor pg log? postgresql log iteam failed. #38

lishengxian opened this issue Mar 16, 2017 · 3 comments

Comments

@lishengxian
Copy link

HI all

zabbix agent don't have permission to access the pg log. because the $PGDATA need the 700 permission. anyone face the same issue?

@knih
Copy link

knih commented Mar 16, 2017

You can use a different directory.

# mv ${PGDATA}/pg_log /var/log/postgres
# chmod 0755 /var/log/postgres
# ln -s /var/log/postgres ${PGDATA}/pg_log
# chown -h postgres.postgres ${PGDATA}/pg_log

{$PGLOGDIR} => /var/log/postgres

And then, give the zabbix user read permission such as:

log_file_mode = 0644

@lishengxian
Copy link
Author

Thank you @knih

@blogh
Copy link

blogh commented Sep 27, 2017

This is not supported by PostgreSQL. The only symlink allowed in $PGDATA is pg_xlog (now called pg_wal).

You should use the GUC: log_directory (if you use the logging collector).
https://www.postgresql.org/docs/9.5/static/runtime-config-logging.html#GUC-LOG-DIRECTORY

btw: thx for the software :)

EDIT: Not supported is probably a bit strong (I cannot find where I read this)... Still looking for it :)
EDIT2: user symlinks (not pg_tblspc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants