Ad Widget

Collapse

Selecting historical data from zabbix 1.8 database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • waardd
    Member
    • Aug 2014
    • 82

    #1

    Selecting historical data from zabbix 1.8 database

    I'm trying to select data from de zabbix database to export to a file for using in fr instance excel.
    But i get no historical data.
    I use Workbench to select data like so:

    select * from zabbix.hosts where host like 'lsrv1790%';

    This results in 10184
    select * from zabbix.items where hostid = '10184';

    I see all items and choose 41479
    select * from zabbix.history where itemid = '41479';

    This last one returns no rows. And i know for sure there must be data because i can see it in the zabbix graph.

    Where is my data gone to???
  • ingus.vilnis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2014
    • 908

    #2
    Hi,

    The historical data are kept in multiple tables depending on the item type (numeric, text, etc.)

    Check if historical values are in any of these tables:
    • history
    • history_uint
    • history_text
    • history_log
    • history_str
    • trends
    • trends_uint


    Best Regards,
    Ingus

    Comment

    • waardd
      Member
      • Aug 2014
      • 82

      #3
      Tnx i found it in zabbix.history_uint
      Now i can make more extensive reports for management.

      Comment

      • waardd
        Member
        • Aug 2014
        • 82

        #4
        Now a slightly different question.
        When i want this historical data from 1-1-205 00:00:00 to 31-1-2015 23:59:59, how do i select this.

        Clock format is Unix so i think vallues are:
        31-1-2015 23:59 3631884830
        1-1-2015 0:00 3629206431

        I thought like so:
        select * from zabbix.history_uint where itemid = '39276' AND clock > 3629206431 OR clock < 3631884830 ORDER BY clock DESC limit 2500

        But i think i'm making a basic mistake....

        Comment

        • waardd
          Member
          • Aug 2014
          • 82

          #5
          Indeed a basic mistake

          select * from zabbix.history_uint where itemid = '39276' AND (clock > 3629206431 OR clock < 3631884830) ORDER BY clock DESC limit 2500

          Comment

          Working...