Ad Widget

Collapse

How to set zabbix to delete old data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • przemo2
    Junior Member
    • Oct 2020
    • 23

    #1

    How to set zabbix to delete old data

    Friends, help me, zabbix has been with me for a year and has clogged the entire disk, how to delete old data and set zabbix so that it cleans data older than a month
    Click image for larger version

Name:	Screen Shot 01-23-22 at 03.10 PM.png
Views:	22566
Size:	5.9 KB
ID:	438524
  • KPiatek
    Junior Member
    • Jan 2022
    • 5

    #2
    You should find it under Administration -> General -> Housekeeping. Additionally, if you are using PostgreSQL you might want to think about TimescaleDB.

    Comment

    • pala
      Junior Member
      • Sep 2021
      • 4

      #3
      Hi, in my case, I set a script in crontab in order to purge old data manually:

      DELETE FROM history WHERE clock < a date
      commit;
      analyze table history;
      DELETE FROM history_str WHERE clock < a date
      commit;
      analyze table history_str;
      DELETE FROM history_uint WHERE clock < a date
      commit;
      analyze table history_uint;

      #"REDO"
      PURGE BINARY LOGS BEFORE DATE_SUB( NOW( ), INTERVAL 7 DAY);

      In addition, I have a item to get everyday the database size.

      I got this from forums

      Regards



      Comment

      • przemo2
        Junior Member
        • Oct 2020
        • 23

        #4
        Hey buddy, it seems your commands are helpful because the above ones don't work. But I have such a problem with DELETE FROM history_uint
        I get such an error lock wait timeout exceeded try restarting transaction


        it helped just don't know what's the difference ...

        truncate table history;
        truncate table history_str;
        truncate table history_uint;
        truncate table trends;
        truncate table trends_uint;
        truncate table events;



        Can someone explain why it doesn't work?
        Administration -> General -> Housekeeping.

        Database : MySQL
        Last edited by przemo2; 01-02-2022, 01:32.

        Comment

        Working...