Ad Widget

Collapse

Zabbix Database - Multiple entries for same timestamp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vapochilled
    Junior Member
    • Nov 2013
    • 17

    #1

    Zabbix Database - Multiple entries for same timestamp

    Hello Zabbix Warriors,

    I have one tricky situation.
    Most of our items use zabbix_sender script with timestamp.
    Most of those senders run over .txt files generated from SQL queries.
    These queries run for current_time-5hours (backwards).
    So for example, if I run the query at 12:00, I will get something like:

    eg. (unix timestamp is per hour and the numbers here are just example)

    host key timestamp value
    xpto nr_files 1111111111 16 ---> 9am
    xpto nr_files 1211111111 16
    xpto nr_files 1311111111 16
    xpto nr_files 1411111111 16 ---> 12:00



    If then I run the query at 13:00... then I will have
    host key timestamp value
    xpto nr_files 1211111111 16
    xpto nr_files 1311111111 16
    xpto nr_files 1411111111 16
    xpto nr_files 1511111111 16 --> 13:00



    We run the query 5 hours backwards because our system might receive old data.
    So for example at 14:00 I can have:
    host key timestamp value
    xpto nr_files 1311111111 20 --> 11:00 (value was updated)
    xpto nr_files 1411111111 16
    xpto nr_files 1511111111 16
    xpto nr_files 1611111111 16 --> 14:00



    The doubt starts here:
    - Im sending for the same host, same key, same timestamp a different value.
    - however if I go to zabbix database, I can see that instead of performing one update sql (updating the previous value) he did a new insert.
    - so I will see 2 values : 16 and 20, for the same host, same item id, etc.
    What I did noticed is that the ns column is different. So, itemid, clock are equal.

    How can I force an update instead of one new insert?
    Im sending the same unix timestamp... so... ?!? How to handle this?



    My 2nd doubt is....
    Because of these multiple entries... when I run the Zabbix API item.get he will return of the values from the database. So for example... he might return the 16... or the 20... And.. if I had 5 values for the same timeclock... he will return one of them (that might not be the last one).


    I think that solving the 1st question (updating instead of new insert) might help solving the last doubt.



    Thank you Zabbix Masters



    The database that I am monitoring ... sometimes doesn't have the correct value
  • Vapochilled
    Junior Member
    • Nov 2013
    • 17

    #2
    bump! Need to fix this

    Comment

    Working...