-
Incident report
-
Resolution: Fixed
-
Minor
-
3.0.8
-
None
-
Sprint 4, Sprint 5
-
0.5
SSH check stores the received value as a string without attempting to convert it to the item's value type. This leads to type conversion errors being silently ignored.
For example create ssh check with numeric data type and script 'echo A'. The received value 'A' will be ignored instead of making item notsupported with appropriate error message.
The following patch fixes it:
Index: src/zabbix_server/poller/checks_ssh.c =================================================================== --- src/zabbix_server/poller/checks_ssh.c (revision 66782) +++ src/zabbix_server/poller/checks_ssh.c (working copy) @@ -86,7 +86,7 @@ int auth_pw = 0, rc, ret = NOTSUPPORTED, exitcode, bytecount = 0; char buffer[MAX_BUFFER_LEN], buf[16], *userauthlist, - *publickey = NULL, *privatekey = NULL, *ssherr; + *publickey = NULL, *privatekey = NULL, *ssherr, *output; size_t sz; zabbix_log(LOG_LEVEL_DEBUG, "In %s()", __function_name); @@ -291,9 +291,11 @@ } buffer[bytecount] = '\0'; - SET_STR_RESULT(result, convert_to_utf8(buffer, bytecount, encoding)); + output = convert_to_utf8(buffer, bytecount, encoding); + if (SUCCEED == set_result_type(result, item->value_type, item->data_type, output)) + ret = SYSINFO_RET_OK; - ret = SYSINFO_RET_OK; + zbx_free(output); channel_close: /* close an active data channel */