summaryrefslogtreecommitdiffstats
path: root/frontends/php/chart_sla.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-10-23 07:34:27 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-10-23 07:34:27 +0000
commit28a09ed13e41ddbe5e30d63e92a1f5fb3395ef89 (patch)
tree8281ccd48964ee0dd11c5ea689091fa3cef706fb /frontends/php/chart_sla.php
parent495799b2aa61aab23d74d7faa110a0cd09d59bf0 (diff)
downloadzabbix-28a09ed13e41ddbe5e30d63e92a1f5fb3395ef89.tar.gz
zabbix-28a09ed13e41ddbe5e30d63e92a1f5fb3395ef89.tar.xz
zabbix-28a09ed13e41ddbe5e30d63e92a1f5fb3395ef89.zip
- developed group permission system (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@3371 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/chart_sla.php')
-rw-r--r--frontends/php/chart_sla.php73
1 files changed, 45 insertions, 28 deletions
diff --git a/frontends/php/chart_sla.php b/frontends/php/chart_sla.php
index 15caef6a..d5d36a04 100644
--- a/frontends/php/chart_sla.php
+++ b/frontends/php/chart_sla.php
@@ -19,52 +19,64 @@
**/
?>
<?php
- include "include/config.inc.php";
+ require_once "include/config.inc.php";
+ require_once "include/services.inc.php";
-# PARAMETERS:
-
-# itemid
-# period
-# from
+ $page["file"] = "chart_sla.php";
+ $page["title"] = "S_CHART";
+ $page["type"] = PAGE_TYPE_IMAGE;
- $sizeX=200;
- $sizeY=15;
+include_once "include/page_header.php";
- set_image_header();
+?>
+<?php
+// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
+ $fields=array(
+ "serviceid"=> array(T_ZBX_INT, O_MAND,P_SYS, DB_ID, null)
+ );
- check_authorisation();
+ check_fields($fields);
+?>
+<?php
+ $denyed_hosts = get_accessible_hosts_by_user($USER_DETAILS,PERM_READ_ONLY,PERM_MODE_LT);
+
+ if( !($service = DBfetch(DBselect("select s.* from services s left join triggers t on s.triggerid=t.triggerid ".
+ " left join functions f on t.triggerid=f.triggerid left join items i on f.itemid=i.itemid ".
+ " where (i.hostid is NULL or i.hostid not in (".$denyed_hosts.")) ".
+ /* " and ".DBid2nodeid("s.serviceid")."=".$ZBX_CURNODEID. */ /* NOTE: allow displaying all accessiables services */
+ " and s.serviceid=".$_REQUEST["serviceid"]
+ ))))
+ {
+ access_deny();
+ }
+?>
+<?php
+ $sizeX=200;
+ $sizeY=15;
$im = imagecreate($sizeX,$sizeY);
- $red=ImageColorAllocate($im,255,0,0);
- $darkred=ImageColorAllocate($im,150,0,0);
- $green=ImageColorAllocate($im,0,255,0);
- $darkgreen=ImageColorAllocate($im,0,150,0);
- $blue=ImageColorAllocate($im,0,0,255);
- $yellow=ImageColorAllocate($im,255,255,0);
- $cyan=ImageColorAllocate($im,0,255,255);
- $black=ImageColorAllocate($im,0,0,0);
- $gray=ImageColorAllocate($im,150,150,150);
- $white=ImageColorAllocate($im,255,255,255);
+ $red = ImageColorAllocate($im,255,0,0);
+ $darkred = ImageColorAllocate($im,150,0,0);
+ $green = ImageColorAllocate($im,0,255,0);
+ $darkgreen = ImageColorAllocate($im,0,150,0);
+ $blue = ImageColorAllocate($im,0,0,255);
+ $yellow = ImageColorAllocate($im,255,255,0);
+ $cyan = ImageColorAllocate($im,0,255,255);
+ $black = ImageColorAllocate($im,0,0,0);
+ $gray = ImageColorAllocate($im,150,150,150);
+ $white = ImageColorAllocate($im,255,255,255);
ImageFilledRectangle($im,0,0,$sizeX,$sizeY,ImageColorAllocate($im,120,200,120));
$now=time(NULL);
$period_start=$now-7*24*3600;
$period_end=$now;
- $service=get_service_by_serviceid($_REQUEST["serviceid"]);
$stat=calculate_service_availability($_REQUEST["serviceid"],$period_start,$period_end);
$problem=$stat["problem"];
$ok=$stat["ok"];
-// echo $problem," ",$ok;
-
-// for test
-// $problem=81;
-// $service["goodsla"]=81;
-
-// $p=min(100-$problem,20);
$p=min($problem,20);
$g=max($service["goodsla"]-80,0);
@@ -80,3 +92,8 @@
ImageOut($im);
ImageDestroy($im);
?>
+<?php
+
+include_once "include/page_footer.php";
+
+?>