summaryrefslogtreecommitdiffstats
path: root/frontends/php/latest.php
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-06-12 20:20:55 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2003-06-12 20:20:55 +0000
commitf7cac54c235db36f17074bf78de5b30dd9415bcb (patch)
treed5c62f9da849ab0cbf2e0e11e49e18dc20b3d21b /frontends/php/latest.php
parent2d4065252826a4fe62ead51342a1f72516dbd32d (diff)
- added support for units (Mb, Kb, Gb, etc) (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@819 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/latest.php')
-rw-r--r--frontends/php/latest.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/frontends/php/latest.php b/frontends/php/latest.php
index a23f540d..03744509 100644
--- a/frontends/php/latest.php
+++ b/frontends/php/latest.php
@@ -228,11 +228,11 @@
}
if(isset($HTTP_GET_VARS["select"]))
{
- $result=DBselect("select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status=0 and i.description like '%".$HTTP_GET_VARS["select"]."%' ".$HTTP_GET_VARS["sort"]);
+ $result=DBselect("select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status=0 and i.description like '%".$HTTP_GET_VARS["select"]."%' ".$HTTP_GET_VARS["sort"]);
}
else
{
- $result=DBselect("select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status=0 and h.hostid=".$HTTP_GET_VARS["hostid"]." ".$HTTP_GET_VARS["sort"]);
+ $result=DBselect("select h.host,i.itemid,i.description,i.lastvalue,i.prevvalue,i.lastclock,i.status,h.hostid,i.value_type,i.units,i.multiplier from items i,hosts h where h.hostid=i.hostid and h.status in (0,2) and i.status=0 and h.hostid=".$HTTP_GET_VARS["hostid"]." ".$HTTP_GET_VARS["sort"]);
}
while($row=DBfetch($result))
{
@@ -276,7 +276,7 @@
if($row["value_type"] == 0 )
{
// echo "<td>"; printf("%.0f %s",$row["lastvalue"],$row["units"]); echo "</td>";
- echo "<td>"; echo convert_units($row["lastvalue"],$row["units"],0); echo "</td>";
+ echo "<td>"; echo convert_units($row["lastvalue"],$row["units"],$row["multiplier"]); echo "</td>";
}
else
{
@@ -286,7 +286,7 @@
else
{
// echo "<td>"; printf("%.2f %s",$row["lastvalue"],$row["units"]); echo "</td>";
- echo "<td>"; echo convert_units($row["lastvalue"],$row["units"],0); echo "</td>";
+ echo "<td>"; echo convert_units($row["lastvalue"],$row["units"],$row["multiplier"]); echo "</td>";
}
}
else
@@ -299,12 +299,12 @@
// sprintf("%+0.2f"); does not work
if($row["lastvalue"]-$row["prevvalue"]<0)
{
- echo "<td>";echo convert_units($row["lastvalue"]-$row["prevvalue"],$row["units"],0); echo "</td>";
+ echo "<td>";echo convert_units($row["lastvalue"]-$row["prevvalue"],$row["units"],$row["multiplier"]); echo "</td>";
// printf("<td>%0.2f</td>",$row["lastvalue"]-$row["prevvalue"]);
}
else
{
- echo "<td>+";echo convert_units($row["lastvalue"]-$row["prevvalue"],$row["units"],0); echo "</td>";
+ echo "<td>+";echo convert_units($row["lastvalue"]-$row["prevvalue"],$row["units"],$row["multiplier"]); echo "</td>";
// printf("<td>+%0.2f</td>",$row["lastvalue"]-$row["prevvalue"]);
}
}