Intrache Version 1.0 October 25, 2000
Log analyser & report generator for intranets running on Apache webserver
(c) 2000 Vinod L. Hingorani. Email: vinodlh@yahoo.com
Released on October 25, 2000 under GPL.
Intrache is log analyser for intranets where all the pages and workstations (PCs) are known entities. It is tailored for the widely used Apache web browser and has been tested on versions 1.3.3 and 1.3.6 running on Linux (RedHat & Suse) and Solaris 2.6. Please note that this requires fixed IP addresses for all workstations (PCs). If you modify it for DHCP, update the author.
To make it truly portable & platform independent, it was written in ANSI C using only the basic libraries. This has made the user interface a bit clumsy, but it does the work. The menus are self-explanatory.
The main thing to understand here is that in an intranet scenario, you want to generate a report of hits on your sites on your server, and these sites have unique page names, like "/corporate/qualitypolicy.html". You may want to generate a report as to how many people accessed this page, or which pages did some person visit on your intranet. Check out menu #3 to #6 to see how to use all permutations & combinations of creating reports.
Intrache can create reports for:
Specific workstation IP, All known pages
Specific workstation IP, Specific page
Specific page, All known workstation IPs
Specific page, Specific workstation IP
All known workstation IPs, All known pages - Total hits
All known workstation IPs, All known pages - Workstation-wise break up
All known workstation IPs, Specific page - Workstation-wise break up
To do this successfully with Intrache, you must create a database of users and pages. Users are called workstations in Intrache, as that is tied to a unique IP number for each workstation in the intranet. So you have to create two databases: page database and workstation database.
To know what to add to the workstation & page databases, use the sub-menu option #9 from main menu option #1 (Workstation & pages database maintenance). This scans the existing log file and shows what pages are accessed (.htm & .html) and the IP numbers that acccessed the webserver. This narrows down the search for spellings and syntax of page names that have to be fed in the page database. THIS IS NOT AN EXHAUSTIVE LIST, ONLY FOR THOSE WORKSTATIONS THAT HAVE ACCESSED THE SERVER AND FOR THOSE PAGES ACTUALLY VISITED. AS A SITE OR SYSTEM ADMINISTRATOR, YOU WILL HAVE TO MAKE THE LIST FROM ACTUAL NUMBER OF WORKSTATION IPs IN YOUR DOMAIN AND PAGES THAT YOU WANT A REPORT OF.
Reports are generated in tab-delimited text file format or in a HTML format or can be viewed on screen.
Compilation options:
- Linux
- gcc -ansi -o intrache intrache.c
- Solaris
- cc -o intrache intrache.c
Intrache requires four files to be present in the working directory:
intrache The program file intrache.conf The Intrache configuration file intrache.ws The workstation database file intrache.page The page database file intrache.help This help file
INTRACHE.CONF File
The configuration file must be edited to have the following lines: (blank lines & lines starting with # are ignored) The order is important and all five non comment lines should be present. access_log file, error_log file, ping command, clear command, sort command.
-------------------------- intrache.conf ----------------------------- # line 1: full path of Apache access_log file (edit to change) /var/log/httpd/access_log
# line 2: full path of Apache error_log file (edit to change) /var/log/httpd/error_log
# line 3: ping command for your OS for 2 packets, (edit to change) # for linux, use "ping -c 2" or you'll wait forever, for Solaris, use "ping" ping -c 2
# line 4: clear screen command for your OS (edit to change) clear
# line 5: sort file command for your OS (edit to change)
sort -o
---------------------- end of intrache.conf -------------------------
INTRACHE.WS File
The intrache.ws file is the workstation database file. This contains the details of the workstations on the intranet. Blank lines and lines beginning with # are ignored. This file can be edited by any text editor or directly through intrache's built in database maintenance commands.
THERE SHOULD BE AT LEAST ONE ENTRY IN THIS FILE!
Each workstation's data is in a line. The fields are (in order and separated by white space): nickname, ip_address, first_name, last_name and phone_number.
PLEASE NOTE THAT SPACES ARE NOT ALLOWED IN FIELDS. (USED AS SEPARATOR)
-------------------------- intrache.ws ----------------------------- nickname IP F_Name L_Name Phone
0001 44.211.212.32 Vinod Hingorani 1234567 CHAV 44.211.212.44 Chavi Wad 6786565
# as many entries ...
--------------------- end of intrache.ws ---------------------------
INTRACHE.PAGE File
The intrache.page file is the page database file. This contains the details of the pages on the intranet servers on which this program runs. Blank lines and lines beginning with # are ignored. This file can be edited by any text editor or directly through intrache's built in database maintenance commands.
THERE SHOULD BE AT LEAST ONE ENTRY IN THIS FILE!
Each page data is in a line. The fields are (in order and separated by white space): nickname, page_name.
PLEASE NOTE THAT SPACES ARE NOT ALLOWED IN FIELDS. (USED AS SEPARATOR)
-------------------------- intrache.page ----------------------------- #nickname Page_name
Vhome /users/vinod_home.html CHAVhome /users/chav_home.html main / corp /corporate.html phonedir /phone_directory.html
# as many entries ...
------------------------- end of intrache.page -----------------------
