Ad Widget

Collapse

Extract data from database to csv file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jean
    Member
    • Apr 2006
    • 85

    #1

    Extract data from database to csv file

    Hello,

    We must extract the data from Zabbix database into a csv file. I find the solution for the extraction of the "trends" value for "simple" data stored, but for the data stored in delta such the bandwith of the Linux interface, I don't find yet the solution.

    This is my mysql request :

    mysql -uUSER -pPASSWORD --batch --silent -e "SELECT CONCAT( hosts.host, ';', trends_uint.value_avg, ';', FROM_UNIXTIME(trends_uint.clock) ) FROM DATABASE.hosts,DATABASE.items,DATABASE.trends_uint WHERE hosts.hostid=items.hostid AND trends_uint.itemid=items.itemid AND items.description = 'ITEM_DESCRIPTION' AND hosts.host = 'HOSTNAME' ORDER BY trends_uint.clock ASC"
    Someone has an idea why this don't work for all values stored in delta ?
  • JBo
    Senior Member
    • Jan 2011
    • 310

    #2
    Hi,

    You are only extracting data from trends_uint table.

    I guess that missing data are in trends table.

    Hope this helps.
    JBo

    Comment

    • jean
      Member
      • Apr 2006
      • 85

      #3
      Hello,

      Thank you for your answer, but I do the same test in the trends table, but no data found.
      The question is where or how the delta data are recorded in the database ?

      Comment

      • JBo
        Senior Member
        • Jan 2011
        • 310

        #4
        Hi,

        There is no specific table for delta records.
        They are stored in same tables as non delta (history, history_uint, trends, trends_uint for all numeric items).

        I just checked in my zabbix DB.
        I have values in trends table for items defined as 'Delta (speed per second)".

        Regards,
        JBo

        Comment

        • jean
          Member
          • Apr 2006
          • 85

          #5
          Hello,

          I will check again.

          Regards

          Jean

          Comment

          • jean
            Member
            • Apr 2006
            • 85

            #6
            Hello,

            Shame on me, in my item description I used interface $1 and in my mysql request I used eth0... Sorry

            Regards

            Comment

            Working...