Ad Widget

Collapse

How to manage the synchronization of two items

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ckone35
    Junior Member
    • Aug 2013
    • 3

    #1

    How to manage the synchronization of two items

    Hi community,

    In my company, our goal is to use Zabbix to monitoring our webservices. Our first need is to get the average execution time over the last 5 minutes of each webservice. For this, we send for each webservices 2 items trapper every 30 seconds. The first push the total number of invocation of the webservice and the second the total execution time. These two items are synchronized (push togheter), so they have the same time in zabbix server. They are stored in delta (single change).

    Their names :
    Code:
    myWS_SumTime_last
    myWS_SumInvoc_last
    So I started writing an calculated item as follows:

    Code:
    sum ("myWS_SumTime_last", 5m) 
        / 
    sum ("myWS_SumInvoc_last", 5m)
    I forgot the division by zero problem so, I modified the item to :

    Code:
    sum("myWS_SumTime_last",5m) 
        / 
    (sum("myWS_SumInvoc_last",5m) + count(sum("myWS_SumInvoc_last",5m),#1,0))
    then I saw that nested functions not seem to work , I create a calculated item :
    Code:
    myWS_SumInvoc_5m = sum("myWS_SumInvoc_last",5m)
    and I modified my expression :
    Code:
    sum("myWS_SumTime_last",5m) 
        / 
    (last("myWS_SumInvoc_5m") + count("myWS_SumInvoc_5m",#1,0) )
    Unfortunately it still does not work because I get errors in the results because myWS_SumTime_last and myWS_SumInvoc_5m are not synchronized .

    For example, if I have two calls of myWS in the last 5 minutes ( 500ms and 1000ms ) myWS_SumInvoc_5m may not have seen the second yet. The result of the calculation is:
    Code:
    (500 + 1000) / 1 = 1500
    instead of
    (500 + 1000) / 2 = 750
    Sorry for the long post , any help is very welcome.

    thank you in advance

    François
  • ckone35
    Junior Member
    • Aug 2013
    • 3

    #2
    The problem is may be not so easy to understand, if a webservice is launch 2 times, first in 1009ms and second in 474ms, i have this results in my calculated item (avg time last 5 min), there is 2 mistakes :

    Code:
    2013.Nov.27 17:11:50 0
    2013.Nov.27 17:11:20 474
    2013.Nov.27 17:10:50 474
    2013.Nov.27 17:10:20 474
    [COLOR="red"]2013.Nov.27 17:09:50 237[/COLOR]
    2013.Nov.27 17:09:20 741
    2013.Nov.27 17:08:50 741
    2013.Nov.27 17:08:20 741
    2013.Nov.27 17:07:50 741
    2013.Nov.27 17:07:20 741
    [COLOR="red"]2013.Nov.27 17:06:50 1483[/COLOR]
    2013.Nov.27 17:06:20 1009
    2013.Nov.27 17:05:50 1009
    2013.Nov.27 17:05:51 1009
    2013.Nov.27 17:04:50 1009
    2013.Nov.27 17:04:20 0
    2013.Nov.27 17:03:50 0
    For now, i'm not very satisfied of my workaround :
    Code:
    sum("myWS_SumTime_last",5m) 
        / 
    (sum("myWS_SumInvoc_last",5m) + 0.00001 )

    Comment

    Working...