[ZBX-6839] Recommended UnixODBC settings for most popular databases Created: 2013 Jul 31  Updated: 2024 Apr 10  Resolved: 2018 Feb 10

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Documentation (D)
Affects Version/s: None
Fix Version/s: 4.0 (plan)

Type: Documentation task Priority: Trivial
Reporter: Alexey Pustovalov Assignee: Natalja Cernohajeva (Inactive)
Resolution: Fixed Votes: 1
Labels: documentation, odbc
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Oracle, PostgreSQL, MySQL


Team: Team B
Sprint: Sprint 22, Sprint 23, Sprint 24, Sprint 25, Sprint 26, Sprint 27
Story Points: 3

 Description   

Recommended options/parameters for most popular databases should be documented because of some limitations, for example, timeouts, big queries and etc.



 Comments   
Comment by Alexey Pustovalov [ 2013 Aug 02 ]

1. MySQL http://dev.mysql.com/doc/refman/5.5/en/connector-odbc-configuration-connection-parameters.html :
odbcinst.ini

[mysql]
Description = General ODBC for MySQL
Driver      = /usr/lib64/libmyodbc5.so
Setup       = /usr/lib64/libodbcmyS.so 
FileUsage   = 1

odbc.ini

[TEST_MYSQL]                                                     
Description = MySQL database 1                                   
Driver  = mysql                                                  
Port = 3306                                                      
Server = 127.0.0.1                                               
                                                                 
[TEST_MYSQL_FILLED_CRED]                       
Description = MySQL database 2                 
Driver  = mysql                                
User = root                                    
Port = 3306                                    
Password = Qwestions                           
Database = zbx_206                             
Server = 127.0.0.1                             

[TEST_MYSQL_FILLED_CRED_SOCK]                  
Description = MySQL database 3                 
Driver  = mysql                                
User = root                                    
Password = Qwestions                           
Socket = /var/run/mysqld/mysqld.sock           
Database = zbx_206
Comment by Alexey Pustovalov [ 2013 Aug 08 ]

2. PostgreSQL: The documentation is in PostgreSQL connector:
odbcinst.ini

[postgresql]
Description = General ODBC for PostgreSQL
Driver      = /usr/lib64/libodbcpsql.so
Setup       = /usr/lib64/libodbcpsqlS.so
FileUsage   = 1
# Since 1.6 if the driver manager was built with thread support you may add another entry to each driver entry.
# This entry alters the default thread serialization level.
Threading   = 2

odbc.ini

[TEST_PSQL]
Description = PostgreSQL database 1
Driver  = postgresql
#CommLog = /tmp/sql.log
Username = zbx_test
Password = password
# Name of Server. IP or DNS
Servername = 127.0.0.1
# Database name
Database = zabbix
# Postmaster listening port
Port = 5432
# Database is read only
# Whether the datasource will allow updates.
ReadOnly = No
# PostgreSQL backend protocol
# Note that when using SSL connections this setting is ignored.
# 7.4+: Use the 7.4(V3) protocol. This is only compatible with 7.4 and higher backends.
Protocol = 7.4+
# Includes the OID in SQLColumns
ShowOidColumn = No
# Fakes a unique index on OID
FakeOidIndex  = No
# Row Versioning
# Allows applications to detect whether data has been modified by other users
# while you are attempting to update a row.
# It also speeds the update process since every single column does not need to be specified in the where clause to update a row.
RowVersioning = No
# Show SystemTables
# The driver will treat system tables as regular tables in SQLTables. This is good for Access so you can see system tables.
ShowSystemTables = No
# If true, the driver automatically uses declare cursor/fetch to handle SELECT statements and keeps 100 rows in a cache.
Fetch = Yes
# Bools as Char
# Bools are mapped to SQL_CHAR, otherwise to SQL_BIT.
BoolsAsChar = Yes
# SSL mode
SSLmode = Yes
# Send tobackend on connection
ConnSettings =
Comment by Alexey Pustovalov [ 2013 Aug 12 ]

3. Oracle. The documentation is available on this page: http://docs.oracle.com/cd/B28359_01/server.111/b32009/app_odbc.htm
odbcinst.ini


odbc.ini


Comment by Alexey Pustovalov [ 2013 Aug 12 ]

4. MSSQL. The documentation is available on this page:
install necessary packages on Zabbix server:

# yum -y install freetds unixODBC unixODBC-devel

update ODBC driver configuration file:

$ vi /etc/odbcinst.ini
[FreeTDS]
Driver = /usr/lib64/libtdsodbc.so.0

update ODBC configuration file:

$ vi /etc/odbc.ini
[sql1]
Driver = FreeTDS
Server = <SQL server 1 IP>
PORT = 1433
TDS_Version = 8.0

[sql2]
Driver = FreeTDS
Server = <SQL server 2 IP>
PORT = 1433
TDS_Version = 8.0
Comment by Alexey Pustovalov [ 2013 Aug 12 ]

some interesting information: http://www.unixodbc.org/doc/conn_pool.html

glebs.ivanovskis There is a limited use of it in Zabbix, because every poller is an independent process and UnixODBC will create independent connection pools for them. Just a waste of memory in case of large number of pollers.

Comment by Oleg Ivanivskyi [ 2015 Mar 19 ]

5. SAP Sybase ASE http://www.freetds.org/userguide/odbcconnattr.htm:
copy "libsybdrvodb.so" from Sybase server to /usr/lib*/ on Zabbix server if you would like to use native Sybase driver
install necessary packages on Zabbix server:

# yum -y install freetds unixODBC unixODBC-devel

update ODBC driver configuration file:

$ vi /etc/odbcinst.ini
[Sybase]
# Sybase ODBC Driver
Driver = /usr/lib64/libsybdrvodb.so # sybase driver
# Driver = /usr/lib64/libtdsodbc.so.0 # freetds driver

update ODBC configuration file:

$ vi /etc/odbc.ini
[sybase1]
Driver = Sybase
Server = <ASE server 1 IP>
PORT = 5000

[sybase2]
Driver = Sybase
Server = <ASE server 2 IP>
PORT = 5000
Comment by Glebs Ivanovskis (Inactive) [ 2018 Jan 22 ]

Are you sure unixODBC-devel is necessary?

Comment by Natalja Cernohajeva (Inactive) [ 2018 Jan 22 ]

natalja.cernohajeva : following documentation section has been updated with the required information:
https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/odbc_checks
(5 sub-sections added in total)
Please,review.

Comment by Natalja Cernohajeva (Inactive) [ 2018 Jan 26 ]

natalja.cernohajeva: all the additional changes have been executed. Dear, dotneft, please, review and give your feedback. If everything is all right, let me know so that I can also add the same information to Zabbix 4.0 documentation.

RESOLVED

Comment by Natalja Cernohajeva (Inactive) [ 2018 Feb 09 ]

natalja.cernohajeva : also added to Zabbix 4.0 documentation.

RESOLVED

Generated at Thu Apr 25 18:19:01 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.