diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-08-04 16:53:24 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2002-08-04 16:53:24 +0000 |
| commit | 2f691b3628c4589fe258def9564d78cd134d3ebb (patch) | |
| tree | 278a676e3e5540977348c86b9d7a96ccc105902d /frontends/php/chart2.php | |
| parent | 89d810024288866e72586c1774dec254db9aa884 (diff) | |
| download | zabbix-2f691b3628c4589fe258def9564d78cd134d3ebb.tar.gz zabbix-2f691b3628c4589fe258def9564d78cd134d3ebb.tar.xz zabbix-2f691b3628c4589fe258def9564d78cd134d3ebb.zip | |
- added upgrades/dbpatches/1.0beta4_to_1.0beta5/ with patches (Alexei)
- added support for disktotal[*] (Alexei)
- added support for inodetotal[*] (Alexei)
- added support for *,/,+, and - in trigger expressions (Alexei)
- removed frontends/php/chart4.php (Alexei)
- update item status to UNSUPPORTED in case if SNMP support was not included
into zabbix_suckerd (Alexei)
- added mysql_init() to DBconnect() (Alexei)
- fixed Next100 and Prev100 for case if some hosts are hidden (Alexei)
- added select for latest values (Alexei)
- delete related services if trigger is deleted (Alexei)
- fixed problem with substitution of macros for messages (Alexei)
- eliminated DBis_empty() by replacing to DBnum_rows() (Alexei)
- MAX_STRING_LEN increased to 4096 (Alexei)
- fixed zabbix_log(). Possible coredump if data contains %s, etc (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@445 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/chart2.php')
| -rw-r--r-- | frontends/php/chart2.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/frontends/php/chart2.php b/frontends/php/chart2.php index b4b2b387..af5488bd 100644 --- a/frontends/php/chart2.php +++ b/frontends/php/chart2.php @@ -5,8 +5,10 @@ # graphid -#? period -#? from +# period +# from + + $start_time=time(NULL); if(!isset($period)) { @@ -29,14 +31,14 @@ $nodata=1; - Header( "Content-type: text/html"); -// Header( "Content-type: image/png"); +// Header( "Content-type: text/html"); + Header( "Content-type: image/png"); Header( "Expires: Mon, 17 Aug 1998 12:51:50 GMT"); $result2=DBselect("select gi.itemid,i.description,gi.color,h.host from graphs_items gi,items i,hosts h where gi.itemid=i.itemid and gi.graphid=$graphid and i.hostid=h.hostid order by gi.gitemid"); $shiftX=10; - $shiftYup=13; + $shiftYup=17; $shiftYdown=7+15*DBnum_rows($result2); $im = imagecreate($sizeX+$shiftX+61,$sizeY+$shiftYup+$shiftYdown+10+50); @@ -81,7 +83,9 @@ } $graph=get_graph_by_graphid($graphid); - ImageString($im, 4,$sizeX/2-50,-1, $graph["name"] , $darkred); + $str=$graph["name"]; + $x=imagesx($im)/2-ImageFontWidth(4)*strlen($str)/2; + ImageString($im, 4,$x,1, $str , $darkred); $from_time = time(NULL)-$period-3600*$from; $to_time = time(NULL)-3600*$from; @@ -180,7 +184,10 @@ } # ImageString($im,0,$shiftX+$sizeX-85,$sizeY+$shiftYup+25, "http://zabbix.sourceforge.net", $gray); - ImageStringUp($im,0,2*$shiftX+$sizeX+40,$sizeY+$shiftYdown+$shiftYup, "http://zabbix.sourceforge.net", $gray); + ImageStringUp($im,0,imagesx($im)-10,imagesy($im)-50, "http://zabbix.sourceforge.net", $gray); + + $end_time=time(NULL); + ImageString($im, 0,imagesx($im)-100,imagesy($im)-12,"Generated in ".($end_time-$start_time)." sec", $gray); ImagePng($im); ImageDestroy($im); |
