Ad Widget

Collapse

Count age of item value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • temporary
    Junior Member
    • Jan 2017
    • 5

    #1

    Count age of item value

    I have item with possible values 0..5.
    Is there way how to count for how long has item specific value?
    For example: value 0 mean the device is OFF, value 1 mean the device has RED COLOR, value 2 mean the device has ORANGE COLOR etc.
    Can I count for how long is the device OFF since 8:00 - till now?
  • batchenr
    Senior Member
    • Sep 2016
    • 440

    #2
    Originally posted by temporary
    I have item with possible values 0..5.
    Is there way how to count for how long has item specific value?
    For example: value 0 mean the device is OFF, value 1 mean the device has RED COLOR, value 2 mean the device has ORANGE COLOR etc.
    Can I count for how long is the device OFF since 8:00 - till now?
    you mean in graph form ?
    any way for this kind of info :
    1 =off
    2 = on
    and so on you have Value Maping- under Adminstrator -> General - > tool box value maping.

    there you can set it and then connect it to the item.

    Comment

    • temporary
      Junior Member
      • Jan 2017
      • 5

      #3
      Hi batchenr,

      Thank You for reaction !

      I'm monitoring status of device. Status of device can be 0,1,2,3,4,5.

      The device is something like traffic lights. Status 0 mean device is off, 1 red, 2 orange, 3 green etc.

      On end of day I want know, how long was device off, how long was device red, how long was device green etc.
      I have created 1 item with update interval 60 second and trigger for each status.
      In menu Monitoring > Events I can see duration of each status, but how to summarize each status together through day (defined time interval)?

      Comment

      • batchenr
        Senior Member
        • Sep 2016
        • 440

        #4
        Originally posted by temporary
        Hi batchenr,

        Thank You for reaction !

        I'm monitoring status of device. Status of device can be 0,1,2,3,4,5.

        The device is something like traffic lights. Status 0 mean device is off, 1 red, 2 orange, 3 green etc.

        On end of day I want know, how long was device off, how long was device red, how long was device green etc.
        I have created 1 item with update interval 60 second and trigger for each status.
        In menu Monitoring > Events I can see duration of each status, but how to summarize each status together through day (defined time interval)?
        if i understand correctly , you can make a graph and attech to it this 5-6 items each with different color and thatch it

        Comment

        • temporary
          Junior Member
          • Jan 2017
          • 5

          #5
          correct, creation of graph is no problem, but.. I don't need graph.
          I need the number.

          since today 8:00 till now was status 0 for XY minutes, status 1 for YZ minutes, ..

          For example like on traffic lights:
          since today 8:00 till now I had
          - status 1 (red lite) for 300 minutes [SUM of all status 1 trigger duration]
          - status 2 (green lite) for 600 minutes
          - status 3 (orange lite) for 120 minutes

          - status 0 (out of order) for 50 minutes

          Comment

          • batchenr
            Senior Member
            • Sep 2016
            • 440

            #6
            Originally posted by temporary
            correct, creation of graph is no problem, but.. I don't need graph.
            I need the number.

            since today 8:00 till now was status 0 for XY minutes, status 1 for YZ minutes, ..

            For example like on traffic lights:
            since today 8:00 till now I had
            - status 1 (red lite) for 300 minutes [SUM of all status 1 trigger duration]
            - status 2 (green lite) for 600 minutes
            - status 3 (orange lite) for 120 minutes

            - status 0 (out of order) for 50 minutes
            you need a sum of values .
            try using a trigger with the sum() parm and count() param
            and somhow make a trigger fire this info to your mail once a day.

            ill try myself and if ill find a solution ill post here

            Comment

            • Semiadmin
              Senior Member
              • Oct 2014
              • 1625

              #7
              Hi, temporary.
              I don't know what about "till now", but you need a daily report, aren't you? It's easier.
              Create calculated items like this:
              value1: count("your_host:your_item",9h,1,eq), value2: count("your_host:your_item",9h,2,eq), and so on.
              Scheduling interval, for example, h17. Custom multiplier 60, units s.
              Every day at 5 pm you'll get your time periods for each value for last 9 hours.
              If you need notifications, just create a trigger like this one:
              {value1.nodata(120)}=0 and {value2.nodata(120)}=0 and ...
              and action whith macroses {ITEM.NAME1}:{ITEM.VALUE1}, {ITEM.NAME2}:{ITEM.VALUE2}, ...

              Comment

              • temporary
                Junior Member
                • Jan 2017
                • 5

                #8
                Hi Semiadminm

                Thank You !

                "Till now" mean actual time. But it is not mandatory for me now. You showed me way, how to calculate sum of trigger duration. I'm going to test this concept.

                well done!

                Comment

                • temporary
                  Junior Member
                  • Jan 2017
                  • 5

                  #9
                  Thanks Semiadmin!

                  count items is exactly I was looking for.

                  Comment

                  Working...