From 2d76733fbfa2cdb0935210e524f373c18ef47ee9 Mon Sep 17 00:00:00 2001 From: osmiy Date: Wed, 7 Feb 2007 09:27:20 +0000 Subject: - fixed graphs in Oracle system (Eugene) - fixed trigger expressions with ':' (Eugene) - fixed 'Server info' screen componets (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@3804 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/classes/graph.inc.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'frontends/php/include/classes/graph.inc.php') diff --git a/frontends/php/include/classes/graph.inc.php b/frontends/php/include/classes/graph.inc.php index 9daa0f67..88a54a7f 100644 --- a/frontends/php/include/classes/graph.inc.php +++ b/frontends/php/include/classes/graph.inc.php @@ -985,32 +985,33 @@ $to_time = $this->to_time; } + $calc_field = 'round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0)'; /* required for 'group by' support of Oracle */ $sql_arr = array(); if(($this->period / $this->sizeX) <= (ZBX_MAX_TREND_DIFF / ZBX_GRAPH_MAX_SKIP_CELL)) { array_push($sql_arr, - 'select itemid,round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0) as i,'. + 'select itemid,'.$calc_field.' as i,'. ' count(*) as count,avg(value) as avg,min(value) as min,'. ' max(value) as max,max(clock) as clock'. ' from history where itemid='.$this->items[$i]['itemid'].' and clock>='.$from_time. - ' and clock<='.$to_time.' group by itemid, i' //' round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0)', + ' and clock<='.$to_time.' group by itemid,'.$calc_field , - 'select itemid,round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0) as i,'. + 'select itemid,'.$calc_field.' as i,'. ' count(*) as count,avg(value) as avg,min(value) as min,'. ' max(value) as max,max(clock) as clock'. ' from history_uint where itemid='.$this->items[$i]['itemid'].' and clock>='.$from_time. - ' and clock<='.$to_time.' group by itemid, i' //' round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0)' + ' and clock<='.$to_time.' group by itemid,'.$calc_field ); } else { array_push($sql_arr, - 'select itemid,round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0) as i,'. + 'select itemid,'.$calc_field.' as i,'. ' sum(num) as count,avg(value_avg) as avg,min(value_min) as min,'. ' max(value_max) as max,max(clock) as clock'. ' from trends where itemid='.$this->items[$i]['itemid'].' and clock>='.$from_time. - ' and clock<='.$to_time.' group by itemid, i' //' round('.$x.'*(mod(clock+'.$z.','.$p.'))/('.$p.'),0)' + ' and clock<='.$to_time.' group by itemid,'.$calc_field ); } -- cgit