GRAPHER.CGI v1.0.4 ~~~~~~~~~~~~~~~~~~ FILE LIST ~~~~~~~~~ README This file grapher.cgi Graphing CGI script Rot13.pm Rot13 Encryption Perl module rot13.pl Rot13 Generation Perl script rot13.asp Rot13 Generation ASP script INSTALLATION ~~~~~~~~~~~~ 1) Copy the grapher.cgi file to any cgi executable directory. 2) Modify grapher.cgi to point to the correct path of the RRD libraries. 2) Modify grapher.cgi to point to the correct paths for a) rrd files and b) png files (with the $path, and $outputpath variables) 3) Modify grapher.cgi to enable/disable Rot13 encryption. 4) Modify grapher.cgi to change any default look/feel settings you may want. 5) Modify the path in grapher.cgi. This is the base path for use in the name paramater EXECUTION ~~~~~~~~~ This section will break down which paramaters grapher.cgi accepts and how they function. Sample Call: http://.../grapher.cgi?name=cisco.domain.com/ifindex&size=normal&interval=1&title=cisco.domain.com:Serial0&comment=Main%20T1%20Interface PARAMETER DEFINITION ~~~~~~~~~~~~~~~~~~~~~~~~~~ name Pointer to the .rrd file Example : name=switch1.tst/1/1 The real file location would be $path/switch1.tst/1/1.rrd (See `Installation' #5 for info about $path) Note, do not specify the .rrd extension size Specifies the size of the graph. This can be modified in the source, in the 'graphparams' hash. Example: size=normal Predefined sizes : normal, small, reallysmall interval Specifies the time interval to be used for the graph. This can be modified by changing the 'xgrid' fields in the 'graphparams' hash, and by modifying the 'intervals' hash. Example: interval=1 Predefined sizes : 1 = Daily 2 = Weekly 3 = Monthly 4 = Yearly 5 = Six Hours title Specifies the title of the graph. This is displayed centered at the top of the graph. Example: title=Core%20Router%20for%20New%20York comment Specifies the comment of the grpah. This is displayed left justified as a 'Description' field under the graph, but above the graph statistics. Example: comment=Main%20T1%20Interface encrypted Specifies whether the name, title, comment is encrypted. This overrides the default encryption setting. More documentation to follow. Example: encrypted=1 portspeed Port Speed variable is used for percent calculations. Set the appparams{} "defaultportspeed" to set the initial port speed for calls to grapher.cgi without a specific one. COSMETIC PARAMETERS: These parameters are used to override the default look/feel variables in the 'appparams' hash areacolor The color for "input" traffic. This is a filled in area, as opposed to a 'line' (see below) Defaults to green Example: areacolor=00cc00 areastring The description for this value. Defaults to "Input Traffic" linecolor The color for "output" traffic. Defaults to blue Example: linecolor=0000FF linestyle The style for the "output" traffic line. Defaults to 2. Valid values are 1, 2 linestring The description for this value. Defaults to "Output Traffic" mgridcolor The color for the Major grid of the graph. gridcolor The color for the normal grid of the graph. backcolor The color of the back of the graphic canvascolor The color of the back of the graph (not the entire graphic, just the graph portion) framecolor The color of the frame around the display box for AREA and LINE. fontcolor The color of the display font. Defaults to black (000000) arrowcolor The color of the arrow in the lower right. Defaults to red (FF0000) highshadecolor The color of the graphic border HIGH shade. lowshadecolor The color of the graphic border LOW shade. vstring The text on the vertical label. Defaults to 'bits per second' SAMPLE SETUP ~~~~~~~~~~~~ I'm going to explain a little bit about my usage of this grapher and how I integrate it. I had a website which did SQL calls through Perl's DBI functions to generate the grapher paramaters. This has proven to be very reliable, and speedy, as no manual editing of HTML pages are necessary. I use Rot13 encryption for the name, comment and title fields. I'll explain why I use this later on. If you'd like to see some examples, please feel free to visit that site listed above. FAQ ~~~ Q) Why use Rot13 Encryption. Its two way, and not very secure. A) The goal of using Rot13 encryption was to simply make it not-plain text. If you are in more of a need of encryption, please feel free to modify the script as you wish (please let me know if you want me to add support for whichever method you use). Since nothing malicious can come out of modifying the parameters passed to grapher.cgi, I didnt feel it was necessary for any stronger encryption. Q) Why use RRD. A) RRD with alittle help from MRTG is far more superior, IMHO. Collection times for 2500 ports or so, is still well under 30 seconds, where in the past with straight MRTG, it could take up to 3 or 4 minutes, which is closely pushing the MRTG run interval. Q) Why all of these paramaters, why not have a config file? A) In an effort to keep this grapher fast, i've made a decision to just pass things to the grapher. 14all.cgi, which I ripped apart to make this grapher, wasted time parsing the MRTG config files to get the information necessary to generate the graph. When using 14all.cgi, graph generation could take up to a full second, where with this grapher, it takes less than 5 milliseconds on average. argon# time grapher.cgi "name=1215-gra.pna.agy.1upgvjf/gra.pna.agy.1upgvjf/ynzeba&interval=1&size=normal&title=42/0graerugRgfnS:gra.pna.agy.1upgvjf&comment=lanczbPtavgfnpqnbeOufvgveO:67381" > test.png real 0m0.346s user 0m0.305s sys 0m0.001s LICENSING ~~~~~~~~~ I provide this software with source code as is. You may modify it as you wish, but please include my name in any credits. CONTACT ~~~~~~~ If you have any suggestions or comments, please feel free to email me. -James Cornman james@cornman.org