summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-07-23 17:06:33 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2002-07-23 17:06:33 +0000
commitce2bf1099ecb5b4087184a88c8cf648a034ab690 (patch)
treed1658c16a0f82736c5543d3564e2580ed6d18258 /frontends/php/include
parent18f62b7d06dedf74b30899302019e847ab287183 (diff)
downloadzabbix-ce2bf1099ecb5b4087184a88c8cf648a034ab690.tar.gz
zabbix-ce2bf1099ecb5b4087184a88c8cf648a034ab690.tar.xz
zabbix-ce2bf1099ecb5b4087184a88c8cf648a034ab690.zip
- fixed crash in case if MySQL server gone (support for signal PIPE) (Alexei)
Thanks to Arturs. - fixed duplicate triggers in Availability Report (Alexei) - fixed division by zero in Availability Report (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@440 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/config.inc.php24
1 files changed, 18 insertions, 6 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index d5491670..82a36f25 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -3258,12 +3258,24 @@ where h.hostid=i.hostid and i.itemid=f.itemid and f.triggerid=$triggerid";
// echo "$true_time $false_time $unknown_time";
$total_time=$true_time+$false_time+$unknown_time;
- $ret["true_time"]=$true_time;
- $ret["false_time"]=$false_time;
- $ret["unknown_time"]=$unknown_time;
- $ret["true"]=(100*$true_time)/$total_time;
- $ret["false"]=(100*$false_time)/$total_time;
- $ret["unknown"]=(100*$unknown_time)/$total_time;
+ if($total_time==0)
+ {
+ $ret["true_time"]=0;
+ $ret["false_time"]=0;
+ $ret["unknown_time"]=0;
+ $ret["true"]=0;
+ $ret["false"]=0;
+ $ret["unknown"]=100;
+ }
+ else
+ {
+ $ret["true_time"]=$true_time;
+ $ret["false_time"]=$false_time;
+ $ret["unknown_time"]=$unknown_time;
+ $ret["true"]=(100*$true_time)/$total_time;
+ $ret["false"]=(100*$false_time)/$total_time;
+ $ret["unknown"]=(100*$unknown_time)/$total_time;
+ }
return $ret;
}