Linux Report Generator With SARG




To add features to make it easier to observe the statistics site URL from the client accessing the Internet using a Linux proxy server (Squid), then we can use a free Open Source Squid Analysis Report Generator (SARG).

In addition to the SARG, you can also use Webalizer. In another occasion I will write the article. Definition of official sources mention SARG "Sarg is a Squid Analysis Report Generator that allow you to view" where "your users are going to on the Internet. SARG generate reports in html, with many fields, like: users, IP Addresses, bytes, sites and times. "

True purpose in using the SARG is to view statistics list the sites most visited by the user with respect to work my friend, who then becomes a report to find out the trend of user in visiting the internet.



For the installation you can open your linux terminal and then type the following command:
sudo apt-get install sarg

After the sarg is installed, we need to modify some of the options in the "sarg. conf".
By typing the following commands on your terminal:
sudo nano /etc/squid/sarg.conf

You will see many rows but I suggest delete all the lines and replace with line below.

# sarg.conf
language English
access_log /var/log/squid/access.log
graphs yes
graph_days_bytes_bar_color orange
title “My Squid User Access Reports”
font_face Tahoma,Verdana,Arial
header_color darkblue
header_bgcolor blanchedalmond
font_size 9px
background_color white
text_color #000000
text_bgcolor lavender
title_color green
temporary_dir /tmp
output_dir /var/www/sarg
resolve_ip
user_ip yes
topuser_sort_field BYTES reverse
user_sort_field BYTES reverse
date_format u
lastlog 0
remove_temp_files yes
index yes
index_tree file
overwrite_report yes
records_without_userid ip
use_comma yes
mail_utility mailx
topsites_num 50
topsites_sort_order CONNECT D
index_sort_order D
max_elapsed 28800000
exclude_codes /etc/squid/sarg.exclude_codes
report_type topusers topsites sites_users users_sites date_time denied auth_failures site_user_time_date downloads
usertab /etc/squid/sarg.usertab
long_url no
date_time_by bytes
charset Latin1
show_successful_message yes
show_read_statistics yes
topuser_fields NUM DATE_TIME USERID CONNECT BYTES %BYTES IN-CACHE-OUT USED_TIME MILISEC %TIME TOTAL AVERAGE
user_report_fields CONNECT BYTES %BYTES IN-CACHE-OUT USED_TIME MILISEC %TIME TOTAL AVERAGE
topuser_num 0
site_user_time_date_type table
download_suffix “zip,arj,bzip,gz,ace,doc,iso,adt,bin,cab,com,dot,drv$,lha,lzh,mdb,mso,ppt,rtf,src,shs,sys,

After you replaced it then "Save"or with the Ctrl + O and Ctrl + X to exit.

And don't forget to create a "dir" where the SARG would make the report in "/var/www/sarg"
(You can also change the syntax the output dir in "sarg. conf")
mkdir /var/www/sarg

As for running the sarg, type the following command in your terminal:
sarg
/usr/sbin/sarg-reports daily

This will generate a report in the "/ var / www / sarg" sarg, and to run automatically every day, we can add the following syntax in the "/ etc / crontab":
# crontab -e

Now add the following entry at the end of the line: –
@daily /usr/sbin/sarg-reports daily

Then save and exit

Now open your browser and navigate to the ip of your proxy/sarg (Change ip in accordance with Your setup)
example: https://192.168.169.2:10000

Select "Un-Used Modules"
Then Click On "Squid Report Generator"

1.Untuk menghasilkan laporan, klik "Generate Report Now button".
2. Selanjutny, klik "View completed report".
3. Klik "the latest generated report".
4. Review the generated report.
example Top Sites Report :





Next
Previous
Click here for Comments

0 comments: