[ZBX-3647] keys of external checks do not conform to the item key syntax Created: 2011 Mar 26  Updated: 2017 Oct 30  Resolved: 2011 Sep 09

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F), Server (S)
Affects Version/s: 1.8.4
Fix Version/s: 1.9.6 (beta), 2.0.0

Type: Problem report Priority: Blocker
Reporter: Robert Jerzak Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: externalchecks, trivial, usability
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by ZBXNEXT-952 Update of documentation 4.19.10 Exter... Closed
is duplicated by ZBX-2450 no security measures are taken for ex... Closed

 Description   

edit item, type: external check, key with quotation marks generate: Error in item key: incorrect syntax near '['

example:
Key: homepl.freeid["Auto UNIX" "free"]

generates:
Error in item key: incorrect syntax near '[' at position 13

changing key to:
homepl.freeid['Auto UNIX' 'free']

and fix the problem



 Comments   
Comment by richlv [ 2011 Mar 27 ]

could you please try with 1.8 svn head (or nightly snapshot) ?
it should be fixed along with ZBX-2012

edit : hmm, actually not. if you are trying to pass two parameters, they should be separated by comma, not space

Comment by Aleksandrs Saveljevs [ 2011 Mar 28 ]

Rich is right: homepl.freeid["Auto UNIX" "free"] is not a valid key. See http://www.zabbix.com/documentation/1.8/manual/config/items#item_key for item key syntax.

Comment by Robert Jerzak [ 2011 Mar 28 ]

Yes, it's true but this is extermal check and passing parameters to external script should be space separated.
If i use comma separated parameters then external script will not parse parameters in correct way.

Comment by Aleksandrs Saveljevs [ 2011 Mar 28 ]

We should probably make the documentation more clear that item keys for external checks accept only one string argument. We should also modify the server so that it validates the key and passes the first argument to the script, instead of passing everything between "[" and "]".

PS: Note that if you wish to pass "Auto UNIX" "free" to your external script, you can use homepl.freeid["\"Auto UNIX\" \"free\""] as the key.

EDIT: Actually, disregard the PS. You should be able to write it this way, but currently you cannot, because external check keys do not follow the syntax. Thanks for reopening!

Comment by richlv [ 2011 Sep 01 ]

just to clarify, it would be preferred if external check keys fully followed syntax - as in, allowed key[param1,param2,...]

Comment by Alexander Vladishev [ 2011 Sep 08 ]

Fixed in the development branch svn://svn.zabbix.com/branches/dev/ZBX-3647

Comment by richlv [ 2011 Sep 08 ]

does the fix change external key parameter format to the one other types have ( key[param1,param2,param3,...] ) ?

Comment by Rudolfs Kreicbergs [ 2011 Sep 08 ]

Decided to use the format suggested by Rich - "key[param1,param2,...]".

Comment by Alexander Vladishev [ 2011 Sep 08 ]

added multiple parameters for external checks in r21553.

Comment by richlv [ 2011 Sep 09 ]

this also solves ZBXNEXT-99 and ZBXNEXT-530

Comment by Alexander Vladishev [ 2011 Sep 09 ]

Available in version pre1.9.6, r21597.

Generated at Sat Apr 20 09:47:59 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.