LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-12-2006, 12:40 AM   #1
nesargha
Member
 
Registered: May 2006
Distribution: rhel 4, red hat 9, fedora core 2
Posts: 51

Rep: Reputation: 15
need tips for SARG


hi guys,

i need tips on how to get reports from the SARG, i have installed SARG ver 1.4.1 for Red hat 9 server. right now i am getting daily reports mailed to admin email id. which is as shown below.

--------------------------------------------------------------

Squid User Access Report
Decreasing Access (bytes)
Period 11Sep2006-11Sep2006

NUM USERID CONNECT BYTES %BYTES USED TIME MILISEC %TIME
------- -------------------- -------- --------------- ------- ---------- ---------- -------
1 192.168.0.16 75038 737.957.698 23.25% 28:44:46 103486480 16.45%
2 192.168.0.12 34377 652.467.759 20.56% 28:59:56 104396636 16.60%
.
.
.

------- -------------------- -------- --------------- ------- ---------- ---------- -------
TOTAL 345700 3.173.382.443 174:43:14 628994709
AVERAGE 18194 167.020.128 09:11:44 33104984

Tue Sep 12 04:03:57 2006

--------------------------------------------------------------
but how to configure SARG to get
1)weekly report
2) get list of all sites visited by each user

also SARG is not generating the html reports. how to get both ie. send the report to admin mail id and at the same time generate html reports.

thanks in advance

Last edited by nesargha; 09-12-2006 at 12:41 AM.
 
Old 09-13-2006, 07:49 PM   #2
generic_user
Member
 
Registered: Sep 2006
Location: San Francisco, Ca.
Distribution: Redhat/Fedora/CentOS
Posts: 39

Rep: Reputation: 15
Quote:
Originally Posted by nesargha
hi guys,
but how to configure SARG to get
1)weekly report
2) get list of all sites visited by each user

also SARG is not generating the html reports. how to get both ie. send the report to admin mail id and at the same time generate html reports.

thanks in advance
the rpm that was avail for FC4 creates cron jobs for each of the daily, weekly, month... it'll also create the /var/www/sarg dir structure for you and add the appropriate http conf file... the reports will show you what you want.

if you can make sense of this spec file, it'll show you what the rpm does when it installs:
www mack ro/linux/sarg/sarg-2.1.spec

here's an example of a daily cron job:
Code:
#!/bin/bash
exec /usr/bin/sarg \
          -o /var/www/sarg/daily \
          -d "$(date --date "1 day ago" +%d/%m/%Y)"  > /dev/null 2>&1

exit 0
and here's an example of a weekly:
Code:
#!/bin/bash
LOG_FILES=
if [[ -s /var/log/squid/access.log.1.gz ]]; then
    LOG_FILES="$LOG_FILES -l /var/log/squid/access.log.1.gz"
fi
if [[ -s /var/log/squid/access.log ]]; then
    LOG_FILES="$LOG_FILES -l /var/log/squid/access.log"
fi

# Get yesterday's date
YESTERDAY=$(date --date "1 days ago" +%d/%m/%Y)

# Get one week ago date
WEEKAGO=$(date --date "7 days ago" +%d/%m/%Y)

exec /usr/bin/sarg \
        $LOG_FILES \
        -o /var/www/sarg/weekly \
        -d $WEEKAGO-$YESTERDAY > /dev/null 2>&1

exit 0
 
Old 09-18-2006, 12:09 AM   #3
nesargha
Member
 
Registered: May 2006
Distribution: rhel 4, red hat 9, fedora core 2
Posts: 51

Original Poster
Rep: Reputation: 15
hi,

thanks for the advice i hope it would help me.

nesargha

Last edited by nesargha; 09-18-2006 at 02:18 AM.
 
  


Reply

Tags
sarg, tips



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to Access the Sarg ? winxandlinx Linux - Networking 0 06-30-2006 08:39 AM
sarg and Webalizer shipon_97 Linux - Newbie 1 06-23-2006 02:35 PM
broken sarg black_man Debian 4 03-28-2006 05:32 PM
Need help in SARG depam Linux - Software 1 10-14-2005 09:06 PM
sarg thiyagu4u Linux - Networking 0 09-13-2004 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration