[ZBX-11515] Can't query oracle database Created: 2016 Nov 23  Updated: 2017 May 30  Resolved: 2016 Dec 13

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 3.2.1
Fix Version/s: None

Type: Incident report Priority: Critical
Reporter: Mariusz Litwińczuk Assignee: Unassigned
Resolution: Duplicate Votes: 1
Labels: usability
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS 7


Attachments: PNG File odbc_errors.png    
Issue Links:
Duplicate
duplicates ZBX-11213 DB Monitoring stopped working after u... Closed

 Description   

I have problem with query Oracle database (12c) from zabbix 3.2 (installed on Centos 7 + zabbix from rpm packages).
I also installed oracle instant-client and ODBC package.

I need to query database with different queries. Now I created item "Database monitor" with simple query.
In item page is described now as "Not supported".

Quote:

[root@zabbix3 ~]# yum list installed | grep -i odbc
mysql-connector-odbc.x86_64 5.2.5-6.el7 @RHEL-7.2
oracle-instantclient12.1-odbc.x86_64 12.1.0.2.0-1 @/oracle-instantclient12.1-odbc-12.1.0.2.0-1.x86_64
php-odbc.x86_64 5.4.16-36.el7_1 @RHEL-7.2
unixODBC.x86_64 2.3.1-11.el7 @base
unixODBC-devel.x86_64 2.3.1-11.el7 @RHEL-7.2

[root@zabbix3 ~]# yum list installed | grep -i oracle
oracle-instantclient12.1-basic.x86_64 12.1.0.2.0-1 @/oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64
oracle-instantclient12.1-devel.x86_64 12.1.0.2.0-1 @/oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64
oracle-instantclient12.1-jdbc.x86_64 12.1.0.2.0-1 @/oracle-instantclient12.1-jdbc-12.1.0.2.0-1.x86_64
oracle-instantclient12.1-odbc.x86_64 12.1.0.2.0-1 @/oracle-instantclient12.1-odbc-12.1.0.2.0-1.x86_64
oracle-instantclient12.1-sqlplus.x86_64 12.1.0.2.0-1 @/oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64

– odbc.ini configuration
Quote:

[root@zabbix3 ~]# cat /etc/odbc.ini
[<DATABASE NAME>]
Driver=Oracle
ServerName=//aa.bb.cc.dd:1521/<service name>
Database=<DATABASE LINK NAME>
DSN=<DATABASE NAME>
Port=1521
#UserID=MY_DATABASE_USER>
#Password=DATABASE_USER_PASSWORD

I created odbc connection and it's fully working from OS commandline.
Also manually and as command.

Fired up manually - works.
Quote:

[root@zabbix3 ~]# isql -v <DATABASE LINK NAME> <USERNAME>/<PASSWORD> -b < sql.txt
+-----------------------------------------+
| COUNT(1) |
+-----------------------------------------+
| 465 |
+-----------------------------------------+
SQLRowCount returns -1
1 rows fetched

Quote:
[root@zabbix3 ~]# isql -v <DATABASE LINK NAME> <USERNAME>/<PASSWORD>
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> select count(1) from sm_zas_obiekty_glowne
+-----------------------------------------+
| COUNT(1) |
+-----------------------------------------+
| 465 |
+-----------------------------------------+
SQLRowCount returns -1
1 rows fetched

– I can also get that data from shell (create a script?), but this is not acceptable solution for me.
Quote:

[root@zabbix3 ~]# isql -v <DATABASE NAME> <USERNAME>/<PASSWORD> -b < sql.txt | head -4 | tail -1 | awk '{print $2}'
465

– In zabbix debug log i see that:
Quote:

41821:20161121:085047.824 In odbc_DBconnect() db_dsn:'<DATABASE NAME>' user:'<DATABASE USERNAME>'
41821:20161121:085047.910 End of odbc_DBconnect():SUCCEED
41821:20161121:085047.910 In odbc_DBselect() query:'select count(1) from sm_zas_obiekty_glowne'
41821:20161121:085047.914 odbc_DBselect() selected 1 columns
41821:20161121:085047.914 End of odbc_DBselect()
41821:20161121:085047.914 In odbc_DBfetch()
41821:20161121:085047.915 odbc_Diag(): rc_msg:'SQL_SUCCESS_WITH_INFO' rec_nr:1 sql_state:'01004' native_err_code:0 err_msg:'[Oracle][ODBC]String data, right truncated.'
41821:20161121:085047.915 odbc_DBfetch() fetched [0 col]: '<B8>W<A1><A1><95>^?'
41821:20161121:085047.915 End of odbc_DBfetch()
41821:20161121:085047.919 End of db_odbc_select():NOTSUPPORTED
41821:20161121:085047.919 End of get_value_db():NOTSUPPORTED
41821:20161121:085047.919 Item [proxy2b.kgp.lan:db.odbc.select[<DATABASE NAME>_test,<DATABASE NAME>]] error: Received value [?W???^?] is not suitable for value type [Numeric (float)]
41821:20161121:085047.919 End of get_value():NOTSUPPORTED
41821:20161121:085047.919 In activate_host() hostid:10177 itemid:24047 type:11
41821:20161121:085047.919 End of activate_host()
41821:20161121:085047.919 End of get_values():1

