The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
PRTG Graphs (Final)
Posted by: blake | April 28, 2008 @ 5:43pm
Revision 1 - Original post on April 28, 2008 @ 5:41pm
PHP Code
[
Download
]
<?php /* Bandwidth Usage Graph Script for PRTG (C) Copyright Andrew Whyman (abyssunderground.co.uk) and Blake Buckalew (randomresources.org) Free to use, distribute and modify. */ # EDIT THESE VARIABLES $URL = 'http://randomresources.org:90'; // URL:port to the local PRTG Web Server without a trailing slash $ID = '2'; // Default ID $WIDTH = 300; // Default Width $HEIGHT = 160; // Default Height # END OF VARIABLES $ID = !isset($_GET['id']) ? $ID : $_GET['id']; $WIDTH = !isset($_GET['width']) ? $WIDTH : $_GET['width']; $HEIGHT = !isset($_GET['height']) ? $HEIGHT : $_GET['height']; header('Content-type: image/gif'); header('Cache-Control: no-cache'); header("Local-Time: ".date("l, F j, Y - H:i:s")." (EST)"); $time = date("Ymd-H"); switch ($_GET['g']) { case 1: # 5 Minutes $m = date("i") - 5; $m = sprintf("%02d", $m); $file = $URL."/graphimg?id=".$ID."&subid=0&width=".$WIDTH."&height=".$HEIGHT."&from=".$time.$m; break; case 2: # 60 Minutes (1 Hour) $minus5 = date("i") - 60; $minus5 = sprintf("%02d", $minus5); $file = $URL."/graphimg?id=".$ID."&subid=1&width=".$WIDTH."&height=".$HEIGHT."&from=".$time.$minus5; break; case 3: # 1440 Minutes (24 Hours) $minus5 = date("i") - 1440; $minus5 = sprintf("%02d", $minus5); $file = $URL."/graphimg?id=".$ID."&subid=2&width=".$WIDTH."&height=".$HEIGHT."&from=".$time.$minus5; break; case 4: # 43200 Minutes (30 Days) $minus5 = date("i") - 43200; $minus5 = sprintf("%02d", $minus5); $file = $URL."/graphimg?id=".$ID."&subid=3&width=".$WIDTH."&height=".$HEIGHT."&from=".$time.$minus5; break; } readfile($file); ?>
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.48 / 8
341 Votes