-
Incident report
-
Resolution: Duplicate
-
Major
-
None
-
2.4.6
-
None
-
root@zabbix:~# dpkg -l |grep zabbix
ii percona-zabbix-templates 1.1.5-1 all Percona Monitoring Plugins for Zabbix
ii zabbix-agent 1:2.4.6-1+trusty amd64 network monitoring solution - agent
ii zabbix-frontend-php 1:2.4.6-1+trusty all network monitoring solution - PHP front-end
ii zabbix-get 1:2.4.6-1+trusty amd64 network monitoring solution - get
ii zabbix-java-gateway 1:2.4.6-1+trusty amd64 network monitoring solution - java-gateway
ii zabbix-release 2.4-1+trusty all Zabbix official repository configuration
ii zabbix-sender 1:2.4.6-1+trusty amd64 network monitoring solution - sender
ii zabbix-server-mysql 1:2.4.6-1+trusty amd64 network monitoring solution - server (using MySQL)
root@zabbix:~# dpkg -l |grep odbc
ii libodbc1:amd64 2.2.14p2-5ubuntu5 amd64 ODBC library for Unix
ii odbcinst 2.2.14p2-5ubuntu5 amd64 Helper program for accessing odbc ini files
ii odbcinst1debian2:amd64 2.2.14p2-5ubuntu5 amd64 Support library for accessing odbc ini files
ii unixodbc 2.2.14p2-5ubuntu5 amd64 Basic ODBC tools
ii unixodbc-dev 2.2.14p2-5ubuntu5 amd64 ODBC libraries for UNIX (development files)
root@zabbix:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
##### Zabbix version #####
7942:20151015:105321.145 Starting Zabbix Server. Zabbix 2.4.6 (revision 54796).
7942:20151015:105321.145 ****** Enabled features ******
7942:20151015:105321.145 SNMP monitoring: YES
7942:20151015:105321.146 IPMI monitoring: YES
7942:20151015:105321.146 WEB monitoring: YES
7942:20151015:105321.146 VMware monitoring: YES
7942:20151015:105321.146 Jabber notifications: YES
7942:20151015:105321.146 Ez Texting notifications: YES
7942:20151015:105321.146 ODBC: YES
7942:20151015:105321.146 SSH2 support: YES
7942:20151015:105321.146 IPv6 support: YES
7942:20151015:105321.146 ******************************
7942:20151015:105321.146 using configuration file: /etc/zabbix/zabbix_server.conf
7942:20151015:105321.163 current database version (mandatory/optional): 02040000/02040000
7942:20151015:105321.163 required mandatory version: 02040000root@zabbix :~# dpkg -l |grep zabbix ii percona-zabbix-templates 1.1.5-1 all Percona Monitoring Plugins for Zabbix ii zabbix-agent 1:2.4.6-1+trusty amd64 network monitoring solution - agent ii zabbix-frontend-php 1:2.4.6-1+trusty all network monitoring solution - PHP front-end ii zabbix-get 1:2.4.6-1+trusty amd64 network monitoring solution - get ii zabbix-java-gateway 1:2.4.6-1+trusty amd64 network monitoring solution - java-gateway ii zabbix-release 2.4-1+trusty all Zabbix official repository configuration ii zabbix-sender 1:2.4.6-1+trusty amd64 network monitoring solution - sender ii zabbix-server-mysql 1:2.4.6-1+trusty amd64 network monitoring solution - server (using MySQL) root@zabbix :~# dpkg -l |grep odbc ii libodbc1:amd64 2.2.14p2-5ubuntu5 amd64 ODBC library for Unix ii odbcinst 2.2.14p2-5ubuntu5 amd64 Helper program for accessing odbc ini files ii odbcinst1debian2:amd64 2.2.14p2-5ubuntu5 amd64 Support library for accessing odbc ini files ii unixodbc 2.2.14p2-5ubuntu5 amd64 Basic ODBC tools ii unixodbc-dev 2.2.14p2-5ubuntu5 amd64 ODBC libraries for UNIX (development files) root@zabbix :~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS Release: 14.04 Codename: trusty ##### Zabbix version ##### 7942:20151015:105321.145 Starting Zabbix Server. Zabbix 2.4.6 (revision 54796). 7942:20151015:105321.145 ****** Enabled features ****** 7942:20151015:105321.145 SNMP monitoring: YES 7942:20151015:105321.146 IPMI monitoring: YES 7942:20151015:105321.146 WEB monitoring: YES 7942:20151015:105321.146 VMware monitoring: YES 7942:20151015:105321.146 Jabber notifications: YES 7942:20151015:105321.146 Ez Texting notifications: YES 7942:20151015:105321.146 ODBC: YES 7942:20151015:105321.146 SSH2 support: YES 7942:20151015:105321.146 IPv6 support: YES 7942:20151015:105321.146 ****************************** 7942:20151015:105321.146 using configuration file: /etc/zabbix/zabbix_server.conf 7942:20151015:105321.163 current database version (mandatory/optional): 02040000/02040000 7942:20151015:105321.163 required mandatory version: 02040000
I've setup a database monitor item to make a simple query in a MySQL database through ODBC. This is my Item configuration. I'll show only the parameters that I have changed:
Name: Ticket count
Type: Database monitor
Key: db.odbc.select[otrs.count.ticket,mysql56_otrs]
SQL query: select count(id) as total from ticket
Type of information: Numeric
Data type Decimal
History Storage Period: 7
Applications: OTRS
The above item was created in a template called "Template OTRS Stats" and it was associated to the mysql host.
My Zabbix server is compiled with ODBC support as showed in "Environment" section. The latest mysql odbc driver (mysql-connector-odbc-5.2.7-linux-glibc2.5-x86-64bit) downloaded from https://dev.mysql.com/downloads/connector/odbc/5.1.html was installed under /etc/zabbix/ and the owner of the files is the zabbix user:
root@zabbix:~# ls -lh /etc/zabbix/libmyodbc5* -rwxr-xr-x 1 zabbix zabbix 8,9M Out 15 12:45 /etc/zabbix/libmyodbc5a.so -rwxr-xr-x 1 zabbix zabbix 8,9M Out 15 12:45 /etc/zabbix/libmyodbc5w.so
There's no immutable flag set on those libraries:
root@zabbix:~# lsattr /etc/zabbix/libmyodbc5* -------------e-- /etc/zabbix/libmyodbc5a.so -------------e-- /etc/zabbix/libmyodbc5w.so
The unixODBC package is installed as showed in "Environment" section too. Here are the config files:
root@zabbix:~# cat /etc/odbcinst.ini [mysql_unicode] Driver=/etc/zabbix/libmyodbc5w.so [mysql_ansi] Driver=/etc/zabbix/libmyodbc5a.so root@zabbix:~# cat /etc/odbc.ini [mysql56_otrs] Driver=mysql_unicode Server=mysqlserver.domain Database=otrs Port=3306 Option=3 User=***** Password=******
I can connect to mysql server from zabbix server using isql:
root@zabbix:~# isql mysql56_otrs +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> select count(id) as total from ticket +---------------------+ | total | +---------------------+ | 70465 | +---------------------+ SQLRowCount returns 1 1 rows fetched SQL> quit
The item was not in unsupported state. But no data is registered under last data. So, I've turned zabbix into debug mode (debuglevel=4) and finally I've see an error message:
13849:20151015:122800.165 In substitute_key_macros() data:'db.odbc.select[otrs.count.ticket,mysql56_otrs]' 13849:20151015:122800.167 End of substitute_key_macros():SUCCEED data:'db.odbc.select[otrs.count.ticket,mysql56_otrs]' 13849:20151015:122800.173 In get_value() key:'db.odbc.select[otrs.count.ticket,mysql56_otrs]' 13849:20151015:122800.175 In get_value_db() key_orig:'db.odbc.select[otrs.count.ticket,mysql56_otrs]' 13849:20151015:122800.177 In odbc_DBconnect() db_dsn:'mysql56_otrs' user:'' 13849:20151015:122800.182 odbc_Diag(): rc_msg:'SQL_ERROR' rec_nr:1 sql_state:'01000' native_err_code:0 err_msg:'[unixODBC][Driver Manager]Can't open lib '/etc/zabbix/libmyodbc5w.so' : file not found' 13849:20151015:122800.184 End of odbc_DBconnect():FAIL
Why zabbix can't open lib '/etc/zabbix/libmyodbc5w.so' ???
Why zabbix doesn't put item into Unsupported state?
- duplicates
-
ZBX-7665 Zabbix 2.2.1 ODBC monitor crash - in "poller".
- Closed