[ZBX-8728] ssh agent use {HOST.IP},22 instead of {HOST.IP},{HOST.PORT} Created: 2014 Sep 09  Updated: 2017 May 30  Resolved: 2014 Oct 13

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

Type: Incident report Priority: Trivial
Reporter: Valeriy Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: item, keys, validation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

centOS 6.5 x64
postgresql 9.3



 Description   

I have configure the template to use custom ip and port for ssh host:
ssh.run[ssh-i_load_1,{HOST.IP},{HOST.PORT},utf-8]

where:
HOST.IP=11.22.33.44
HOST.PORT=10050

Error message:

Cannot connect to ssh server: cannot connect to: [[11.22.33.44]:22]:[111] Connection refused

workaround:
ssh.run[ssh-i_load_1,11.22.33.44,10050,utf-8]
works fine, but I want to use linked template for all hosts with custom ip and ssh port.



 Comments   
Comment by Alexander Vladishev [ 2014 Sep 09 ]

Zabbix doesn't support {HOST.PORT} macro in item key parameters. You can use the user macros instead of it.

In any case Zabbix shouldn't process items with incorrect third parameter. It should be fixed.

Comment by Valeriy [ 2014 Sep 09 ]

Workaround with user macro works:

ssh.run[ssh-i_load_1,{HOST.IP},{$SSH_PORT},utf-8]

Where:
HOST.IP=11.22.33.44
{$SSH_PORT}=10050

Please, write about this limitation here:
https://www.zabbix.com/documentation/2.2/manual/config/items/itemtypes/ssh_checks

Comment by Andris Zeila [ 2014 Sep 10 ]

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

Note that the fix simply corrects the parameter parsing and will give error message about invalid third parameter in this case.

Regarding documentation - we have this (maybe not so nice) table, where you can check what macros are supported where:
https://www.zabbix.com/documentation/2.2/manual/appendix/macros/supported_by_location

Comment by Juris Miščenko (Inactive) [ 2014 Sep 10 ]

Changes successfully tested!

Comment by Alexander Vladishev [ 2014 Sep 10 ]

(1) It should be fixed for all checks, which use old-style item key parameters parsing

wiper RESOLVED

sasha CLOSED

Comment by Alexander Vladishev [ 2014 Sep 10 ]

(2) Possible memory leak in function get_value_ssh()

wiper RESOLVED in r48926

sasha REOPENED "out:" label should be located above free_request().

wiper RESOLVED in r48969

sasha CLOSED

Comment by Alexander Vladishev [ 2014 Sep 10 ]

(3) [trivial] Fixed formatting. Please review my changes in r48925.

wiper CLOSED

Comment by richlv [ 2014 Sep 28 ]

(9) commit message for r49429 says "added more error messages while processing internal checks" - if that's an improvement of the previous situation, it would be nice to list in whatsnew

also r49428 says "added more error messages while processing pinger checks"

sasha added error message: "Invalid item key format"

the user won't see this error message for two reasons:

  1. the incorrect key should be saved in the database. Frontend and API validate it before saving.
  2. the server validates it before processing of internal checks

It was added for a code consistency.

CLOSED

Comment by Andris Zeila [ 2014 Sep 29 ]

Releaed in:

  • pre-2.5.0 r49450
Comment by Andris Zeila [ 2014 Oct 13 ]

(12) The active check processing changes introduced memory leak if log/logrt fails. In this case the error message is always allocated and freed when failure is returned, which is only when the internal error counter reaches 3.

wiper fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-8728 r49787
RESOLVED

sasha CLOSED Take a look on my change in r50219.

wiper thanks, reviewed.

Comment by Andris Zeila [ 2014 Oct 28 ]

Released in:

  • pre-2.5.0 r50228
Generated at Thu Apr 25 18:05:22 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.