[ZBX-7668] cannot send empty string with zabbix_sender if input is from file Created: 2014 Jan 17  Updated: 2017 May 30  Resolved: 2014 Feb 03

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 2.2.1
Fix Version/s: 2.2.2rc1, 2.3.0

Type: Incident report Priority: Minor
Reporter: Aleksandrs Saveljevs Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: sender
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

It is possible to send an empty string when passing it as the argument to -o option:

$ zabbix_sender -z 127.0.0.1 -s 'Zabbix server' -k trapper.item -o '' -vv
zabbix_sender [23565]: DEBUG: answer [

{ "response":"success", "info":"processed: 1; failed: 0; total: 1; seconds spent: 0.000094"}

]
info from server: "processed: 1; failed: 0; total: 1; seconds spent: 0.000094"
sent: 1; skipped: 0; total: 1

However, when passing input from file it complains about invalid line syntax:

$ echo '"Zabbix server" trapper.item ""' | zabbix_sender -z 127.0.0.1 -i - -vv
zabbix_sender [5969]: Warning: [line 1] 'Key value' required
Sending failed.



 Comments   
Comment by Juris Miščenko (Inactive) [ 2014 Jan 20 ]

Fixed in svn://svn.zabbix.com/branches/dev/ZBX-7668

Comment by richlv [ 2014 Jan 31 ]

(2) empty value quoting requirements should be documented in the manpage

jurism
Example of sending an empty value has been added to the manpage. Usage of double quotes to enclose the empty value has been mentioned.

sasha REOPENED

Incorrect example in man page. Double quotes should be escaped.

echo '"Zabbix server" trapper.item ' | zabbix_sender -z 192.168.1.113 -p 10000 -i -

jurism RESOLVED

Added quotation mark escaping in manpage.

sasha CLOSED

Comment by Juris Miščenko (Inactive) [ 2014 Feb 03 ]

Fixed in pre-2.2.2 r42143, pre-2.3.0 (trunk) r42144.

Generated at Thu Apr 25 15:06:40 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.