how can I sent native InfluxDB SQL commands through NGA from within the CONTROL scripting?
The db family of functions in the CONTROL language seems to be limited to ADO or ODBC front end. Is there a path between CONTROL and the NGA backends?
Todd Malone
how to interact with NGA InfluxDB in CONTROL
- tmalone
- Posts:192
- Joined: Mon Nov 22, 2010 11:21 pm
how to interact with NGA InfluxDB in CONTROL
- kilianvp
- Posts:443
- Joined: Fri Jan 16, 2015 10:29 am
Re: how to interact with NGA InfluxDB in CONTROL
Yes with #uses "CrtlNgaFrontend" and dpQueryNGA
- tmalone
- Posts:192
- Joined: Mon Nov 22, 2010 11:21 pm
Re: how to interact with NGA InfluxDB in CONTROL
wow, similar to the old Oracle stuff. I never thought to look for new functions.
After reviewing some other posts of Master @kilianvp, I found a way to use a REST interface that with some extra scripting you can make work on remote UIs too.
sUsrPwd = base64Encode("username:password");
m = makeMapping("headers", makeMapping("Authorization", "Basic "+sUsrPwd));
ret = netGet(http://localhost:8086/query?pretty=true&q=SELECT \name\", _ack_state FROM winccoa.ALERT.ALERT WHERE time > now() - 1h", sRet, m);
Todd Malone
After reviewing some other posts of Master @kilianvp, I found a way to use a REST interface that with some extra scripting you can make work on remote UIs too.
sUsrPwd = base64Encode("username:password");
m = makeMapping("headers", makeMapping("Authorization", "Basic "+sUsrPwd));
ret = netGet(http://localhost:8086/query?pretty=true&q=SELECT \name\", _ack_state FROM winccoa.ALERT.ALERT WHERE time > now() - 1h", sRet, m);
Todd Malone
- tmalone
- Posts:192
- Joined: Mon Nov 22, 2010 11:21 pm
Re: how to interact with NGA InfluxDB in CONTROL
in a follow up to the dpQueryNGA(), this function allows only same sort of calls as dpQuery. For example SELECT '_original.._value' ...
The dpQueryNGA() does not allow you do do more complex SQL with the database. The InfluxDB is a very powerful database with many "data mining" possibilities.
Todd
The dpQueryNGA() does not allow you do do more complex SQL with the database. The InfluxDB is a very powerful database with many "data mining" possibilities.
Todd
- gschijndel
- Posts:376
- Joined: Tue Jan 15, 2019 3:12 pm
Re: how to interact with NGA InfluxDB in CONTROL
The 'dpQueryNGA'/'dpQueryRDB' should be used automatically if the use direct queries have been enabled, so I do not see a point to call them explicitly.
Unfortunately there seems to be not a NGA equivalent of 'runRealSQLQuery'.
Unfortunately there seems to be not a NGA equivalent of 'runRealSQLQuery'.
- tmalone
- Posts:192
- Joined: Mon Nov 22, 2010 11:21 pm
Re: how to interact with NGA InfluxDB in CONTROL
while it is true that "direct queries" would default to that call, but it is not good for a common client to have that turned on for everything as it will also force it for trends, etc. Calling it explicitly allows the system to remain in the default mode for datamanager interactions.