[ZBX-7023] Item became not supported: SQL query returned empty result. Created: 2013 Sep 18  Updated: 2017 May 30  Resolved: 2016 Sep 16

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 2.0.8
Fix Version/s: 2.0.8

Type: Incident report Priority: Minor
Reporter: Michael Wuerl Assignee: Unassigned
Resolution: Won't fix Votes: 1
Labels: database, odbc
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File screenshot-1.png     PNG File screenshot-2.png    
Issue Links:
Duplicate

 Description   

Hello, i have a similar problem to https://support.zabbix.com/browse/ZBX-5386.

I have created a new odbc sql query that makes a select on the db2 locklist table. If there is no lock, the table is empty and everything is fine. If the table is not empty, something in the database made a lock and should be triggered by zabbix.

Problem is: db.odbc.select[lockdb]] became not supported: SQL query returned empty result. This should have been fixed allready since we use 2.0.8.

I need the empty result as a valid result. Any solutions for that problem?



 Comments   
Comment by Alexander Vladishev [ 2013 Sep 18 ]

For example, you can resolve problem by this statement:

select case when exists(select null from <table_name>) then 1 else 0 end as colA from dual
Comment by Michael Wuerl [ 2013 Sep 19 ]

This statement still brings error - became not supported:SQL query returned empty result

Comment by Oleksii Zagorskyi [ 2013 Sep 19 ]

2.0.* supports empty values for string, text, log items !

Does it really sound like a bug ?

Comment by Grzegorz Grabowski [ 2016 Sep 16 ]

Still the same on 3.0 version. Empty value for String and Characters should be allowed.

Comment by Oleksii Zagorskyi [ 2016 Sep 16 ]

It's actually allowed.

Comment by richlv [ 2016 Sep 16 ]

mbsit, when you say that it is "the same", how have you configured the item and what errors do you get ?
as zalex_ua mentioned, empty values for character/text types have been allowed for a long time now.

Comment by Grzegorz Grabowski [ 2016 Sep 16 ]

v. 3.0.4

and configuration:

Bests,
Grzegorz

Comment by Oleksii Zagorskyi [ 2016 Sep 16 ]

Type of information Text allows to receive and store an empty value.
What is error message for the item status?

Comment by Grzegorz Grabowski [ 2016 Sep 16 ]

The error is on the screen you have to scroll horizontally my screenshot.

"SQL query returned empty result."

Comment by Grzegorz Grabowski [ 2016 Sep 16 ]

ODBC isql returns from this query:

+---------------------------------------------------------------------------------+-----------+--------------------+-----------------------------------------+
| xxxxxxxxxxxx                                                                        | xxxxxxxx| xxxxxxxx         | xxxxxx                                      |
+---------------------------------------------------------------------------------+-----------+--------------------+-----------------------------------------+
+---------------------------------------------------------------------------------+-----------+--------------------+-----------------------------------------+
SQLRowCount returns -1
SQL>

Bests,
Grzegorz

Comment by Oleksii Zagorskyi [ 2016 Sep 16 ]

Ahh, cool.

Well, "empty result" for an ODBC check in not the same like "empty value" to be stored in zabbix db.
ODBC check supposes to get at least one row, which looks in not the case for you!

Comment by Grzegorz Grabowski [ 2016 Sep 16 ]

So I will better say: "Empty result from ODBC should be allowed for String and Character data in Zabbix"

Comment by Oleksii Zagorskyi [ 2016 Sep 16 ]

My statement (assumption actually) above based on these 3 lines from doc :

The query must return one value only.
If a query returns more than one column, only the first column is read.
If a query returns more than one line, only the first line is read.

https://www.zabbix.com/documentation/3.0/manual/config/items/itemtypes/odbc_checks

But "magic" suggested by Alexander in very first comment could help you to find a workaround. Maybe the SQL have to adjusted for monitored DB engine.

well, I'd suggest you to create a new clean ZBXNEXT, mentioning this ZBX as a reference.
Any objections to close this one ?

Comment by Grzegorz Grabowski [ 2016 Sep 16 ]

No, I will this might be close, tnx.

Comment by Oleksii Zagorskyi [ 2016 Sep 16 ]

Closed as won't fix.
Not empty "Fix version" should be ignored.

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