[ZBX-5804] Overflow in calculated items Created: 2012 Nov 05 Updated: 2017 May 30 Resolved: 2014 Mar 03 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Server (S) |
Affects Version/s: | 2.0.3 |
Fix Version/s: | 2.0.12rc1, 2.2.3rc1, 2.3.0 |
Type: | Incident report | Priority: | Major |
Reporter: | Bart Verwilst | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 2 |
Labels: | calculateditems, overflow | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Description |
I have a calculated item ( Numeric Unsigned, unit s ) which does the following: last(system.localtime) - last(puppet.run.timestamp) It should return me the number of seconds since the last puppet run. Which it does fine until a new puppetrun runs. 2012.Nov.05 10:01:52 157 My guess is, because system.localtime is older ( and thus smaller, runs every 15 mins ) than puppet.run.timestamp ( updated every 120 secs ), the calculation is negative, and instead of returning 0, it overflows to a giant number? |
Comments |
Comment by richlv [ 2012 Nov 06 ] |
zabbix does not validate internal calculations against data type. while that could be added, it would break some assumptions (like using unsigned ints for network traffic)... not sure how to proceed |
Comment by Alexander Vladishev [ 2014 Feb 13 ] |
In this case item should change state to not supported. |
Comment by Juris Miščenko (Inactive) [ 2014 Feb 21 ] |
Added error message for overflown results calculated via incorrect values. |
Comment by Aleksandrs Saveljevs [ 2014 Feb 25 ] |
Development branch is svn://svn.zabbix.com/branches/dev/ZBX-5804 . |
Comment by Aleksandrs Saveljevs [ 2014 Feb 25 ] |
(1) In case of calculated items, the fix does not make the item go unsupported and no error message is shown in the frontend on overflow. In general, though, it would be nice to design a more general approach for handling overflow and unsuitable data. For instance, SSH checks that return "-1", which is unsuitable for unsigned integer type, do not go unsupported either and no error message is shown. So this task seems to cover a wider area that just calculated items and a substantial design for value conversion errors seems to be needed. jurism asaveljevs There is nothing to sync with the frontend. The item did not become unsupported and no error message was shown because "ret = NOTSUPPORTED;" was missing. asaveljevs The fix looks good now. We might wish to replace "Received..." with "Calculated...", but we might leave it for now for consistency. Please see r43122 before merging. asaveljevs Let's merge it into 2.0, 2.2 and trunk. After that, as sasha proposed, let's devise a more general solution for trunk only under this issue. No need to create another. |
Comment by Alexander Vladishev [ 2014 Mar 03 ] |
Comment by Juris Miščenko (Inactive) [ 2014 Mar 06 ] |
Fixed in 2.0.12rc1 r43267, 2.2.3rc1 r43268, 2.3.0 (trunk) r43269 |