• terrypacker

    @aosc98 there is not a utility like that. However it would be possible to do the same type of RQL query on the publisher's table but it would require understanding the java backing code and how to access it from the script environment. I don't have the resources to currently supply you with a fully working example but if you are proficient in Java and Javascript this shouldn't be too much of a stretch to look into our public code on GitHub and figure it out. This might jumpstart some thoughts out there, and could work in Mango 3.7.x:

        //Get a reference to Common to be able to 'find' a Spring Bean
        var Common = Java.type('com.serotonin.m2m2.Common'); 
        //Find the publisher dao
        var dao = Common.getBean(Java.type('com.serotonin.m2m2.db.dao.PublisherDao').class);
        var RQLUtils = Java.type('com.infiniteautomation.mango.util.RQLUtils');
        //Parse RQL to ASTNode
        var astNode = RQLUtils.parseRQLtoAST('eq(name,Testing Publisher)');
        //Query using RQL
        dao.rqlQuery(astNode, function(dp, row) {
            console.log(dp.name);
        });
    

    posted in User help read more
  • terrypacker

    I just had @Dave-Frazier try to get it working in 3.7 and he wasn't able to. I won't have time until later this week at the earliest.

    Can you not approach this problem a different way, are you using the data file import functionality? It sounds like you are not. Perhaps you could just use settable virtual no-change data points to store your values in from the REST api?

    posted in User help read more
  • terrypacker

    I just checked and the problem is because of the file store permissions. In Mango 3.7.x there is no short circuit for superadmin to get permission to a file store. This means you have to explicitly set the superadmin role on the DATA_FILE_COMPILED_TEMPLATE File Store Read Permission.

    The 422 error is stopping you from updating the data source to point to the correct poll class.

    posted in User help read more
  • terrypacker

    @MattFox I'm surprised the permissions are not working. How are you importing it? There are specific permissions for the file store in the System Settings area but normally one would import as superadmin so I'm confused as to why you don't have permission.

    posted in User help read more
  • terrypacker

    @mattfox said in Datafile datasource saving => 422 (Unprocessable Entity):

    I cannot see where I need to configure for the location of the poll class code... It shows it in the dropdown in the new UI...

    The files will show up in the drop down after you use the Data File Tools tab to upload and compile the templates.

    You can see the templates in the file store via this url (or by navigating there in the UI)

    ui/administration/file-stores?fileStore=DATA_FILE_TEMPLATE

    posted in User help read more
  • terrypacker

    @skazemi you have a few options, by default linux restricts access to ports below 1000 (which you have figured out).

    I suggest you follow this procedure which will allow Mango to safely run with the proper privileges to access port 502: https://help.infiniteautomation.com/linux-installation

    But for general reference you have other options:

    1. You could use iptables to route traffic between ports. Here is an example of how we route traffic between 8080 <--> 80 https://help.infiniteautomation.com/linux-security

    2. I can't remember if the GT support ipchains but you could try those with something like this
      /sbin/ipchains -I input --proto TCP --dport 502 -j REDIRECT 5020

    3. You could try setuid to allow the Mango process to access port 502

    Hope that helps.

    posted in User help read more
  • terrypacker

    @MattFox in Mango 3.7 we upgraded that data source to use the File Store for the user created java files. I suspect this is the problem. Can you confirm that the data source is pointing to the correct place for your poll class code?

    Also might as well paste the entire message text from the event in case I'm leading you down the wrong path.

    posted in User help read more
  • terrypacker

    I would be interested to find out if there is a configuration problem here or if Mango could be doing something better.

    Can you confirm:

    1. You are using MySQL
    2. The results of this query on that MySQL instance: select @@DATADIR
    3. The version of MySQL
    4. That /mysql/datadir does exist
    5. That the user running Mango has read access to /mysql/datadir

    Then I can provide more specific help I think.

    posted in Mango feedback read more
  • terrypacker

    That shouldn't affect a restore. The DiskUsageMonitoringService is a service that runs periodically to compute the disk usage for Mango.

    What you are seeing is it fail because your MySQL instance is setup to have its data directory at /mysql/datadir and that file does not exist. The service attempts to find the data directory for MySQL by doing this query:

    select @@DATADIR

    Which should return the path to where it stores it's data.

    posted in Mango feedback read more
  • terrypacker

    @Gord-Bond If I’m understanding this correctly the only way to overwrite data at a time stamp is to use the Mango NoSQL database module. It only allows one value for a data point at a specific time stamp. If you are using the default H2 or MySQL tables to store the values you will get duplicates.

    posted in User help read more