[ZBX-12100] ssh check wrong type for numbers Created: 2017 Apr 24  Updated: 2024 Apr 10  Resolved: 2017 Apr 28

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 3.2.5rc1
Fix Version/s: 3.0.10rc1, 3.2.6rc1, 3.4.0alpha1, 3.4 (plan)

Type: Problem report Priority: Blocker
Reporter: Andrei Gushchin (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: ssh
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by ZBX-12129 ssh agent does not convert data types Closed
Team: Team A
Team: Team A
Sprint: Sprint 6
Story Points: 1

 Description   

I have the following item configured in a template assigned to a host.

Type: SSH Agent
Key: ssh.run[ssh host]
Executed script: echo 1 
Type of information: Numeric(Unsigned)
Data type: Decimal

This worked fine on Zabbix 3.2.4, but after upgrade to 3.2.5 I get:

 18668:20170424:132322.868 item "test:ssh.run[ssh uptime,,22]" became not supported: Received value [1] is not suitable for value type [Numeric (unsigned)] and data type [Decimal]


 Comments   
Comment by Vladislavs Sokurenko [ 2017 Apr 24 ]

Looks like it is correct behavior because echo adds new line character.
consider using printf 1

Comment by Oleksii Zagorskyi [ 2017 Apr 24 ]

A loooot of commands (if not all) adds new line character and I believe it should not be an issue for SSH checks.

Comment by Vladislavs Sokurenko [ 2017 Apr 25 ]

Reproduced in trunk.

steps:
1. Create item ssh.run[""] with command echo 4 and version prior to ZBX-11980
Actual/Expected:
Works ( you see values coming in latest data )

Upgrade to version after ZBX-11980 or simply apply changes from ZBX-11980.

Actual:
Item became not supported due to new line in echo.

Expected:
Must work as it used to. ( trailing new line and whitespace is trimmed )

Comment by Vladislavs Sokurenko [ 2017 Apr 25 ]

(1) To fix this we must remove formatting symbols from the end of the result, so it could be checked by "is_uint64" and "is_double" functions. ( this is how it worked before the fix )
vso RESOLVED in r67540

wiper CLOSED

Comment by Andris Zeila [ 2017 Apr 27 ]

Successfully tested

Comment by Vladislavs Sokurenko [ 2017 Apr 27 ]

Fixed in
pre-3.0.10rc1 r67641
pre-3.2.6rc1 r67643
pre-3.4.0alpha1 (trunk) r67647

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