Purge old zmstats data: Difference between revisions
(Created page with "{{BC|Certified}} __FORCETOC__ <div class="col-md-12 ibox-content"> =How to purge old zmstats data? = <hr> {{KB|{{WIP}}|{{ZCS 9.0}}|{{ZCS 8.8}}|{{ZCS 8.7}}|{{ZCS 8.6}}|{{ZCS 8....") |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 8: | Line 8: | ||
====Problem==== | ====Problem==== | ||
Stats data under '''"/opt/zimbra/zmstat"''' taking large disk space. | Stats data under '''"/opt/zimbra/zmstat"''' is taking large disk space. | ||
ZCS server does not purge the stats data automatically, and retention for zmstats is controlled by the localconfig key ''"zmstat_max_retention"'''. | |||
ZCS server | |||
By default '''zmstat_max_retention''' is set to 0 (zero), and because of that '''"zmstat-cleanup"''' command is giving following warning. | By default '''zmstat_max_retention''' is set to 0 (zero), and because of that '''"zmstat-cleanup"''' command is giving following warning. | ||
Line 31: | Line 30: | ||
-p|--purge Purge ALL archived zmstats data. | -p|--purge Purge ALL archived zmstats data. | ||
To keep zmstats data of a time period without changing the localconfig key, run: | |||
'''Syntax:''' | '''Syntax:''' | ||
/opt/zimbra/libexec/zmstat-cleanup - | /opt/zimbra/libexec/zmstat-cleanup --keep <span style="color:lime">"<number of days>"</span> | ||
'''Example:''' | '''Example:''' | ||
Keep zmstats data of 300 days. | Keep zmstats data of 300 days. | ||
/opt/zimbra/libexec/zmstat-cleanup --keep 300 | |||
/opt/zimbra/libexec/zmstat-cleanup - | |||
Revision as of 10:02, 1 September 2021
How to purge old zmstats data?
Problem
Stats data under "/opt/zimbra/zmstat" is taking large disk space.
ZCS server does not purge the stats data automatically, and retention for zmstats is controlled by the localconfig key "zmstat_max_retention"'.
By default zmstat_max_retention is set to 0 (zero), and because of that "zmstat-cleanup" command is giving following warning.
zimbra@mail:~$ /opt/zimbra/libexec/zmstat-cleanup WARNING: zmstat_max_retention is set to 0 or is undefined. No zmstat data has been pruned. zimbra@mail:~$
Solution
These are the available options with the zmstat-cleanup.
zimbra@mail:~$ /opt/zimbra/libexec/zmstat-cleanup -h Usage: /opt/zimbra/libexec/zmstat-cleanup [-k <keep count>] [-h] [-l] [-p] -h|--help Help/usage information -k|--keep Number of archived copies of zmstat data to retain. -l|--list Generate a listing of log dates archived. -p|--purge Purge ALL archived zmstats data.
To keep zmstats data of a time period without changing the localconfig key, run:
Syntax:
/opt/zimbra/libexec/zmstat-cleanup --keep "<number of days>"
Example:
Keep zmstats data of 300 days.
/opt/zimbra/libexec/zmstat-cleanup --keep 300
Submitted by: Heera Singh Koranga |