• A
    Ava2018

    I think something on the very beggining of the scripting tests was recorded in the history and was tricking the new values. I copied the DP to a new fresh one, and it worked.
    Thanks!

    posted in Scripting general Discussion read more
  • A
    Ava2018

    Hi,
    I wrote a script to get a linux file size as the following json. It works fine with the script verification and realtime value showed in the DP Details screen. However no value is recorded in the history, only a question mark(?) is shown along with the timestamp. The weird thing is that the cached values showed in the datapoints details are displayed correctly as you can see in the screenshot above, but when I update the screen, the values became do a question mak again.

    What I am missing?

    Thanks in advance

    0_1549564033973_DP screenshot.JPG

    {
       "dataPoints":[
          {
             "xid":"DP_09a1df37-0dc1-4bd0-a4e7-91f2ca4efbd0",
             "name":"Tamanho arquivo H2",
             "enabled":true,
             "loggingType":"ON_CHANGE",
             "intervalLoggingPeriodType":"MINUTES",
             "intervalLoggingType":"AVERAGE",
             "purgeType":"YEARS",
             "pointLocator":{
                "dataType":"NUMERIC",
                "updateEvent":"MINUTES",
                "contextUpdateEvent":"CONTEXT_UPDATE",
                "context":[
                   {
                      "varName":"p6678",
                      "dataPointXid":"DP_ca4d75a0-4ccf-48b3-b7ce-94181afd4292",
                      "updateContext":false
                   }
                ],
                "logLevel":"NONE",
                "variableName":"my",
                "executionDelaySeconds":0,
                "logCount":5,
                "logSize":1.0,
                "script":"\/\/print(` du -s \/opt\/mango\/databases\/mah2.h2.db |awk '{print $1}'`);\nvar response = com.serotonin.m2m2.rt.maint.work.ProcessWorkItem.executeProcessCommand(\"\/home\/aaguiar\/script\/tamanhoH2.sh\",5);\n\/\/print( response );\nvar valor = response.key;\nreturn valor*1",
                "scriptPermissions":{
                   "customPermissions":"",
                   "dataPointReadPermissions":"superadmin",
                   "dataPointSetPermissions":"superadmin",
                   "dataSourcePermissions":"superadmin"
                },
                "settable":true,
                "updateCronPattern":""
             },
             "eventDetectors":[
                {
                   "type":"HIGH_LIMIT",
                   "sourceType":"DATA_POINT",
                   "xid":"ED_f4738cec-edc8-4aa3-8aa7-bd72ffd7f18d",
                   "name":"Limite de 1GB alcançado no arquivo H2",
                   "alarmLevel":"LIFE_SAFETY",
                   "durationType":"SECONDS",
                   "duration":0,
                   "limit":1000000.0,
                   "notHigher":false
                }
             ],
             "plotType":"SPLINE",
             "rollup":"NONE",
             "unit":"",
             "templateXid":"Numeric_Default",
             "simplifyType":"NONE",
             "chartColour":"",
             "chartRenderer":{
                "type":"IMAGE",
                "timePeriodType":"DAYS",
                "numberOfPeriods":1
             },
             "dataSourceXid":"DS_355e23e3-f46d-4e4a-bb3f-106bd7e42f22",
             "defaultCacheSize":1,
             "deviceName":"!!Teste de controle de registros",
             "discardExtremeValues":false,
             "discardHighLimit":1.7976931348623157E308,
             "discardLowLimit":-1.7976931348623157E308,
             "intervalLoggingPeriod":1,
             "intervalLoggingSampleWindowSize":0,
             "overrideIntervalLoggingSamples":false,
             "preventSetExtremeValues":false,
             "purgeOverride":false,
             "purgePeriod":1,
             "readPermission":"",
             "setExtremeHighLimit":1.7976931348623157E308,
             "setExtremeLowLimit":-1.7976931348623157E308,
             "setPermission":"",
             "tags":{
             },
             "textRenderer":{
                "type":"ANALOG",
                "useUnitAsSuffix":true,
                "unit":"",
                "renderedUnit":"",
                "format":"0.00"
             },
             "tolerance":0.0
          }
       ]
    }
    

    posted in Scripting general Discussion read more
  • A
    Ava2018

    Ohh yes, this is where I got confused! I haven't seen that options on the Alarm level combo. All clarified now!
    I found in the forum that I can export data from any table to another external DB, so I can keep the events shorter in H2. I will make an effort to keep the structure with H2 DB because the management through Mango seems simplier.
    Thanks a lot for all the info.

    posted in User help read more
  • A
    Ava2018

    Phil, the links you provided only mention derby, mySQL and H2, then I will assume Mango isn't ready to use Oracle, maybe modifying the queries in the source code since some sintax and colun types are different, so it would demand development effort.

    About the events question.
    I don't know what I am missing so, because even with the logging at "Do not Log", see my DP code, event screen and db record :

    {
       "dataPoints":[
          {
             "xid":"DP_85537b93-353d-4bbc-8e0c-82f7af745148",
             "name":"DP1",
             "enabled":true,
             **"loggingType":"NONE",**
             "intervalLoggingPeriodType":"MINUTES",
             "intervalLoggingType":"AVERAGE",
             "purgeType":"YEARS",
             "pointLocator":{
                "dataType":"NUMERIC",
                "changeType":{
                   "type":"RANDOM_ANALOG",
                   "max":100.0,
                   "min":0.0,
                   "startValue":"0"
                },
                "settable":false
             },
             "eventDetectors":[
                {
                   "type":"POINT_CHANGE",
                   "sourceType":"DATA_POINT",
                   "xid":"ED_b18bf2f2-8611-4cf8-be87-db9f2544e117",
                   "name":"",
                   "alarmLevel":"NONE"
                }
             ],
             "plotType":"SPLINE",
             "rollup":"NONE",
             "unit":"",
             "simplifyType":"NONE",
             "chartColour":"",
             "chartRenderer":{
                "type":"IMAGE",
                "timePeriodType":"DAYS",
                "numberOfPeriods":1
             },
             "dataSourceXid":"DS_2f623aba-672a-4220-be21-501b29ca1eac",
             "defaultCacheSize":1,
             "deviceName":"!!!Andre4",
             "discardExtremeValues":false,
             "discardHighLimit":1.7976931348623157E308,
             "discardLowLimit":-1.7976931348623157E308,
             "intervalLoggingPeriod":1,
             "intervalLoggingSampleWindowSize":0,
             "overrideIntervalLoggingSamples":false,
             "preventSetExtremeValues":false,
             "purgeOverride":false,
             "purgePeriod":1,
             "readPermission":"",
             "setExtremeHighLimit":1.7976931348623157E308,
             "setExtremeLowLimit":-1.7976931348623157E308,
             "setPermission":"",
             "tags":{
             },
             "textRenderer":{
                "type":"ANALOG",
                "useUnitAsSuffix":true,
                "unit":"",
                "renderedUnit":"",
                "format":"0.00"
             },
             "tolerance":0.0
          }
       ]
    }
    

    Event screen: Events

    DB screen: Screen

    What would it be?

    Another thing I notice is that each event generated is replicated in the userevents table for each "admin" user I have in Mango. Is there a setting to control/avoid that?

    Thanks

    posted in User help read more
  • A
    Ava2018

    Ok.
    So I understood that what triggers the recording events on the EVENTS/USEREVENTS tables is the event detector option in DP and not the logging type.
    I just tested here one DP, with "Do not Log" Logging type, but with the event detector (Change type) added. And it keeps bulking the H2.
    Is there a way to have the Event detector working without the record in those tables?

    Another question is if there any change to use Oracle instead MySQL in case of replacing H2?

    Thanks.

    posted in User help read more
  • A
    Ava2018

    Understood Phil.
    In your experience, would MySQL handle better a big number of DP, users and event logging with the frequency near 20000 events record/day and 1500000 userevents record/day?
    Is there some known performance threshold on H2 (related to H2 size and events record frequency)?
    The idea of putting that in a NoSQL db seems very welcomed.

    I am testing your suggestion of decreasing the default alarm level logging to check how the system behaviors, I set all the audit and system event alarm levels(/system_settings.shtm) to both Do not Log or ignore, however, in my test, the change detector event keeps recording all the events change, for example.

    Table Events
    ID TYPENAME SUBTYPENAME TYPEREF1 TYPEREF2 ACTIVETS RTNAPPLICABLE RTNTS RTNCAUSE ALARMLEVEL MESSAGE ACKTS ACKUSERID ALTERNATEACKSOURCE
    3028491 DATA_POINT 6595 291 1548332743821 N 0 0 0 event.detector.changeCount|!!!Andre4 - DP1|49,16 |15,45 |

    Table UserEvents
    EVENTID USERID SILENCED
    3028491 1 N
    3028491 4 N
    3028491 5 N
    3028491 12 N
    3028491 8 N
    3028491 9 N
    3028491 10 N

    Is there any other setting I missed?

    Thanks for your prompt attention.

    posted in User help read more
  • A
    Ava2018

    Just adding some information. Maybe the problem is related with the events amount and not directly with the H2 size.
    I got the system a little before locks on 100% CPU. The USEREVENTS table count was around 13millions, then I purged all the events and from that moment on Mango returned to run very quickly using around 10%CPU even with the fast datasources enabled and showing SQL Database size in 2.9GiB.

    Just to have an idea of my concern about that, on my current SCADA system (SCADABR), it works with around 20000 events and 1500000 userevents a day. In the current purge setting(2 months), it results a 2 million events and 122million userevents total. The db system is Oracle, the question is if Mango (H2,MangoTSDB) can handle that...

    posted in User help read more
  • A
    Ava2018

    Hi, I am doing some evaluation with mango to see the system behavior under a medium/big amount of pointvalues/events.

    I notice that until the SQL database is less than 1.5GiB, my CPU consuming goes around 20%. However after 2 or 3 hours running with the configuration above, the SQL DB pass the 2GiB(not sure if this is the source of the problem) and the CPU consuming start growing until keeps in the 90/100% CPU, making mango unresponsive.

    Configuration:
    CPU: QuadCore Xeon 2.4GHz
    RAM: 8GB

    Mango 3.5.6 (set to ext-enabled with 6GB)

    Created Datasources: 430
    Enabled dataSources: 8 virtual datapoints, 100ms update, with 1 random numeric DP each, 1 change event record by update each.
    Created Datapoints: 6500
    Enabled Datapoints: 10

    Writes per second during database batches: 79
    Point values to be written: 32 (Average)

    Database (reset) size after proceding a backup, deleting the mah2.hs.db and restore it:
    SQL Database size 1.8 GiB
    NoSQL point value database size: 100.5MiB

    Point values Count: 4918301
    Events count: 1652711

    JVM free memory (MB) 1113 (After a fresh restart)
    JVM free memory (MB) 759 (At the lock time)
    JVM maximum available memory (MB) 4960

    posted in User help read more
  • A
    Ava2018

    Good!
    I will try to implement the script.

    Thank you very much the quick response phildunlap!

    posted in Mango Automation general Discussion read more
  • A
    Ava2018

    Hi!
    I have a problem with some dev users, where they usually create test datasources with a very short update timing or write a big script in a DS Meta with several changing context points which may generate a unnecessary writing values and processing. We stablish that 1 register each 30 sec is the shortest time period we should use. However those users usually forget that, Since we use Oracle with our SCADA system, I set up an alert in the DB where if a DP records more than 2880 a day, it sends me an alert email to check that DP.
    Is it possible to use a similar control using mango's NoSql db?

    Thanks

    posted in Mango Automation general Discussion read more