summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-12-29 12:10:56 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2004-12-29 12:10:56 +0000
commitca14a88699c81eb597ea4671c035d6e26af53de9 (patch)
treead77b9cfd8c8b0236d516f6e54c7de883099530a
parenta790c3ea95d122d3f4779bce8ae0468e4ff79121 (diff)
downloadzabbix-ca14a88699c81eb597ea4671c035d6e26af53de9.tar.gz
zabbix-ca14a88699c81eb597ea4671c035d6e26af53de9.tar.xz
zabbix-ca14a88699c81eb597ea4671c035d6e26af53de9.zip
Fixes for service availability report.
git-svn-id: svn://svn.zabbix.com/trunk@1568 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r--frontends/php/include/config.inc.php2
-rw-r--r--frontends/php/include/local_en.inc.php8
-rw-r--r--frontends/php/report3.php45
3 files changed, 31 insertions, 24 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index ecbee3cd..fc229949 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -1611,7 +1611,7 @@ echo "</head>";
$menu=array(
"view"=>array(
"label"=>"View",
- "pages"=>array("latest.php","tr_status.php","queue.php","latestalarms.php","alerts.php","maps.php","charts.php","screens.php","srv_status.php","alarms.php","history.php","tr_comments.php"),
+ "pages"=>array("latest.php","tr_status.php","queue.php","latestalarms.php","alerts.php","maps.php","charts.php","screens.php","srv_status.php","alarms.php","history.php","tr_comments.php","report3.php"),
"level2"=>array(
array("label"=>"Latest data","url"=>"latest.php"),
array("label"=>"Triggers","url"=>"tr_status.php?onlytrue=true&noactions=true&compact=true"),
diff --git a/frontends/php/include/local_en.inc.php b/frontends/php/include/local_en.inc.php
index b78183d9..d0939fa4 100644
--- a/frontends/php/include/local_en.inc.php
+++ b/frontends/php/include/local_en.inc.php
@@ -419,6 +419,14 @@
define("S_TRUE", "True");
define("S_FALSE", "False");
+// report3.php
+ define("S_FROM", "From");
+ define("S_TILL", "Till");
+ define("S_OK", "Ok");
+ define("S_PROBLEMS", "Problems");
+ define("S_PERCENTAGE", "Percentage");
+ define("S_SLA", "SLA");
+
// screenconf.php
define("S_SCREENS", "Screens");
define("S_SCREEN", "Screen");
diff --git a/frontends/php/report3.php b/frontends/php/report3.php
index 40b21c9b..fdc4a060 100644
--- a/frontends/php/report3.php
+++ b/frontends/php/report3.php
@@ -76,16 +76,8 @@
echo "<br>";
- echo "<TABLE BORDER=0 COLS=3 WIDTH=100% BGCOLOR=\"#AAAAAA\" cellspacing=1 cellpadding=3>";
- echo "<TR BGCOLOR=\"#CCCCCC\">";
- echo "<TD WIDTH=15%><B>From</B></TD>";
- 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=15%><B>Percentage</B></TD>";
- echo "<TD><B>SLA</B></TD>";
- echo "</TR>\n";
-
+ table_begin();
+ table_header(array(S_FROM,S_TILL,S_OK,S_PROBLEMS,S_PERCENTAGE,S_SLA));
$col=0;
$year=date("Y");
for($year=date("Y")-2;$year<=date("Y");$year++)
@@ -109,39 +101,46 @@
break;
}
$stat=calculate_service_availability($service["serviceid"],$period_start,$period_end);
-
- if($col++%2==0) { echo "<tr bgcolor=#EEEEEE>"; }
- else { echo "<tr bgcolor=#DDDDDD>"; }
- echo "<td>"; echo date("d M Y",$period_start); echo "</td>";
- echo "<td>"; echo date("d M Y",$period_end); echo "</td>";
+ $from=date("d M Y",$period_start);
+ $till=date("d M Y",$period_end);
+
$t=sprintf("%2.2f%%",$stat["problem"]);
$t_time=sprintf("%dd %dh %dm",$stat["problem_time"]/(24*3600),($stat["problem_time"]%(24*3600))/3600,($stat["problem_time"]%(3600))/(60));
$f=sprintf("%2.2f%%",$stat["ok"]);
$f_time=sprintf("%dd %dh %dm",$stat["ok_time"]/(24*3600),($stat["ok_time"]%(24*3600))/3600,($stat["ok_time"]%(3600))/(60));
- 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>";
+
+ $ok=array("value"=>$f_time,"class"=>"off");
+ $problems=array("value"=>$t_time,"class"=>"on");
+ $percentage=array("value"=>$f,"class"=>"off");
+
if($service["showsla"]==1)
{
if($stat["ok"]>=$service["goodsla"])
{
- echo "<td><font color=\"00AA00\">".$service["goodsla"]."%</font></td>";
+ $sla=array("value"=>$service["goodsla"],"class"=>"off");
}
else
{
- echo "<td><font color=\"AA0000\">".$service["goodsla"]."%</font></td>";
+ $sla=array("value"=>$service["goodsla"],"class"=>"on");
}
}
else
{
- echo "<td>-</td>";
+ $sla="-";
}
- echo "</tr>";
+ table_row(array(
+ $from,
+ $till,
+ $ok,
+ $problems,
+ $percentage,
+ $sla
+ ),$col++);
}
}
- echo "</TABLE>";
+ table_end();
show_footer();
?>