[ZBX-12048] DB Monitoring result truncated in 2.2.17 Created: 2017 Apr 13  Updated: 2017 May 30  Resolved: 2017 May 15

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

Type: Incident report Priority: Major
Reporter: Dmitry Samsonov Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Centos 7.2
unixODBC-2.3.2
freetds 0.91
MSSQL 2005


Issue Links:
Duplicate
duplicates ZBX-11584 Only first character saved in data wh... Closed

 Description   

After upgrading from 2.2.5 to 2.2.17 database monitoring results from MSSQL are truncated to 1 character.

Apr 13 17:17:40 XXXXX zabbix_server[21082]: odbc_DBconnect() connected to Microsoft SQL Server(09.00.5000) using libtdsodbc.so(0.91)
Apr 13 17:17:40 XXXXX zabbix_server[21082]: End of odbc_DBconnect():SUCCEED
Apr 13 17:17:40 XXXXX zabbix_server[21082]: In odbc_DBselect() query:'SELECT ISNULL(#015#012(SELECT primary_database + ' ' + CAST(last_backup_date AS varchar) + '; ' AS [text()]#01
5#012FROM log_shipping_monitor_primary#015#012WHERE threshold_alert_enabled = 1 and datediff(minute, last_backup_date_utc, getutcdate()) > backup_threshold#015#012FOR XML PATH (''))
#015#012, 'OK')'
Apr 13 17:17:40 XXXXX zabbix_server[21082]: odbc_DBselect() selected 1 columns
Apr 13 17:17:40 XXXXX zabbix_server[21082]: End of odbc_DBselect()
Apr 13 17:17:40 XXXXX zabbix_server[21082]: In odbc_DBfetch()
Apr 13 17:17:40 XXXXX zabbix_server[21082]: odbc_DBfetch() fetched [0 col (-10)]: 'O'
Apr 13 17:17:40 XXXXX zabbix_server[21082]: End of odbc_DBfetch()
Apr 13 17:17:40 XXXXX zabbix_server[21082]: End of get_value_db():SUCCEED
Apr 13 17:17:40 XXXXX zabbix_server[21082]: End of get_value():SUCCEED
Apr 13 17:17:40 XXXXX zabbix_server[21082]: In activate_host() hostid:13456 itemid:724960 type:11
Apr 13 17:17:40 XXXXX zabbix_server[21082]: End of activate_host()
Apr 13 17:17:40 XXXXX zabbix_server[21082]: End of get_values():1
Apr 13 17:17:40 XXXXX zabbix_server[21082]: In DCconfig_get_poller_nextcheck() poller_type:0
Apr 13 17:17:40 XXXXX zabbix_server[21082]: End of DCconfig_get_poller_nextcheck():1492093061
Apr 13 17:17:40 XXXXX zabbix_server[21082]: poller #32 [got 1 values in 0.095940 sec, idle 1 sec]
Apr 13 17:17:40 XXXXX zabbix_server[21762]: http poller #27 [got 0 values in 0.000403 sec, getting values]

Expected result: "OK"

Queries to mysql works as expected.

Probably this is caused by ZBX-8489 and not fixed in ZBX-11213.

P.S. looks like such big changes as in ZBX-8489 are not appropriate for LTS release



 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2017 Apr 13 ]

Apologies.. This is a duplicate of ZBX-11584. I have no idea why 2.2 was left out by it, but here is the patch:

Index: src/libs/zbxdbhigh/odbc.c
===================================================================
--- src/libs/zbxdbhigh/odbc.c	(revision 64997)
+++ src/libs/zbxdbhigh/odbc.c	(revision 64998)
@@ -305,7 +305,7 @@
 		switch ((int)col_type)
 		{
 			case SQL_WLONGVARCHAR:
-				c_type = SQL_C_BINARY;
+				c_type = SQL_C_DEFAULT;
 				break;
 			default:
 				c_type = SQL_C_CHAR;
Comment by Oleksii Zagorskyi [ 2017 Apr 13 ]

Affects Version/s in the ZBX-11584 filled only by "3.0.6" value ....

Comment by Glebs Ivanovskis (Inactive) [ 2017 May 15 ]

Closing as Duplicate of ZBX-11584.

Generated at Fri Mar 29 12:19:07 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.