summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2001-07-03 06:07:26 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2001-07-03 06:07:26 +0000
commit2c88dcbac3de23650e7fccaa91f003e9ae54550d (patch)
tree60f3f30933c79818480ae06b58f0e9b02c2317f0 /frontends/php/include
parente8371e423287f73f1ad30bc35a25bce761a0d27b (diff)
downloadzabbix-2c88dcbac3de23650e7fccaa91f003e9ae54550d.tar.gz
zabbix-2c88dcbac3de23650e7fccaa91f003e9ae54550d.tar.xz
zabbix-2c88dcbac3de23650e7fccaa91f003e9ae54550d.zip
Patches for alpha6->alpha7. Fixed bug with lost status of trigger.
git-svn-id: svn://svn.zabbix.com/trunk@122 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/config.inc25
1 files changed, 12 insertions, 13 deletions
diff --git a/frontends/php/include/config.inc b/frontends/php/include/config.inc
index a470d1aa..f30444fb 100644
--- a/frontends/php/include/config.inc
+++ b/frontends/php/include/config.inc
@@ -1300,6 +1300,7 @@
echo("<hr>");
+ echo "<center>";
// Start of <<< WEEK >>>
$tmp=$from+12*14;
echo("[<A HREF=\"history.html?action=showhistory&itemid=$itemid&from=$tmp&period=$period\">");
@@ -1366,8 +1367,7 @@
{
echo("[Week forward]");
}
-
- echo("</body></html>\n");
+ echo "</center>";
}
# Show history
@@ -1786,16 +1786,15 @@
function calculate_availability($triggerid)
{
- $result=DBselect("select min(clock),max(clock) from history");
- $ret["history_min_clock"]=DBget_field($result,0,0);
- $ret["history_max_clock"]=DBget_field($result,0,1);
+ $result=DBselect("select min(clock),max(clock) from alarms where triggerid=$triggerid");
+ $max=DBget_field($result,0,0);
+ $min=DBget_field($result,0,1);
- $result=DBselect("select min(clock),max(clock) from alarms");
- $ret["alarms_min_clock"]=DBget_field($result,0,0);
- $ret["alarms_max_clock"]=DBget_field($result,0,1);
-
- $min=min($ret["history_min_clock"],$ret["alarms_min_clock"]);
- $max=max($ret["history_max_clock"],$ret["alarms_max_clock"]);
+ if($max=="")
+ {
+ $max=time();
+ $min=time()-24*3600;
+ }
$sql="select clock,istrue from alarms where triggerid=$triggerid and clock>=$min and clock<=$max";
$result=DBselect($sql);
@@ -1804,7 +1803,7 @@
$state=-1;
$true_time=0;
$false_time=0;
- $time=$ret["history_min_clock"];
+ $time=$min;
$max=time();
for($i=0;$i<DBnum_rows($result);$i++)
{
@@ -1841,7 +1840,7 @@
if(DBnum_rows($result)==0)
{
- $false_time=$max-$ret["history_min_clock"];
+ $false_time=$max-$min;
}
else
{