• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Create event detector that applies to all/specific datapoints

    User help
    3
    6
    1.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MattFoxM
      MattFox
      last edited by

      Hi All,

      I need to ensure all of my data is up to date. What can I do to make a datapoint fire an alarm once the data goes more than a few hours old? Not so keen on trying to apply individual events to every single datapoint, I've got a few thousand here....

      Fox

      Do not follow where the path may lead; go instead where there is no path.
      And leave a trail - Muriel Strode

      1 Reply Last reply Reply Quote 0
      • CraigWebC
        CraigWeb
        last edited by

        Hi MattFox

        Interesting topic, I am keen to follow it. I spent a few minutes trying to come up with something. But I could only come up with more questions...

        1. What does "up to date data" mean ? This will vary per type of data source.
        2. What type of data sources are you working with?
        3. if the data source is healthy does that mean the data point is healthy? If not then how would you know when the
          DP is up to date.?
        1 Reply Last reply Reply Quote 0
        • MattFoxM
          MattFox
          last edited by MattFox

          1. Up to date is easy as I know that my nodes update every five to ten minutes.

          2. The datasource is irrelevant, It's the age of the timestamp of the individual datapoints themselves. That's why I said a few hours.

          3. I have other systems in place to monitor live connections to my data nodes over the air. If I have a poor connection, all associated datapoints with that datasource will fail to update altogether. So the issue comes with the nodes themselves to ensure data is being sent and utilising Mango's events system to assist in monitoring point updates and providing an edge to be more proactive in support and troubleshooting.

          Do not follow where the path may lead; go instead where there is no path.
          And leave a trail - Muriel Strode

          1 Reply Last reply Reply Quote 0
          • MattFoxM
            MattFox
            last edited by

            I'm getting the feeling that this is not currently possible in Mango....

            Do not follow where the path may lead; go instead where there is no path.
            And leave a trail - Muriel Strode

            phildunlapP 1 Reply Last reply Reply Quote 0
            • phildunlapP
              phildunlap @MattFox
              last edited by

              @mattfox said in Create event detector that applies to all/specific datapoints:

              I'm getting the feeling that this is not currently possible in Mango....

              Well then it's good you bumped it as I missed it somehow! Of course it's possible (probably). You'd have a bunch of options to hack it up. I think compiling a JSON object and placing that into the JSON store will be a useful example. This is a scripting data source:

              var allPoints = DataPointQuery.query("limit(1000000)");
              var delayedUpdates = {};
              var now = Number(CONTEXT.getRuntime());
              for (var k = 0; k < allPoints.length; k+=1) {
                if ( allPoints[k].runtime === null ) //Point or source not enabled
                  continue; //We could add it to another status object, instead, or set its key to "disabled" so we can see it
              
                if ( now - allPoints[k].runtime.time > 600000 ) //Ten minutes milliseconds
                  delayedUpdates[ allPoints[k].extendedName ] = allPoints[k].runtime.time;
              }
              
              function newJsonDataObject() {
                var jsonDataVO = new com.serotonin.m2m2.vo.json.JsonDataVO();
                jsonDataVO.setPublicData( false );
                jsonDataVO.setReadPermission( "" );
                jsonDataVO.setEditPermission( "" );
                jsonDataVO.setXid( "JSON_delayed_updates" );
                jsonDataVO.setName( "Delayed Updates" );
                return jsonDataVO;
              }
              
              var jsonDataVO = com.serotonin.m2m2.db.dao.JsonDataDao.instance.getByXid( "JSON_delayed_updates" );
              if(jsonDataVO === null)
                jsonDataVO = newJsonDataObject();
              jsonDataVO.setJsonData( delayedUpdates );
              
              //print(JSON.stringify(delayedUpdates));
              com.serotonin.m2m2.db.dao.JsonDataDao.instance.save( jsonDataVO );
              

              Have that on a cron that updates as often as you need to. If loading that point list is cumbersome because your system is massive, that can probably be worked around. The result of this will be a JSON store item with a map of point extended names to last update timestamps iff that update was at least ten minutes ago.

              MattFoxM 1 Reply Last reply Reply Quote 0
              • MattFoxM
                MattFox @phildunlap
                last edited by

                @phildunlap said in Create event detector that applies to all/specific datapoints:

                You'd have a bunch of options to hack it up.

                You had me at hack
                I've got a status dashboard doing something similar already. Although I can likely extend what you've done here and implement an email with a template listing all iffy datapoints. It's not an alarm per se but it sure is a darn good start.
                I'll put it in the wishlist. I think it'd be good to datasource/point template wide alarm settings that individual points have.
                Inidividual point alarms override template -> template override datasource. That's my idea.

                Thanks again Phil!

                Fox

                Do not follow where the path may lead; go instead where there is no path.
                And leave a trail - Muriel Strode

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post