Ad Widget

Collapse

Negative deltas are not stored

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nilsh
    Junior Member
    • Dec 2010
    • 5

    #1

    Negative deltas are not stored

    Hi,
    i have an item "testitem" which both incerease and decrease over time, and i want its delta.

    i have tried it with adding a new calculated item "testitemdelta" with Formula
    Code:
    last("testitem")
    and store as delta (simple change).

    if testitem increases, testitemdelta shows its change correctly, but if testitem decreases, testitemdelta gets 0, instead of a negative value.

    how can i get correct negative delta values?
  • alixen
    Senior Member
    • Apr 2006
    • 474

    #2
    Hi,

    Originally posted by nilsh
    Hi,
    i have an item "testitem" which both incerease and decrease over time, and i want its delta.

    i have tried it with adding a new calculated item "testitemdelta" with Formula
    Code:
    last("testitem")
    and store as delta (simple change).

    if testitem increases, testitemdelta shows its change correctly, but if testitem decreases, testitemdelta gets 0, instead of a negative value.

    how can i get correct negative delta values?
    I am afraid that Zabbix will not store negative values in "delta" mode.

    Maybe you could try:
    Code:
    last("testitem") - prev("testitem")
    Make sure to use "Numeric (float)" as item type.

    Regards,
    Alixen
    http://www.alixen.fr/zabbix.html

    Comment

    • nilsh
      Junior Member
      • Dec 2010
      • 5

      #3
      Thx alixen, that works

      Comment

      • nilsh
        Junior Member
        • Dec 2010
        • 5

        #4
        ...almost.

        Now i've got some timing issues, the "testitem" value is updated in short intervals, but i need the "testitemdelta" value in much longer intervals. So last and prev values temporally too close together and when the delta is updated, it takes the shorter update interval of "testitem" to get its value, instead of the value of "testitem" the "testitemdelta"'s interval ago

        Comment

        • alixen
          Senior Member
          • Apr 2006
          • 474

          #5
          Hi,

          Originally posted by nilsh
          ...almost.

          Now i've got some timing issues, the "testitem" value is updated in short intervals, but i need the "testitemdelta" value in much longer intervals. So last and prev values temporally too close together and when the delta is updated, it takes the shorter update interval of "testitem" to get its value, instead of the value of "testitem" the "testitemdelta"'s interval ago
          You could use timeshift option of last() function:
          last("testitem") - last("testitem",0,600)
          will calculate delta for a 5 mn (600 s) interval.

          Check the manual for details

          Regards,
          Alixen
          http://www.alixen.fr/zabbix.html

          Comment

          • nilsh
            Junior Member
            • Dec 2010
            • 5

            #6
            Yes that's what i was looking for, thanks

            Comment

            Working...