[ZBX-5450] unit postfix cannot be used in the second parameter of count() function Created: 2012 Aug 14 Updated: 2017 May 30 Resolved: 2012 Aug 22 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Server (S) |
Affects Version/s: | 1.8.14, 2.0.2 |
Fix Version/s: | 1.8.16rc1, 2.0.3rc1, 2.1.0 |
Type: | Incident report | Priority: | Minor |
Reporter: | Kodai Terashima | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | triggers | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
Description |
Unit postfix (K, M,G, etc.) cannot be used in the second parameter of count() function. The trigger expression {hostname:itemkey.count(1m,930M,ge)}>0 is set, the trigger become PROBLEM when item received bigger than 930. Following is zabbix_server.log output when item received value "950". 31451:20120814:174826.288 In evaluate_COUNT() |
Comments |
Comment by Kodai Terashima [ 2012 Aug 14 ] |
line 490 in src/libs/zbxserver/evalfunc.c (In evaluate_COUNT): if (2 <= nparams && FAIL == get_function_parameter_str(item->hostid, parameters, 2, &arg2)) It seems that this part should use get_function_parameter_uint() when second parameter is numeric value (numeric_search is 1). <Sasha> The second parameter supports string for non-numeric items. We can't use the function get_function_parameter_uint() here. <Kodai> I am not really sure this is good solution or not, but my first idea is like below: if (2 <= nparams) { else { get_function_parameter_str() ... }} In this case, string in the second parameter can be used for only log/text item, and number for only uint/float item. But it seems reasonable for me. |
Comment by Alexander Vladishev [ 2012 Aug 22 ] |
Fixed in the development branch svn://svn.zabbix.com/branches/dev/ZBX-5450. |
Comment by dimir [ 2012 Aug 24 ] |
Successfully tested. Please review my small change in r29836. <Sasha> Thanks! |
Comment by Alexander Vladishev [ 2012 Aug 25 ] |
Fixed in pre-1.8.16 r29839, pre-2.0.3 29840 and pre-2.1.0 (trunk) 29841. |