Ad Widget

Collapse

Housekeeper problems - manual cleanup?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cviper40
    Junior Member
    • Oct 2011
    • 5

    #16
    Hi Julian.

    I have the same problem that you reported. I got housekeeper enabled but it does not work.

    Can you have any advise ?

    PD: zabbix 1.8

    Comment

    • Colttt
      Senior Member
      Zabbix Certified Specialist
      • Mar 2009
      • 878

      #17
      here an example to delete all items older than 180 days.. in postgreSQL

      Code:
      delete FROM history where age(to_timestamp(history.clock)) > interval '180 days'; 
      delete FROM history_uint where age(to_timestamp(history_uint.clock)) > interval '180 days' ;
      delete FROM history_str  where age(to_timestamp(history_str.clock)) > interval '180 days' ;
      delete FROM history_text where age(to_timestamp(history_tex.clock)) > interval '180 days' ;
      delete FROM history_log where age(to_timestamp(history_log.clock)) > interval '180 days' ;
      delete FROM trends_uint where age(to_timestamp(trends_uint.clock)) > interval '180 days' ;
      delete FROM trends where age(to_timestamp(trends.clock)) > interval '180 days';
      Last edited by Colttt; 28-10-2011, 08:26.
      Debian-User

      Sorry for my bad english

      Comment

      • denaum
        Junior Member
        • Mar 2011
        • 7

        #18
        doubt

        do I need to stop the database to execute this commands?

        tks

        Comment

        • mkhon
          Junior Member
          • Sep 2022
          • 1

          #19
          I have created a script that does batched DELETE as history_uint and trends_uint tables could be quite big (I have about 1B records in history_uint):

          Force zabbix housekeeping with batched DELETE. Sample use: PGPASSWORD=password ./zabbix_housekeeping.sh history history_str history_text history_log history_uint trends trends_uint" - zabbix_h...

          Comment

          Working...