diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-07-23 17:06:33 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-07-23 17:06:33 +0000 |
| commit | ce2bf1099ecb5b4087184a88c8cf648a034ab690 (patch) | |
| tree | d1658c16a0f82736c5543d3564e2580ed6d18258 /frontends/php | |
| parent | 18f62b7d06dedf74b30899302019e847ab287183 (diff) | |
- 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')
| -rw-r--r-- | frontends/php/include/config.inc.php | 24 | ||||
| -rw-r--r-- | frontends/php/report2.php | 2 |
2 files changed, 19 insertions, 7 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; } diff --git a/frontends/php/report2.php b/frontends/php/report2.php index 10eee4c5..e534f733 100644 --- a/frontends/php/report2.php +++ b/frontends/php/report2.php @@ -26,7 +26,7 @@ <? - $result=DBselect("select 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.status in (0,2) and i.status=0 order by h.host,t.lastchange desc, t.description"); + $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.status in (0,2) and i.status=0 order by h.host, t.description"); $lasthost=""; $col=0; |
