############################################################################## # MaxParse.pl Script Version 1.0 Beta # # Written By: Brian Collins # # Copyright 2000 Talon C.C. support@tccsoftware.com # # Created 07/10/2000 Last Modified # ############################################################################## # COPYRIGHT NOTICE # # # # Selling the code for this program without prior written consent is # # expressly forbidden. In other words, please ask first before you try and # # make money off of my program. # # # # Obtain permission before redistributing this software over the Internet or # # in any other medium. # ############################################################################## TABLE OF CONTENTS: ================== 1) OVERVIEW 2) CONFIGURATION A) File Setup B) Column Names 1) Modem C) Log File 1) Name 2) Extension 3) Placing the File D) Deleting E) Aliases to Check 3) USING THIS CGI SCRIPT A) Running B) Summary Log Generated C) Deleting parsed MaxStat logs. 4) Sample Log File Output. ############################################################################## OVERVIEW ======== 1) If PERL 5 is not installed, then go to http://www.activestate.com to download PERL 5 for free. This script is designed to parse through a MaxStat log file and tally up each modem Alias and separate each Alias into two trunks to get a more detailed listing of where the network hardware is getting used. The log file created is an exact replica from the Summary log file created by MaxStat but, it separates the Aliases into their separate trunks. The log file then can be ran by the Analyze Log spreadsheet that is provided free with MaxStat and is also located on our website www.taloncc.com in the free downloads section. ############################################################################## CONFIGURATION ============= 2) Make sure PERL 5 is installed. You can get PERL 5 for free at http://www.activestate.com. Open the config.ini file in the root directory of the script and find the lines that correspond to the following setup options. ** Denotes a config.ini setup line. The values listed are the defaults. A) File Setup **MaxStat Log File = This is the name and path of the log file to be parsed by the script. B) Column Names These are used by the script to find what the column name is to be able to parse the file correctly. The columns have to be named exactly as shown. You can usually open up the log file and find the names at the top of the file separated by ';'. 1) Modem **Column Name Modem = Modem This tells the script the name of the Modem column. C) Log File The log file created by the script has a couple of settings that allow customization by the user to name it and put any extension that the user wants. The log file then uses the defined name and appends the date taken from the log file and then appends the extension defined by the user. 1) Name **Log File Name = MaxStat This is the name of the log file created by the script. The date is appended to the end of the name. 2) Extension **Extension Type = log This is the extension of the log file created by the script. This is appended to the Name and the date. 3) Placing the File **File Directory = This setting is used by the script to place the file where ever it is needed to be located by the user. If this setting is left blank, then the new log file created by the script will be placed in the scripts directory. D) Deleting **DeleteLogFiles = yes The log file that is parsed by the script can be deleted by the script or not deleted. Delete: set the above setting to "yes". Example: DeleteLogFiles = yes Don't Delete: set the above setting to "no" Example: DeleteLogFiles = no E) Aliases to Check **Alias Names = pepper1,pepper2,pepper3,pepper4,maxone,uvalde This tells the script what are the names of all the aliases. If an alias is not in the log file that the script is parsing then this will allow the Alias to be set to zero. ############################################################################## USING THIS CGI SCRIPT. ====================== 3) A) Running Make sure that the script has a file to parse. If there is not a file, then the script will let you know. Open up a command prompt and enter "perl maxparse.pl" and hit enter. The log file will be generated while a series of dots fill the screen. This will tell you that the script is working correctly. Each line of dots corresponds to 50 summary lines that are added to the log file and generated by the script. Once the parsing is done. Then the script will display how many summary lines were printed. You can then open up the appropriate file that is generated and run it using the Analyze Log spreadsheet. This will create handy charts to print. B) Summary Log Generated The summary log generated is done by looking at the date in the MaxStat log file itself. This allows the script to separate multiple days from a log file. So if your MaxStat log file contains more than one day's worth of data, then the log file will separate these out into different summary files. The name of the summary files created will contain the Name chosen by the user of this script, the date that is parsed from the MaxStat log file and, the extension defined by the user of this script. C) Deleting parsed MaxStat logs. By default the parsed MaxStat log will be deleted after the script is finished. This setting can be changed if you wanted to keep all of your log files. ############################################################################## Sample Log File Output. ======================= Below is one line of output. All aliases are strictly denied that they are real. 07/18/2000 03:15:39;pepper40 Trunk 1;19;pepper40 Trunk 2;0;max Trunk 1;21;max Trunk 2;12;val Trunk 2;16;val Trunk 1;0;pepper Trunk 1;20;pepper Trunk 2;21;pepper2 Trunk 1;19;pepper2 Trunk 2;18;pepper3 Trunk 2;21;pepper3 Trunk 1;18