Ad Widget

Collapse

Calculated Item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gsmith
    Member
    • Mar 2015
    • 56

    #1

    Calculated Item

    Hello All,

    Environment;
    Zabbix Server 3.4.14 Virtual machine
    8 Cores
    10 GB Ram
    1TB HDD

    I need a little help understanding the Calculated Item/s.
    What I’m trying to do is calculate the total time User/s are logged in a Device.

    Example: 1 user logged in for 4 hours Monday, then 3 users were logged in for the total of 9 hours on Tuesday. At the end of the week show the total of Users logged in was 13 hours.
    How I’m trying to accomplish this is using the item name “Active Users” with the key perf_counter["\Terminal Services\Active Sessions"].

    This shows the number of active users logged in, from that item I created a calculate item Called “Total User Time” with a key user.time.
    The formula in use is sum(perf_counter["\Terminal Services\Active Sessions"],86400). I wanted the SUM of 1 Day of all active user/s logged in.


    Then I created another calculated Item called “Week User Time”, using the Key user.time.7 and the formula count("user.time",604800). The count for the week.

    Testing: The Sum seems to work. I had another user log into the device and it started doubling the amount of time. As for the count, I’m not sure if its correct. Any advice would be appreciated. Thank in advance.
    Last edited by Gsmith; 08-11-2018, 06:54.
  • Gsmith
    Member
    • Mar 2015
    • 56

    #2
    Unfortunately this did not work as expected. I did a control test and it failed to calculate the correct amount of time a "Active User" was logged in.
    Places I searched to solve my problem.


    https://stackoverflow.com/questions/...multiple-items

    My configuration consist one 1 item and 1 Calculated Item as follow;

    Item:
    Active user
    Key=perf_counter["\Terminal Services\Active Sessions"]
    Update interval=60seconds

    Calculate Item for Active user 1 hour
    Key=user.time
    Formula=sum(perf_counter["\Terminal Services\Active Sessions"],3600)
    Update interval=1h

    My test from this was 1 User logon for one hour, The data received for the SUM calculated item was 40, then it dropped to 38. I was expecting 60 total.No Joy


    Any Ideas would be appreciated.




    Comment

    • Gsmith
      Member
      • Mar 2015
      • 56

      #3
      SOLVED:
      The above Items worked as expected. The problem was the Item "Active user". Even thou it was set to 60 seconds intervals, I was receiving random update intervals (1m , 2m, 1m). I had to pull data from my proxy server every 1 minute, instead of every two minutes.

      Comment

      Working...