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
Line 10: Line 10:
Stats data under '''"/opt/zimbra/zmstat"''' taking large disk space.  
Stats data under '''"/opt/zimbra/zmstat"''' taking large disk space.  


By default
ZCS server never purges the stats data, and retention for zmstats is controlled by the localconfig key '''"zmstat_max_retention"'''.  
ZCS server never purges the stats data, and retention for zmstats is controlled by the localconfig key '''"zmstat_max_retention"'''.  



Revision as of 08:47, 25 August 2021

How to purge old zmstats data?


   KB 24344        Last updated on 2021-08-25  




0.00
(0 votes)

Problem

Stats data under "/opt/zimbra/zmstat" taking large disk space.

ZCS server never purges the stats data, 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.
zimbra@mail:~$


With the help of the following commands, we can keep zmstats data of selected day's without changing localconfig key.

Syntax:

/opt/zimbra/libexec/zmstat-cleanup -k "keep count" 


Example:

Keep zmstats data of 300 days.

/opt/zimbra/libexec/zmstat-cleanup -k 300 


Submitted by: Heera Singh Koranga
Verified Against: Date Created:
Article ID: https://wiki.zimbra.com/index.php?title=Purge_old_zmstats_data Date Modified: 2021-08-25



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »


Jump to: navigation, search