[ZBXNEXT-2110] Empty string is valid return value Created: 2014 Jan 13  Updated: 2015 Mar 13  Resolved: 2015 Mar 13

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Server (S)
Affects Version/s: 2.0.10
Fix Version/s: None

Type: Change Request Priority: Minor
Reporter: Rob Northen Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: externalchecks, patch
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates ZBXNEXT-540 ZBX_NOTSUPPORTED from external scripts Open

 Description   

Hi,

I'm looking for a patch which was applied during ZBXNEXT-780.
It changed external scripts return value interpretation.
Now empty string is valid and does not make particular item 'not supported'.

I'm looking for a way to revert it back for my setup.
There is no dev/ZBXNEXT-780 branch in websvn interface (https://www.zabbix.org/websvn/).

Thank You very much.



 Comments   
Comment by Oleksii Zagorskyi [ 2014 Jan 14 ]

Hmm, it doesn't look like a feature request.
See https://www.zabbix.org/wiki/Docs/bug_reporting_guidelines

You can see changes when they were merged to trunk branch https://www.zabbix.org/websvn/wsvn/zabbix.com?op=comp&compare[]=%2F@19733&compare[]=%2F@19734

CLOSED.

Comment by Rob Northen [ 2014 Jan 16 ]

Hi Oleksiy,

Thank You for commit location.

If anyone is interested I've made simple patch for v2.0.9.

--- src/zabbix_server/poller/checks_external.c	2013-10-08 13:27:46.000000000 +0200
+++ src/zabbix_server/poller/checks_external.c	2014-01-15 08:16:45.978693607 +0100
@@ -94,7 +94,7 @@ int	get_value_external(DC_ITEM *item, AG
 	{
 		zbx_rtrim(buf, ZBX_WHITESPACE);
 
-		if (SUCCEED == set_result_type(result, item->value_type, item->data_type, buf))
+		if ((SUCCEED == set_result_type(result, item->value_type, item->data_type, buf)) && ('\0' != *buf))
 			ret = SUCCEED;
 
 		zbx_free(buf);

It will bring Zabbix 1.8 behaviour back. External scripts won't accept empty strings as return value any more.
It is not intended for main code inclusion.

Regards,
Rob

Comment by Rob Northen [ 2014 Nov 21 ]

Ok, here goes feature request.

Please add "./configure" option or "zabbix_server.conf" configuration variable to Zabbix which will define interpretation of empty strings as return values.
This feature is intended for items where "Type of information" is set to "Character".
In my Zabbix setup empty strings should be treated as "invalid value" but I guess other users need opposite behaviour.
I think setting it per item definition is overkill for now.

Thank You

Comment by richlv [ 2015 Mar 13 ]

closing as a duplicate of ZBXNEXT-540

Generated at Sat Apr 27 04:56:15 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.