[ZBXNEXT-1961] Database monitor ODBC connections should be dynamic without involving odbc.ini Created: 2013 Oct 10  Updated: 2024 Apr 10  Resolved: 2020 Mar 24

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Proxy (P), Server (S)
Affects Version/s: 2.0.9
Fix Version/s: 5.0.0alpha4, 5.0 (plan)

Type: New Feature Request Priority: Major
Reporter: Lewis Thompson Assignee: Andrejs Tumilovics
Resolution: Fixed Votes: 17
Labels: database, dsn, odbc, patch
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 12.04


Attachments: File change.diff     File odbc_dsn.diff     XML File zbx_export_hosts.xml    
Issue Links:
Duplicate
is duplicated by ZBXNEXT-2303 Database monitor items without DSN in... Closed
Team: Team C
Team: Team C
Sprint: Sprint 61 (Feb 2020), Sprint 62 (Mar 2020)
Story Points: 1

 Description   

Database monitor item types use ODBC as described in "ODBC monitoring" at https://www.zabbix.com/documentation/2.0/manual/config/items/itemtypes/odbc_checks

Everything in the docs suggest that in order to query a database it must first be defined in the odbc.ini file (usually located in /etc/odbc.ini). This seems to go against the otherwise self-contained nature of Zabbix, particularly host auto discovery and LLD.

My use case is:

  • LLD rule that runs against a host to get a list of databases
  • Run a set of stored procedures on each of the databases (using ODBC)
  • Alerts based on return values, etc.

The feature request is therefore that DSNs can be fully defined within Zabbix - e.g. hostname, database, username, password and connector (defined in odbcinst.ini).



 Comments   
Comment by Tatapoum [ 2015 Mar 11 ]

I've created a patch for this purpose (see attachment). It allows to define the ODBC item in two ways :
1) As before, using the data source name as set in /etc/odbc.ini :

db.odbc.select[unique_description,data_source_name]

2) Using a connection string :

db.odbc.select[unique_description,connection_string]

Example :

db.odbc.select[odbc.test,"DRIVER={FreeTDS};SERVER=MYSERVER\MYINSTANCE;UID=user;PWD=password"]

The patch is rebased against the trunk. Could you please consider adding it to the next release ?

Comment by Alexei Vladishev [ 2020 Feb 11 ]

It will simplify configuration of ODBC monitoring for many users. I included it into Zabbix 5.0 roadmap.

tatapoum, thanks for the patch!

Comment by Andrejs Tumilovics [ 2020 Mar 18 ]

Available in:

Documentation updated:

Generated at Sat Apr 20 16:06:59 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.