Zabbix Documentation 4.4

3.04.04.4 (current)| In development:5.0 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


manual:config:items:itemtypes:odbc_checks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
manual:config:items:itemtypes:odbc_checks [2018/11/01 06:02]
martins-v sql mustn't start with 'select'
manual:config:items:itemtypes:odbc_checks [2019/10/01 08:44] (current)
martins-v linking to an example of db.odbc.get
Line 98: Line 98:
 Configure a database monitoring [[manual:​config:​items:​item#​overview|item]]. Configure a database monitoring [[manual:​config:​items:​item#​overview|item]].
  
-{{odbc.png|}}+{{odbc0.png|}}
  
 All mandatory input fields are marked with a red asterisk. ​ All mandatory input fields are marked with a red asterisk. ​
Line 105: Line 105:
  
 |//​Type// ​  ​|Select //Database monitor// here.   | |//​Type// ​  ​|Select //Database monitor// here.   |
-|//​Key// ​  ​|Enter **db.odbc.select**[unique_description,​data_source_name]\\ The unique description will serve to identify the item in triggers etc.\\ The data source name (DSN) must be set as specified in odbc.ini. ​ |+|//​Key// ​  ​|Enter ​one of the two supported item keys:​\\ ​**db.odbc.select**[unique_description,​data_source_name] ​- this item is designed to return one value, i.e. the first column of the first row of the SQL query result. If a query returns more than one column, only the first column is read. If a query returns more than one line, only the first line is read.\\ **db.odbc.get**[unique_description,​data_source_name] - this item is capable of returning multiple rows/​columns in JSON format. Thus it may be used as a master item that collects all data in one system call, while JSONPath preprocessing may be used in dependent items to extract individual values. For more information,​ see an [[:​manual/​discovery/​low_level_discovery/​sql_queries#​using_dbodbcget|example]] of the returned format, used in low-level discovery. This item is supported since Zabbix 4.4.\\ The unique description will serve to identify the item in triggers etc.\\ The data source name (DSN) must be set as specified in odbc.ini. ​ |
 |//User name// ​  ​|Enter the database user name (optional if user is specified in odbc.ini) | |//User name// ​  ​|Enter the database user name (optional if user is specified in odbc.ini) |
 |//​Password// ​  ​|Enter the database user password (optional if password is specified in odbc.ini) | |//​Password// ​  ​|Enter the database user password (optional if password is specified in odbc.ini) |
-|//SQL query// ​  | Enter the SQL query  |+|//SQL query// ​  | Enter the SQL query.\\ Note that with the ''​db.odbc.select[]''​ item the query must return one value only.  |
 |//Type of information// ​ |It is important to know what type of information will be returned by the query, so that it is selected correctly here. With an incorrect //type of information//​ the item will turn unsupported. ​ | |//Type of information// ​ |It is important to know what type of information will be returned by the query, so that it is selected correctly here. With an incorrect //type of information//​ the item will turn unsupported. ​ |
  
Line 115: Line 115:
   * Zabbix does not limit the query execution time. It is up to the user to choose queries that can be executed in a reasonable amount of time.   * Zabbix does not limit the query execution time. It is up to the user to choose queries that can be executed in a reasonable amount of time.
   * The [[:​manual/​appendix/​config/​zabbix_server|Timeout]] parameter value from Zabbix server is used as the ODBC login timeout (note that depending on ODBC drivers the login timeout setting might be ignored).   * The [[:​manual/​appendix/​config/​zabbix_server|Timeout]] parameter value from Zabbix server is used as the ODBC login timeout (note that depending on ODBC drivers the login timeout setting might be ignored).
-  * The query must return one value only. 
-  * If a query returns more than one column, only the first column is read. 
-  * If a query returns more than one line, only the first line is read.  
   * The SQL command must return a result set like any query with ''​select ...''​. The query syntax will depend on the RDBMS which will process them. The syntax of request to a storage procedure must be started with ''​call''​ keyword.   * The SQL command must return a result set like any query with ''​select ...''​. The query syntax will depend on the RDBMS which will process them. The syntax of request to a storage procedure must be started with ''​call''​ keyword.
   * See also [[:​manual/​installation/​known_issues#​odbc_checks|known issues]] for ODBC checks   * See also [[:​manual/​installation/​known_issues#​odbc_checks|known issues]] for ODBC checks