= it's look like there are problem with connect to database.
Quote:

41821:20161121:085047.915 odbc_Diag(): rc_msg:'SQL_SUCCESS_WITH_INFO' rec_nr:1 sql_state:'01004' native_err_code:0 err_msg:'[Oracle][ODBC]String data, right truncated.'
41821:20161121:085047.915 odbc_DBfetch() fetched [0 col]: '<B8>W<A1><A1><95>^?'

I tried:

  • add/remove user + password to odbc configuration.
  • use password (or without it when added to odbc) in zabbix configuration
  • change type of data gathered from zabbix to text / log
  • change number precision (float / usigned)

... all without success. As I see, this is a problem with connection to database.
It's strange because it's work without any problem from linux commandline (in both version with password in odbc or without it (isql -v <DATABASE LINK>)

Any help?

One note : from time to time this connection message from database in log (Received value [....]) are changed from one to another - like [?G?t] or [XSWISS] [?] [?H?t] - like random value ... :/



 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2016 Nov 23 ]

Nice to see such an elaborate bug report!

Unfortunately, this is a bit hollow since this issue is already fixed (but not released yet).

Closing as duplicate of ZBX-11213. See this issue for possible temporary workarounds.

Comment by Mariusz Litwińczuk [ 2016 Dec 02 ]

https://www.zabbix.com/forum/showpost.php?p=192662&postcount=12

Tested by one of the users.
Problem not resolved.
(tested on 3.2.2rc1)

Comment by Mariusz Litwińczuk [ 2016 Dec 02 ]

Screenshot with errors.

Comment by Glebs Ivanovskis (Inactive) [ 2016 Dec 02 ]

I can see that frontend is 3.2.2rc1. Have you updated server too?

Comment by Glebs Ivanovskis (Inactive) [ 2016 Dec 02 ]

Anyway, it is still a duplicate. If you have concerns about the fix, please share them in ZBX-11213.

Comment by Mariusz Litwińczuk [ 2016 Dec 02 ]

By other user:
"I have exactly the same error with version 3.2.1. And also with version 3.2.2rc1
I've installed it on a virtual machine and I see the same results in the zabbix_server.log as in version 3.2.1 so it seems the bug is still there."

Comment by Mariusz Litwińczuk [ 2016 Dec 05 ]

"I saw an comment about the updated frontend... of course it's also the server that is running on version 3.2.2.rc1. Not only the frontend, also the database etc."

Glebs, can you explain me one thing?
If this case are closed, why main (ZBX-12213) are not open when problem are still not solved and bug still exists?

There are no workaround for this issue described in this thread

I've opened this one again because I don't know do you read this message when case are closed. Just close it if needed.... and please repair this bug :/
When compiled rpm after repairing will be available?

Comment by Mariusz Litwińczuk [ 2016 Dec 05 ]

problem still alive, I can't open closed ZBX-11213.

Comment by Glebs Ivanovskis (Inactive) [ 2016 Dec 05 ]

This (ZBX-11515) is the same bug as ZBX-11213. That's why I'm inclined to close it as a duplicate.

If you think that proper fix wasn't provided in ZBX-11213, then, please, leave at least a comment there. It will be very nice if you provide more evidence there as well. Developers who made the fix are still watching ZBX-11213. It's counter-productive to discuss your problems in five separate places.

Comment by Mariusz Litwińczuk [ 2016 Dec 05 ]

I know, but I'm not sure, that you checking for new comments in closed cases.

Comment by Aleksandrs Saveljevs [ 2016 Dec 13 ]

According to https://www.zabbix.com/forum/showpost.php?p=193015&postcount=24 , it may already be working for you. Is there anything left to fix here?

Comment by Mariusz Litwińczuk [ 2016 Dec 13 ]

Tested with rpm 3.2.2. from zabbix repo.
Works fine - problem solved.

Comment by Mariusz Litwińczuk [ 2016 Dec 13 ]

Problem solved. Thanks!

Comment by Aleksandrs Saveljevs [ 2016 Dec 13 ]

Thanks for the update!

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