Page tree

SAYMON документация

Skip to end of metadata
Go to start of metadata

This probe performs a SQL-query to one of the following databases: MySQL (4.1 - 5.7), MS SQL (Microsoft SQL Server 2005 / 2008 / 2008 R2 / 2012 / 2014), PostgreSQL (9.x), Oracle (9.0 - 11.2) and HP Vertica.

Example

FieldDescription
Database typeSelect: MySQL, PostgreSQL, MS SQL, Oracle, HP Vertica
HostnameLocalhost by default
PortDefault: MySQL - 3306; PostgreSQL - 5432; MS SQL - 1433; Oracle - 1521; HP Vertica - 1521
Database name
Database name to which the request is being made
Instance nameDatabase instance name in which the request is being made
LoginDB username
Password
DB Password
EncodingSQL query encoding
SQL query

SQL query text (you can only use SELECT command, and query field is limited to 1024 characters)

PeriodDescribes how often to perform the check (60 seconds by default)

Result

After the check has been done the result is displayed in the data table:

FieldDescription
count(id)Number of records in the "ID" column from the "States" table

Raws is an additional field in which the array length is indicated.

Total number of rows is displayed when the array value is the result of the probe or the input data.


Terminal counterpart

Counterpart execution of this check in the terminal:

mysql –u saymon –p
mysql> show databases
    -> ;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| saymondb           |
+--------------------+
2 rows in set (0.00 sec)


mysql> use saymondb
Reading table informatiom for comletion of table and colunm names
You can turn off this feature to get a quicker startup with -A


Database changed
mysql> show tables
    -> ;
+--------------------+
| Tables_in_saymondb |
+--------------------+
| class_categories   |
| classes            |
| history            |
| migration          |
| obj_prop_types     |
| object_properties  |
| objects            |
| relation_types     |
| relations          |
| state_history      |
| states             |
+--------------------+
11 rows in set (0.00 sec)


mysql> select count(id) from states;
+-----------+
| count(id) |
+-----------+
|         9 |
+-----------+
1 row in set (0.00 sec)

Known problems and errors

Sensor error! Can not issue data manipulation statements with executeQuery().

Incorrectly specified SQL query.

Sensor error! Connection refused (Connection refused)

Check the correctness of the specified port number (Default: MySQL - 3306; PostgreSQL - 5432; MS SQL - 1433; Oracle - 1521; HP Vertica - 1521).

Sensor error! Access denied for user 'say'@'localhost'

It is necessary to check the correctness of the data indicated in the fields: Login and Password.

  • No labels