PDA

View Full Version : floating point issue


bibi23
29-11-2006, 16:05
Hi,

I install zabbix 1.1.4 and i found error with floating point data.
I want to monitor cpu load on linux host, but i get strange graph. see attached file.

Is there any fix for this problem ??

Thanks

my config:
Centos 4.4
php 5.1.6 / GD 2.0.28
memory limit = 16M
apache 2.0.59
oracle 10g XE

nereid
01-12-2006, 16:10
Hi

same problem here.

Value stored correctly in db but seem to be round when graphing.

load 0.9000 graph as 1

bibi23
05-12-2006, 11:47
Hi,

the problem seems to be related to the use of the function round in the function convert_units.

I comment round test line, and graph is OK.

Need more investigation by Project developpers.

the problem is visible for the net.tcp.service [pop] graph.

ex:
if($units=="")
{
### if(($value - round($value)) < 0.01)
### {
### return sprintf("%.0f",$value);
### }
### else
### {
return sprintf("%.2f",$value);
### }
}

Calimero
05-12-2006, 17:35
Same problem here. Solved it by changing config.inc.php as you did and it works fine now. Thanks :)

Small patch attached for the lazy ones :D

nbakker
07-12-2006, 16:51
Same problem here....