diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2001-07-03 06:07:26 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2001-07-03 06:07:26 +0000 |
| commit | 2c88dcbac3de23650e7fccaa91f003e9ae54550d (patch) | |
| tree | 60f3f30933c79818480ae06b58f0e9b02c2317f0 /frontends/php | |
| parent | e8371e423287f73f1ad30bc35a25bce761a0d27b (diff) | |
| download | zabbix-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')
| -rw-r--r-- | frontends/php/charts.html | 2 | ||||
| -rw-r--r-- | frontends/php/include/config.inc | 25 | ||||
| -rw-r--r-- | frontends/php/map.html | 11 | ||||
| -rw-r--r-- | frontends/php/report2.html | 5 |
4 files changed, 25 insertions, 18 deletions
diff --git a/frontends/php/charts.html b/frontends/php/charts.html index 7ec13246..2dc583f9 100644 --- a/frontends/php/charts.html +++ b/frontends/php/charts.html @@ -83,6 +83,7 @@ if(isset($graphid)) { + echo("<center>"); echo("<hr>"); $tmp=$from+12*14; echo("[<A HREF=\"charts.html?graphid=$graphid&from=$tmp&period=$period\">"); @@ -142,6 +143,7 @@ { echo("[Week forward]"); } + echo("</center>"); } ?> 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 { diff --git a/frontends/php/map.html b/frontends/php/map.html index 148e9b06..07686ec2 100644 --- a/frontends/php/map.html +++ b/frontends/php/map.html @@ -29,6 +29,7 @@ $cyan=ImageColorAllocate($im,0,255,255); $white=ImageColorAllocate($im,255,255,255); $black=ImageColorAllocate($im,0,0,0); + $gray=ImageColorAllocate($im,150,150,150); $x=imagesx($im); $y=imagesy($im); @@ -103,7 +104,13 @@ { $result1=DBselect("select count(*) from items i,functions f,triggers t,hosts h where h.hostid=i.hostid and i.hostid=$hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and t.istrue=1 and h.status=0"); $count=DBget_field($result1,0,0); - if($count>0) + if($count==1) + { + $color=$red; + $result1=DBselect("select t.description from items i,functions f,triggers t,hosts h where h.hostid=i.hostid and i.hostid=$hostid and i.itemid=f.itemid and f.triggerid=t.triggerid and t.istrue=1 and h.status=0"); + $label=DBget_field($result1,0,0); + } + else if($count>1) { $color=$red; $label="Problems"; @@ -125,6 +132,8 @@ } ImageDestroy($img); + ImageString($im,0,$width-147,$height-10, "http://zabbix.sourceforge.net", $gray); + ImagePng($im); ImageDestroy($im); ?> diff --git a/frontends/php/report2.html b/frontends/php/report2.html index 5a11f751..5759124e 100644 --- a/frontends/php/report2.html +++ b/frontends/php/report2.html @@ -20,10 +20,7 @@ ?> <? - $stats=get_stats(); - $txt="AVAILABILITY REPORT"; - $txt=$txt."<br>"."(From:".date("y/m/d H:i:s",$stats["history_min_clock"])." till:".date("y/m/d H:i:s",time()).")"; - show_table_header($txt); + show_table_header("AVAILABILITY REPORT"); echo "<br>"; ?> |
