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

Documenting operational tasks #8

Open
vasekch opened this issue May 8, 2018 · 1 comment
Open

Documenting operational tasks #8

vasekch opened this issue May 8, 2018 · 1 comment

Comments

@vasekch
Copy link

vasekch commented May 8, 2018

It'd be great to have README improved with what are common operational tasks. I'm willing to create a PR if someone can confirm my thoughts.

Partitions needs to be present before data INSERT:
To deal with that, run provision command regularly.
SELECT zbx_provision_partitions('history', 'day', 14); should be run at least each 13 days. Each 7 days seems more sensible, but why not to run it daily.

Drop partitions older than 14 days:
To substitute zabbix built-in housekeeper (reason why most people partition) run drop partitions regularly.
SELECT zbx_drop_old_partitions('history', SELECT (NOW() - INTERVAL '2 weeks')::DATE::TIMESTAMP); It's also ok to run daily.

Set recurring tasks in cron
Above SQL commands can be set to run periodically e.g. using cron with record like
0 3 * * * echo '<SQL_command>' | PGOPTIONS='--client-min-messages=warning' PGPASSWORD=<zabbix_db_password> psql -U zabbix -d zabbix --quiet
(run every night at 3 am, avoid NOTICE messages being reported as cron errors)

@cavaliercoder
Copy link
Collaborator

PR is very welcomed! Also, if you wanted to write up a blog post or something, I could link to it from the readme.

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

2 participants