|
|
|
|
|
<?
/*
Variabel initialization.
*/
$rrdname = "/full/path/to/rrdfile.rrd";
$daygraph = "gifday.gif";
$weekgraph = "gifweek.gif";
$monthgraph= "gifmonth.gif";
$yeargraph = "gifyear.gif";
/* I don't suggest you to modify listing code below. */
$daystart = "-2000m";
$weekstart = "-12000m";
$monthstart = "-2880000";
$yearstart = "-34560000";
gambar($daygraph, $rrdname, $daystart);
echo "<p align='center'><font face='verdana' size='2'><b>Daily graph</b></font>";
echo "<center><img src=images/$rowgraph[2]></center><p>";
gambar($weekgraph, $rrdname, $weekstart);
echo "<p align='center'><font face='verdana' size='2'><b>Weekly graph</b></font>";
echo "<center><img src=images/$rowgraph[3]></center><p>";
gambar($monthgraph, $rrdname, $monthstart);
echo "<p align='center'><font face='verdana' size='2'><b>Monthly graph</b></font>";
echo "<center><img src=images/$rowgraph[4]></center><p>";
gambar($yeargraph,$rrdname,$yearstart);
echo "<p align='center'><font face='verdana' size='2'><b>Yearly graph</b></font>";
echo "<center><img src=images/$rowgraph[5]></center><p>";
function gambar($gif,$rrd, $start)
{
$comm="rrdtool graph images/$gif --alt-y-grid --lazy -c MGRID#ee0000 -c GRID#000000 --
start $start -
-end now DEF:data0=$rrd:ds0:AVERAGE DEF:data1=$rrd:ds1:AVERAGE
\"CDEF:input=data0,8,*\" \"CDEF:output=data1,8,*\" CDEF:ijo=input,100
,GT,input,0,IF AREA:ijo#00BF00:\"Incoming traffic in Bits per second\\l\"
LINE2:output#0000FF:\"Outgoing traffic in Bits per second
\\l\" GPRINT:input:MAX:\"Maximal In\: %9.0lf bits.\" GPRINT:output:MAX:\"Maximal Out\: %9.0lf
bits.\\l\" GPRINT:input:AVERAGE:\"Aver
age In\: %9.0lf bits.\" GPRINT:output:AVERAGE:\"Average Out\: %9.0lf bits.\\l\"
GPRINT:input:LAST:\"Current In\: %9.0lf bits.\" GPRI
NT:output:LAST:\"Current Out\: %9.0lf bits.\\l\"";
exec($comm);
}
?> |
|
| PHP4 HTTP Compression Speeds up the Web Categories : PHP, Zlib, HTML and PHP, HTTP, Network | | | This script will read all images from a folder and read the files into an array. It uses rand() to get a random number. It will display a random image from the image folder given. Categories : PHP, Arrays, Graphics, Filesystem | | | Automatic banner rotation. Randomly selects a banner for display. Categories : Graphics, PHP, Complete Programs | | | Sample usage of IPv6 and IPv4 with PHP Categories : PHP, PHP Classes, Network | | | imageMarker v 3.00 with new advanced features Categories : PHP, PHP Classes, Graphics, GD image library | | | This is a simple photo gallery that reads the image files from multiple directories, and generates a web page styled with CSS1. It opens single auto window to view and print a given image.
Categories : Graphics, Filesystem, PHP, Complete Programs | | | Shows the current time as a PNG-image. This script does not use the GD
library. You can use it as a benchmark (because it's slow), or as a quick
reference for implementing a simple PNG-file generator. Categories : Graphics, Zlib, Calendar, PHP, Date Time | | | Easy slideshow with php. Just place this one file into a subdirectory where jpg files reside. An instant slideshow is yours. MS explorer only. Categories : PHP, Filesystem, Graphics | | | How to get the exit code and result of an exec() command. Categories : PHP, Network | | | Simple PHP/3 Access Counter (using GD and DBM functions) Categories : Databases, PHP, Graphics, HTML and PHP, dBase | | | Simple class that uses GD to draw pie charts. After the class definition there's some sample code to demonstrate how you use the class.
Categories : Graphics, PHP, PHP Classes, GD image library, Charts and Graphs | | | Using PHP im HTML image tags Categories : PHP, HTML and PHP, Graphics, Beginner Guides | | | Upload images restricted by pixel size (Picture width and Picture Height) Categories : PHP, HTML and PHP, Graphics | | | A couple of functions that convert an IP address into its color code and not-color-code. Useful when viewing an apache log with a mysql result grouped by IP Categories : PHP, Graphics, Databases | | | How to display any array in several rows and columns of a table. Not just
in one column or in alternate rows. This example shows a nice color table
generated with PHP, but can be used with any array values(e.g. Database) Categories : Arrays, PHP, Miscellaneous, Beginner Guides, Graphics | |
| |
| |
|