diff options
author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-11-13 11:53:46 +0000 |
---|---|---|
committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-11-13 11:53:46 +0000 |
commit | 0877e5ce56b36b516107c117ea6859dffd463d85 (patch) | |
tree | 5daecebe9c20e601b2ceec3335449abde57a0c03 /frontends | |
parent | 8c79e63b4f2d603ab31ce6db251536d030620f53 (diff) | |
download | zabbix-0877e5ce56b36b516107c117ea6859dffd463d85.tar.gz zabbix-0877e5ce56b36b516107c117ea6859dffd463d85.tar.xz zabbix-0877e5ce56b36b516107c117ea6859dffd463d85.zip |
- merged 3458:3460 from (branches/1.1.4) [fixed graphs] (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3461 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/php/charts.php | 14 | ||||
-rw-r--r-- | frontends/php/include/classes/graph.inc.php | 11 |
2 files changed, 18 insertions, 7 deletions
diff --git a/frontends/php/charts.php b/frontends/php/charts.php index 932d7467..4617a441 100644 --- a/frontends/php/charts.php +++ b/frontends/php/charts.php @@ -45,7 +45,7 @@ include_once "include/page_header.php"; $fields=array( "groupid"=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID,NULL), "hostid"=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID,NULL), - "graphid"=> array(T_ZBX_INT, O_OPT, P_SYS|P_NZERO, DB_ID,NULL), + "graphid"=> array(T_ZBX_INT, O_OPT, P_SYS, DB_ID,NULL), "dec"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), "inc"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), "left"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), @@ -61,13 +61,19 @@ include_once "include/page_header.php"; check_fields($fields); ?> <?php - $_REQUEST["graphid"] = get_request("graphid", get_profile("web.charts.graphid", 0)); + if(isset($_REQUEST["graphid"]) && !isset($_REQUEST["hostid"])) + { + $_REQUEST["groupid"] = $_REQUEST["hostid"] = 0; + } + + $_REQUEST["graphid"] = get_request("graphid", get_profile("web.charts.grapgid", 0)); + $_REQUEST["keep"] = get_request("keep", 1); // possible excessed REQUEST variable !!! $_REQUEST["period"] = get_request("period",get_profile("web.graph[".$_REQUEST["graphid"]."].period", 3600)); - $effectiveperiod=navigation_bar_calc(); + $effectiveperiod = navigation_bar_calc(); - validate_group_with_host(PERM_READ_ONLY,array("allow_all_hosts","monitored_hosts","with_items")); + validate_group_with_host(PERM_READ_ONLY,array("allow_all_hosts","monitored_hosts","with_items", "always_select_first_host")); if($_REQUEST["graphid"] > 0 && $_REQUEST["hostid"] > 0) { diff --git a/frontends/php/include/classes/graph.inc.php b/frontends/php/include/classes/graph.inc.php index 753ce648..f7c2f751 100644 --- a/frontends/php/include/classes/graph.inc.php +++ b/frontends/php/include/classes/graph.inc.php @@ -40,6 +40,11 @@ define("GRAPH_TYPE_NORMAL", 0); define("GRAPH_TYPE_STACKED", 1); + define('ZBX_MAX_TREND_DIFF', 3600); + + define('ZBX_GRAPH_MAX_SKIP_CELL', 16); + define('ZBX_GRAPH_MAX_SKIP_DELAY', 4); + class Graph { var $period; @@ -921,7 +926,7 @@ } $sql_arr = array(); - if($this->period <= 24*3600) + 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,'. @@ -1205,9 +1210,9 @@ $delay = $this->items[$item]["delay"]; if($cell > $delay) - $draw = $diff < 16*$cell; + $draw = $diff < ZBX_GRAPH_MAX_SKIP_CELL * $cell; else - $draw = $diff < 4*$delay; + $draw = $diff < ZBX_GRAPH_MAX_SKIP_DELAY * $delay; if($draw == false && $this->items[$item]["calc_type"] == GRAPH_ITEM_AGGREGATED) $draw = $i - $j < 5; |