Ad Widget

Collapse

Cleaning all history

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jsomoza
    Junior Member
    • Mar 2008
    • 27

    #1

    Cleaning all history

    Hi everybody,

    A week ago, almost all of my zabbix items stopped getting data. I figured out that by selecting and item and using the Clean history selected items option, it starts working again.

    The problem is that doing it this way, I'll probably last a month to clean history of all items, so, is there any way to do it manually? Any command to do it faster? Which could be the reason of that failure?

    Thanks beforehand.
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    You can do a bulk cleanup from the items configuration screen. Select all the items you want to clean up then scroll to the bottom and select "Clean history selected items".

    However have you tried to disable/enable the item in question? Have you also tried to stop/restart the zabbix server? I have found in the rare cases where an item get's stuck disable/enable will likely fix it, and if that does not work a stop/restart will usually fix the problem.
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • jsomoza
      Junior Member
      • Mar 2008
      • 27

      #3
      First of all, thanks for replying nelsonab.

      By selecting all items and then "Clean history selected items", the problem remains the same. It lasts too much.

      I've also tried to disable/enable the item and also to restart zabbix, which has worked to me a lot of times, but nothing really happens.

      Any other suggestion?

      Thanks.

      Comment

      • nelsonab
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2006
        • 1233

        #4
        How comfortable are you with some MySQL queries?

        If you feel comfortable enough try the following query:

        Code:
        select type, description, key_, delay, from_unixtime(nextcheck),lastvalue, from_unixtime(lastclock),prevvalue, status, delta, now() as cur_time from items where itemid=<Item ID Here>;
        You will need to know one itemid in question. If you want to check for a list of item id's replace the where clause with:
        Code:
        where itemid in (id1,id2,id3,id4)
        This will show you when the item was last checked and when it's due to be checked again, along with the current time according to MySQL.
        RHCE, author of zbxapi
        Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
        Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

        Comment

        • jsomoza
          Junior Member
          • Mar 2008
          • 27

          #5
          Hi,

          We fixed it up. It was a parameter in zabbix server which tells zabbix when next update has to be. It was set to 12 and it has to be zero.

          Thanks!

          Comment

          Working...