diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-02-08 17:43:02 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-02-08 17:43:02 +0000 |
commit | a14c6e84bc4c7260b70bc6efaed54ececcbd65b4 (patch) | |
tree | 3937040bd8dbdc8b76d0b69d4a16e8adaa9e6b6b /frontends/php/overview.php | |
parent | cb6b5525e94b7f6f83737e7d826be072a6798419 (diff) | |
download | zabbix-a14c6e84bc4c7260b70bc6efaed54ececcbd65b4.tar.gz zabbix-a14c6e84bc4c7260b70bc6efaed54ececcbd65b4.tar.xz zabbix-a14c6e84bc4c7260b70bc6efaed54ececcbd65b4.zip |
Improvement for overview.php
git-svn-id: svn://svn.zabbix.com/trunk@1662 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/overview.php')
-rw-r--r-- | frontends/php/overview.php | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/frontends/php/overview.php b/frontends/php/overview.php index 7b780faf..00e197c6 100644 --- a/frontends/php/overview.php +++ b/frontends/php/overview.php @@ -89,7 +89,8 @@ $_GET["sort"]="description"; } - if(isset($_GET["groupid"])) + if(0) +// if(isset($_GET["groupid"])) { table_begin(); $header=array(" "); @@ -153,6 +154,77 @@ table_end(); show_table_header_end(); } + if(isset($_GET["groupid"])) + { + table_begin(); + $header=array(" "); + $hosts=array(); + $sql="select h.hostid,h.host from hosts h,items i,hosts_groups hg,functions f,triggers t where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid and hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid and t.triggerid=f.triggerid and f.itemid=i.itemid group by h.hostid,h.host order by h.host"; + $result=DBselect($sql); + while($row=DBfetch($result)) + { + $header=array_merge($header,array($row["host"])); + $hosts=array_merge($hosts,array($row["hostid"])); + } + table_header($header); + + $col=0; + if(isset($_GET["sort"])) + { + switch ($_GET["sort"]) + { + case "description": + $_GET["sort"]="order by i.description"; + break; + case "lastcheck": + $_GET["sort"]="order by i.lastclock"; + break; + default: + $_GET["sort"]="order by i.description"; + break; + } + } + else + { + $_GET["sort"]="order by i.description"; + } +// $sql="select distinct description from items order by 1;"; + $sql="select distinct t.description from hosts h,items i,hosts_groups hg,triggers t,functions f where h.status=".HOST_STATUS_MONITORED." and h.hostid=i.hostid and hg.groupid=".$_GET["groupid"]." and hg.hostid=h.hostid and t.triggerid=f.triggerid and f.itemid=i.itemid order by 1"; + $result=DBselect($sql); + while($row=DBfetch($result)) + { + $rows=array(nbsp($row["description"])); + foreach($hosts as $hostid) + { + $sql="select t.status,t.value from triggers t,functions f,items i where f.triggerid=t.triggerid and i.itemid=f.itemid and i.hostid=$hostid and t.description='".addslashes($row["description"])."'"; + $result2=DBselect($sql); + if(DBnum_rows($result2)==1) + { + $row2=DBfetch($result2); + if($row2["status"]==0) + { + if($row2["value"] == TRIGGER_VALUE_FALSE) + $value=array("value"=>" ","class"=>"normal"); + else + $value=array("value"=>" ","class"=>"high"); + } + else + { + $value=" "; + } + } + else + { + $value=" "; + } + $rows=array_merge($rows,array($value)); + } + + table_row($rows, $col++); + } + table_end(); + show_table_header_end(); + } else { echo "<TABLE BORDER=0 align=center COLS=4 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; |