From fe419ea13516eb6c560bda8d2601f600efdfd888 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Sun, 22 Jul 2001 09:19:43 +0000 Subject: Add basci support for trends git-svn-id: svn://svn.zabbix.com/trunk@137 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/latest.html | 3 + frontends/php/trend.html | 152 ++++++++++++++++++++++++++++++++++++++++++++++ frontends/php/trends.html | 84 +++++++++++++++++++++++++ 3 files changed, 239 insertions(+) create mode 100644 frontends/php/trend.html create mode 100644 frontends/php/trends.html (limited to 'frontends/php') diff --git a/frontends/php/latest.html b/frontends/php/latest.html index 49a1889b..8f6e2392 100644 --- a/frontends/php/latest.html +++ b/frontends/php/latest.html @@ -82,6 +82,8 @@ cr(); echo "
History
"; cr(); + echo "
Trends
"; + cr(); echo ""; cr(); } @@ -146,6 +148,7 @@ echo "
-
"; } echo "
Show
"; + echo "
Show
"; echo ""; } echo ""; diff --git a/frontends/php/trend.html b/frontends/php/trend.html new file mode 100644 index 00000000..8c9912a0 --- /dev/null +++ b/frontends/php/trend.html @@ -0,0 +1,152 @@ +$from_time and clock<$to_time order by clock"); + $len[$item]=0; + $x[$item]=array(); + $y[$item]=array(); + for($i=0;$i"; + if($x[$item][$len[$item]]>$maxX) { $maxX=$x[$item][$len[$item]]; } + if($x[$item][$len[$item]]<$minX) { $minX=$x[$item][$len[$item]]; } + if($y[$item][$len[$item]]>$maxY) { $maxY=$y[$item][$len[$item]]; } + if($y[$item][$len[$item]]<$minY) { $minY=$y[$item][$len[$item]]; } + $len[$item]++; + } + } + +// echo "MIN/MAX:",$minX," - ",$maxX," - ",$minY," - ",$maxY,"
"; + +// $result2=DBselect("select itemid from graphs_items where graphid=$graphid"); + for($item=0;$item"; + ImageLine($im,$x1+$shiftX,$y1+$shiftYup,$x2+$shiftX,$y2+$shiftYup,$colors[$color[$item]]); + } + } + else + { + ImageLine($im,$shiftX,$shiftYup+$sizeY/2,$sizeX+$shiftX,$shiftYup+$sizeY/2,$colors[$color[$item]]); + } + ImageFilledRectangle($im,$shiftX+150*$item,$sizeY+$shiftYup+19,$shiftX+150*$item+5,$sizeY+$shiftYup+15+9,$colors[$color[$item]]); + ImageString($im, 2,$shiftX+150*$item+9,$sizeY+$shiftYup+15, $desc[$item], $gray); + } + + if($nodata == 0) + { + for($i=0;$i<=$sizeY;$i+=50) + { + ImageString($im, 1, $sizeX+5+$shiftX, $sizeY-$i-4+$shiftYup, $i*($maxY-$minY)/$sizeY+$minY , $red); + } + +// date("dS of F Y h:i:s A",DBget_field($result,0,0)); + + ImageString($im, 1,10, $sizeY+$shiftYup+5, date("dS of F Y h:i:s A",$minX) , $red); + ImageString($im, 1,$sizeX+$shiftX-168,$sizeY+$shiftYup+5, date("dS of F Y h:i:s A",$maxX) , $red); + } + else + { + ImageString($im, 2,$sizeX/2 -50, $sizeY+$shiftYup+3, "NO DATA FOR THIS PERIOD" , $red); + } + + ImageString($im,0,$shiftX+$sizeX-85,$sizeY+$shiftYup+25, "http://zabbix.sourceforge.net", $gray); + + ImagePng($im); + ImageDestroy($im); +?> diff --git a/frontends/php/trends.html b/frontends/php/trends.html new file mode 100644 index 00000000..5ff77eec --- /dev/null +++ b/frontends/php/trends.html @@ -0,0 +1,84 @@ + + +"; + + if(isset($type)&&$type=="yearly") + { + echo "[yearly] "; + } + else + { + echo "yearly "; + } + if(isset($type)&&$type=="monthly") + { + echo "[monthly] "; + } + else + { + echo "monthly "; + } + if(isset($type)&&$type=="daily") + { + echo "[daily] "; + } + else + { + echo "daily "; + } + if(isset($type)&&$type=="hourly") + { + echo "[hourly] "; + } + else + { + echo "hourly "; + } + + echo ""; + show_table_header_end(); + echo "
"; +?> + +"; + echo ""; + echo ""; + echo ""; + if(isset($itemid)&&isset($type)) + { + echo ""; + } + else + { + echo "..."; + } + echo ""; + echo ""; + echo ""; + +?> + + -- cgit