diff options
author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-02-05 07:20:08 +0000 |
---|---|---|
committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2003-02-05 07:20:08 +0000 |
commit | e67f7b41d0e755f746c2f44c5308df0782e2b77f (patch) | |
tree | 773c67b9c8eefbb9519b85096c19678e1681aaf4 /frontends/php/report3.php | |
parent | 68e27c6578178d6871d0b203d0151d4a24d56070 (diff) | |
download | zabbix-e67f7b41d0e755f746c2f44c5308df0782e2b77f.tar.gz zabbix-e67f7b41d0e755f746c2f44c5308df0782e2b77f.tar.xz zabbix-e67f7b41d0e755f746c2f44c5308df0782e2b77f.zip |
Improvements for report3.php
git-svn-id: svn://svn.zabbix.com/trunk@683 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/report3.php')
-rw-r--r-- | frontends/php/report3.php | 98 |
1 files changed, 18 insertions, 80 deletions
diff --git a/frontends/php/report3.php b/frontends/php/report3.php index 180a0bcf..b1ca8404 100644 --- a/frontends/php/report3.php +++ b/frontends/php/report3.php @@ -21,11 +21,14 @@ show_footer(); exit; } + $service=get_service_by_serviceid($HTTP_GET_VARS["serviceid"]); ?> <?php show_table_header_begin(); echo "IT SERVICES AVAILABILITY REPORT"; + echo "<br>"; + echo "<a href=\"srv_status.php?serviceid=".$service["serviceid"]."\">",$service["name"],"</a>";; show_table_v_delimiter(); @@ -51,7 +54,6 @@ <?php - $service=get_service_by_serviceid($HTTP_GET_VARS["serviceid"]); echo "<br>"; echo "<TABLE BORDER=0 COLS=3 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; @@ -60,7 +62,7 @@ echo "<TD WIDTH=15%><B>Till</B></TD>"; echo "<TD WIDTH=10%><B>OK</B></TD>"; echo "<TD WIDTH=10%><B>Problems</B></TD>"; - echo "<TD WIDTH=10%><B>Percentage</B></TD>"; + echo "<TD WIDTH=15%><B>Percentage</B></TD>"; echo "<TD><B>SLA</B></TD>"; echo "</TR>\n"; @@ -100,90 +102,26 @@ echo "<td>"; echo "<font color=\"00AA00\">$f_time</font>" ; echo "</td>"; echo "<td>"; echo "<font color=\"AA0000\">$t_time</a>" ; echo "</td>"; echo "<td>"; echo "<font color=\"00AA00\">$f</font>/<font color=\"AA0000\">$t</font>" ; echo "</td>"; - echo "<td></td>"; - - echo "</tr>"; - } - } - echo "</TABLE>"; - - show_footer(); - exit; -?> - - if(isset($HTTP_GET_VARS["hostid"])&&!isset($HTTP_GET_VARS["triggerid"])) - { - echo "<br>"; - $result=DBselect("select host from hosts where hostid=".$HTTP_GET_VARS["hostid"]); - $row=DBfetch($result); - show_table_header($row["host"]); - - $result=DBselect("select distinct h.hostid,h.host,t.triggerid,t.expression,t.description,t.value from triggers t,hosts h,items i,functions f where f.itemid=i.itemid and h.hostid=i.hostid and t.status=0 and t.triggerid=f.triggerid and h.hostid=".$HTTP_GET_VARS["hostid"]." and h.status in (0,2) and i.status=0 order by h.host, t.description"); - echo "<TABLE BORDER=0 COLS=3 WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; - echo "<TR>"; - echo "<TD><B>Description</B></TD>"; -// echo "<TD><B>Expression</B></TD>"; - echo "<TD WIDTH=5%><B>True</B></TD>"; - echo "<TD WIDTH=5%><B>False</B></TD>"; - echo "<TD WIDTH=5%><B>Unknown</B></TD>"; - echo "<TD WIDTH=5%><B>Graph</B></TD>"; - echo "</TR>\n"; - $col=0; - while($row=DBfetch($result)) - { - if(!check_right_on_trigger("R",$row["triggerid"])) + if($service["showsla"]==1) { - continue; + if($stat["ok"]>=$service["goodsla"]) + { + echo "<td><font color=\"00AA00\">".$service["goodsla"]."%</font></td>"; + } + else + { + echo "<td><font color=\"AA0000\">".$service["goodsla"]."%</font></td>"; + } } - $lasthost=$row["host"]; - - if($col++%2 == 1) { echo "<TR BGCOLOR=#DDDDDD>"; } - else { echo "<TR BGCOLOR=#EEEEEE>"; } - - $description=$row["description"]; - - if( strstr($description,"%s")) + else { - $description=expand_trigger_description($row["triggerid"]); + echo "<td>-</td>"; } - echo "<TD><a href=\"alarms.php?triggerid=".$row["triggerid"]."\">$description</a></TD>"; -// $description=rawurlencode($row["description"]); - -// echo "<TD>".explode_exp($row["expression"],1)."</TD>"; - $availability=calculate_availability($row["triggerid"],0,0); - echo "<TD>"; - printf("%.4f%%",$availability["true"]); - echo "</TD>"; - echo "<TD>"; - printf("%.4f%%",$availability["false"]); - echo "</TD>"; - echo "<TD>"; - printf("%.4f%%",$availability["unknown"]); - echo "</TD>"; - echo "<TD>"; - echo "<a href=\"report2.php?hostid=".$HTTP_GET_VARS["hostid"]."&triggerid=".$row["triggerid"]."\">Show</a>"; - echo "</TD>"; - echo "</TR>\n"; + + echo "</tr>"; } - echo "</table>\n"; } -?> - -<?php - if(isset($HTTP_GET_VARS["triggerid"])) - { - echo "<TABLE BORDER=0 COLS=4 align=center WIDTH=100% BGCOLOR=\"#CCCCCC\" cellspacing=1 cellpadding=3>"; - echo "<TR BGCOLOR=#EEEEEE>"; - echo "<TR BGCOLOR=#DDDDDD>"; - echo "<TD ALIGN=CENTER>"; - echo "<IMG SRC=\"chart4.php?triggerid=".$HTTP_GET_VARS["triggerid"]."\" border=0>"; - echo "</TD>"; - echo "</TR>"; - echo "</TABLE>"; - } -?> - + echo "</TABLE>"; -<?php show_footer(); ?> |