diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-03-05 09:22:24 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-03-05 09:22:24 +0000 |
commit | 7c4f25b1b77a6aa91c037bfb0e05ebb141e0b215 (patch) | |
tree | 1fa768924e782dfb8ce9aec2c18b9567d81f9aeb /frontends/php/queue.php | |
parent | 3a46d9586379cfd315aff0c4f122ba6aabb738f2 (diff) | |
download | zabbix-7c4f25b1b77a6aa91c037bfb0e05ebb141e0b215.tar.gz zabbix-7c4f25b1b77a6aa91c037bfb0e05ebb141e0b215.tar.xz zabbix-7c4f25b1b77a6aa91c037bfb0e05ebb141e0b215.zip |
- Overview and Details mode for screen Queue (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@1686 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/queue.php')
-rw-r--r-- | frontends/php/queue.php | 73 |
1 files changed, 63 insertions, 10 deletions
diff --git a/frontends/php/queue.php b/frontends/php/queue.php index 25fdaa20..71b9b945 100644 --- a/frontends/php/queue.php +++ b/frontends/php/queue.php @@ -36,7 +36,21 @@ ?> <?php - show_table_header(S_QUEUE_OF_ITEMS_TO_BE_UPDATED_BIG); + if(!isset($_GET["show"])) + { + $_GET["show"]=0; + } + + $h1=S_QUEUE_OF_ITEMS_TO_BE_UPDATED_BIG; + +# $h2=S_GROUP." "; + $h2=""; + $h2=$h2."<select class=\"biginput\" name=\"show\" onChange=\"submit()\">"; + $h2=$h2."<option value=\"0\" ".iif($_GET["show"]==0,"selected","").">".S_OVERVIEW; + $h2=$h2."<option value=\"1\" ".iif($_GET["show"]==1,"selected","").">".S_DETAILS; + $h2=$h2."</select>"; + + show_header2($h1, $h2, "<form name=\"selection\" method=\"get\" action=\"queue.php\">", "</form>"); ?> <?php @@ -44,20 +58,59 @@ $result=DBselect("select i.itemid, i.nextcheck, i.description, h.host,h.hostid from items i,hosts h where i.status=0 and i.type not in (2) and ((h.status=".HOST_STATUS_MONITORED." and h.available!=".HOST_AVAILABLE_FALSE.") or (h.status=".HOST_STATUS_MONITORED." and h.available=".HOST_AVAILABLE_FALSE." and h.disable_until<=$now)) and i.hostid=h.hostid and i.nextcheck<$now and i.key_ not in ('status','icmpping','icmppingsec','zabbix[log]') order by i.nextcheck"); table_begin(); - table_header(array(S_NEXT_CHECK,S_HOST,S_DESCRIPTION)); - $col=0; - while($row=DBfetch($result)) + if($_GET["show"]==0) { - if(!check_right("Host","R",$row["hostid"])) + $sec_5=0; + $sec_10=0; + $sec_30=0; + $sec_60=0; + $sec_300=0; + $sec_rest=0; + while($row=DBfetch($result)) { - continue; + if(!check_right("Host","R",$row["hostid"])) + { + continue; + } + if($now-$row["nextcheck"]<=5) $sec_5++; + elseif($now-$row["nextcheck"]<=10) $sec_10++; + elseif($now-$row["nextcheck"]<=30) $sec_30++; + elseif($now-$row["nextcheck"]<=60) $sec_60++; + elseif($now-$row["nextcheck"]<=300) $sec_300++; + else $sec_rest++; + } - $elements=array(date("m.d.Y H:i:s",$row["nextcheck"]),$row["host"],$row["description"]); + table_header(array(S_DELAY,S_COUNT)); + $elements=array(S_5_SECONDS,$sec_5); + table_row($elements,$col++); + $elements=array(S_10_SECONDS,$sec_10); + table_row($elements,$col++); + $elements=array(S_30_SECONDS,$sec_30); table_row($elements,$col++); + $elements=array(S_1_MINUTE,$sec_60); + table_row($elements,$col++); + $elements=array(S_5_MINUTES,$sec_300); + table_row($elements,$col++); + $elements=array(S_MORE_THAN_5_MINUTES,$sec_rest); + table_row($elements,$col++); + } + else + { + table_header(array(S_NEXT_CHECK,S_HOST,S_DESCRIPTION)); + $col=0; + while($row=DBfetch($result)) + { + if(!check_right("Host","R",$row["hostid"])) + { + continue; + } + $elements=array(date("m.d.Y H:i:s",$row["nextcheck"]),$row["host"],$row["description"]); + table_row($elements,$col++); + } + iif_echo(DBnum_rows($result)==0, + "<TR BGCOLOR=#EEEEEE><TD COLSPAN=3 ALIGN=CENTER>".S_THE_QUEUE_IS_EMPTY."</TD><TR>", + ""); } - iif_echo(DBnum_rows($result)==0, - "<TR BGCOLOR=#EEEEEE><TD COLSPAN=3 ALIGN=CENTER>".S_THE_QUEUE_IS_EMPTY."</TD><TR>", - ""); table_end(); ?> |