SQL
Function | Allows reading numerical values directly from an SQL database. Currently MySQL and PostgreSQL are supported. |
---|---|
Alarming | Connection time, Transfer time, Value 1-4 |
SQL detail
On the Database server, make sure to grant access to the SKOOR Engine server like this:
grant all on <database name>.* to <database user>@'10.1.1.147' identified by '<password>';
SQL parameters
Parameter | Description |
---|---|
SQL type | Choose between the following MySQL |
Port | TCP port (Defaults are 3306 for MySQL and 5432 for PostgreSQL) |
User | Database user name |
Password | Database user password |
DB name | Database name |
Query | Enter the SQL query. Only the first row will be captured, so make sure “limit 1” is specified and the order is correct. |
Columns | Select how many columns to use from the output. A maximum of 4 columns can be read in per SQL job. The columns must contain numerical values, except the column specified as Info column (see below). |
Info column | Specify which column to read the Info message from. By default, No info text is selected and thus no Info message will be printed in the job's Values section. If an Info column is used, only a maximum of 3 numerical values can be read within the same SQL job. |
Suppress connection time | If one of these checkboxes is checked, the connection time and/or transfer time of each check is not saved to the database and their values are no longer visible in the values section. Their value is also no longer available for use in alarm limit specifications. |
SQL values and alarm limits
Value / Alarm limit | Description |
---|---|
Connection time | Time until the SQL connection is set up (in ms) |
Transfer time | Time until the query is served and the connection is closed (in ms) |
Value 1-4 | User defined values based on the specified query. |
Error code | Generic job error code (see section Job error codes) |
SQL examples
Example 1 - Read the number of history values from the SKOOR history database
SQL type | PostgreSQL |
---|---|
Port | 5432 |
User | ng |
Password | ng |
DB name | ng |
Query | select count(*) from history_values; |
Columns | 1 column |
1st column | Value Entries detailed |