debian/0000755000000000000000000000000012146260431007165 5ustar debian/watch0000644000000000000000000000007711236151215010220 0ustar version=2 http://sf.net/sarg/sarg-(.*)\.tar\.gz debian uupdate debian/sarg.hosts0000644000000000000000000000006411236151215011201 0ustar # Insert hosts you wish ignored in the sarg reports debian/sarg-reports.cron.weekly0000644000000000000000000000012511236151214013772 0ustar #!/bin/sh if [ -x /usr/sbin/sarg-reports ]; then /usr/sbin/sarg-reports weekly fi debian/README.source0000644000000000000000000000024311336467742011361 0ustar This package uses dpatch to manage all modifications to the upstream source. Please refer to /usr/share/doc/dpatch/README.source.gz in package dpatch for details. debian/sarg-reports.cron.daily0000644000000000000000000000012411236151214013573 0ustar #!/bin/sh if [ -x /usr/sbin/sarg-reports ]; then /usr/sbin/sarg-reports daily fi debian/sarg.users0000644000000000000000000000006411236151215011202 0ustar # Insert users you wish ignored in the sarg reports debian/rules0000755000000000000000000000430312141743565010256 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 #export DH_OPTIONS=-v export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed INSTALL = install INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644 INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755 INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755 INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755 %: dh $@ override_dh_auto_configure: chmod 755 configure dh_auto_configure -Sautoconf -- --prefix=/usr \ --mandir=\$${prefix}/share/man \ --infodir=\$${prefix}/share/info \ --bindir=/usr/bin \ --sysconfdir=/etc/sarg \ --mandir=/usr/share/man/man1 \ --enable-fontdir=/usr/share/fonts/truetype/ttf-dejavu \ --enable-imagedir=/usr/share/sarg/images \ --enable-sargphp=/usr/share/sarg override_dh_auto_install: dh_auto_install $(INSTALL_FILE) debian/sarg.conf debian/sarg/etc/sarg $(INSTALL_FILE) debian/sarg.hosts debian/sarg/etc/sarg/exclude_hosts $(INSTALL_FILE) debian/sarg.users debian/sarg/etc/sarg/exclude_users $(INSTALL_FILE) debian/sarg.usertab debian/sarg/etc/sarg/usertab rm -r debian/sarg/usr/share/fonts $(INSTALL_SCRIPT) debian/sarg-reports debian/sarg/usr/sbin/sarg-reports $(INSTALL_FILE) debian/sarg-reports.conf debian/sarg/etc/sarg $(INSTALL_SCRIPT) debian/sarg-reports.cron.daily debian/sarg/etc/cron.daily/sarg $(INSTALL_SCRIPT) debian/sarg-reports.cron.weekly debian/sarg/etc/cron.weekly/sarg $(INSTALL_SCRIPT) debian/sarg-reports.cron.monthly debian/sarg/etc/cron.monthly/sarg $(INSTALL_FILE) css.tpl debian/sarg/usr/share/doc/sarg rm debian/sarg/usr/share/sarg/sarg-php/COPYING mv debian/sarg/usr/share/sarg/sarg-php/INSTALL debian/sarg/usr/share/doc/sarg/README.sarg.php mv debian/sarg/usr/share/sarg/sarg-php/LANGUAGES debian/sarg/usr/share/doc/sarg/LANGUAGES.sarg.php chmod 644 debian/sarg/etc/sarg/sarg.* chmod 755 debian/sarg/etc/sarg chmod 755 debian/sarg/etc/sarg/user_limit_block chmod 755 debian/sarg/usr/sbin/sarg-reports chmod 755 debian/sarg/etc/cron.daily/sarg chmod 755 debian/sarg/etc/cron.weekly/sarg chmod 755 debian/sarg/etc/cron.monthly/sarg debian/README.Debian0000644000000000000000000000365311322670414011236 0ustar Since sarg 2.2.6-1 configuration files have been moved to /etc/sarg. Output files from sarg execution are located in /var/lib/sarg. During the upgrade process existing files are moved to the new locations, but administrators should check that everything is in the right place. Be especially careful that references to exclude lists in /etc/sarg/sarg.conf is updated to match the new setup. Files have been moved following this pattern Old Path New Path /etc/squid/sarg.conf /etc/sarg/sarg.conf /etc/squid/sarg.users /etc/sarg/exclude_users /etc/squid/sarg.hosts /etc/sarg/exclude_hosts /etc/squid/sarg.exclude_codes /etc/sarg/exclude_codes /etc/squid/sarg.usertab /etc/sarg/usertab /etc/squid/sarg-reports.conf /etc/sarg/sarg-reports.conf /var/www/squid-reports /var/lib/sarg Following the FHS data from sarg is now stored by default in /var/lib/sarg and not anymore in /var/www/squid-reports. To enable access to reports on the net a web server needs to be properly configured. This can be easily accomplished in Apache 2.x adding the following line to /etc/apache2/conf.d/sarg Alias /sarg /var/lib/sarg -- Luigi Gangitano , Mon, 11 Jan 2010 21:03:00 +0100 In sarg 2.1-3 the rotation script has been changed with Ugo Viti's version. New script will create daily, weekly and monthly reports by default and can be configured editing /etc/squid/sarg-reports.conf. Please see /usr/sbin/sarg-reports for istructions. -- Luigi Gangitano , Wed, 20 Dec 2005 21:03:00 +0200 Since version 2.0 sarg includes some PHP script that integrate with squid guard or a blocklist allowing you to add forbidden sites from the reports. Those scripts are not activated by default. You can find them in /usr/share/sarg. Please configure variables and webserver appropriately. -- Luigi Gangitano , Wed, 06 Oct 2004 18:08:00 +0200 debian/sarg-reports.cron.monthly0000644000000000000000000000012611236151214014165 0ustar #!/bin/sh if [ -x /usr/sbin/sarg-reports ]; then /usr/sbin/sarg-reports monthly fi debian/sarg.usertab0000644000000000000000000000011511236151215011503 0ustar # Insert userid/ip address mapping information - see sarg.conf for more info debian/sarg-reports.conf0000644000000000000000000000047211322652252012470 0ustar SARG=/usr/bin/sarg CONFIG=/etc/sarg/sarg.conf HTMLOUT=/var/lib/sarg PAGETITLE="Access Reports on $(hostname)" LOGOIMG=/sarg/images/sarg.png LOGOLINK="http://$(hostname)/" DAILY=Daily WEEKLY=Weekly MONTHLY=Monthly EXCLUDELOG1="SARG: No records found" EXCLUDELOG2="SARG: End" debian/copyright0000644000000000000000000000477711236151215011135 0ustar This package was first debianized by Ivan E. Moore II on Tue, 7 Mar 2000 21:37:57 -0700. The current maintainer is Luigi Gangitano It was downloaded from http://web.onda.com.br/orso/index.html Authors: Pedro L Orso Alp Andreas Piesk Andrew Andrew Barnes Carlos Canau Carlos Santillana Csaba Kabai Dima I. Allaverdov Eugeny Kuzakov Evren Yurtesen Evren Yurtesen Hanni Daniel Ilya V. Komarov Jose Luiz Lee Shakespeare Leonardo A. D'Angelo Manon Goo Matteo Colombo Maxim Berlin Palamarchuk Eugen Patrick Darden Rick_Barzilli@xircom.com Ryan Roehrich Steve Chan Tony Lorimes Wayne Bastow drdivano@mail.axon.ru Seth Mos Carlo Marcelo Arenas Belon Milos Prudek Pavel Jezek Kenneth Ingham Schlosser, Carsten ECOFIS Andrew Katkov Andy Parfenov Bernd Kossmann Ivan Minchev Olivier Rousselot Copyright: This program is Copyright (C) 1998 by Pedro Lineu Orso. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. You can find a full copy of the GPL in /usr/share/common-licenses/GPL debian/postrm0000644000000000000000000000225411322664631010444 0ustar #! /bin/sh set -e case "$1" in abort-upgrade) version=$2 if dpkg --compare-versions "$2" lt 2.2.6-1; then if test -f /etc/sarg/sarg.conf; then mv /etc/sarg/sarg.conf /etc/squid fi if test -f /etc/sarg/exclude_codes; then mv /etc/sarg/exclude_codes /etc/squid/sarg.exclude_codes fi if test -f /etc/sarg/exclude_hosts; then mv /etc/sarg/exclude_hosts /etc/squid/sarg.hosts fi if test -f /etc/sarg/sarg-reports.conf; then mv /etc/sarg/sarg-reports.conf /etc/squid fi if test -f /etc/sarg/exclude_users; then mv /etc/sarg/exclude_users /etc/squid/sarg.users fi if test -f /etc/sarg/usertab; then mv /etc/sarg/usertab /etc/squid/usertab fi if test -f /etc/sarg/user_limit_block; then mv /etc/sarg/user_limit_block /etc/squid fi if test -d /usr/share/sarg/languages; then mv /usr/share/sarg/languages /etc/squid fi if test -d /usr/share/sarg/images; then mv /usr/share/sarg/images /etc/squid fi if test -d /usr/share/sarg/fonts; then mv /usr/share/sarg/fonts /etc/squid fi if test -d /var/lib/sarg; then mv /var/lib/sarg /var/www/squid-reports fi fi ;; esac #DEBHELPER# debian/preinst0000644000000000000000000000407411527540001010575 0ustar #! /bin/sh set -e # Prepare to move a conffile without triggering a dpkg question prep_mv_conffile() { local PKGNAME="$1" local CONFFILE="$2" [ -e "$CONFFILE" ] || return 0 local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')" local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \ sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")" if [ "$md5sum" = "$old_md5sum" ]; then rm -f "$CONFFILE" fi } # Remove a no-longer used conffile rm_conffile() { local PKGNAME="$1" local CONFFILE="$2" [ -e "$CONFFILE" ] || return 0 local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')" local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \ sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")" if [ "$md5sum" != "$old_md5sum" ]; then echo "Obsolete conffile $CONFFILE has been modified by you." echo "Saving as $CONFFILE.dpkg-bak ..." mv -f "$CONFFILE" "$CONFFILE".dpkg-bak else echo "Removing obsolete conffile $CONFFILE ..." rm -f "$CONFFILE" fi } case "$1" in upgrade) version=$2 if dpkg --compare-versions "$2" lt 2.2.6-1; then prep_mv_conffile sarg "/etc/squid/sarg.conf" prep_mv_conffile sarg "/etc/squid/sarg.exclude_codes" prep_mv_conffile sarg "/etc/squid/sarg.hosts" prep_mv_conffile sarg "/etc/squid/sarg-reports.conf" prep_mv_conffile sarg "/etc/squid/sarg.users" prep_mv_conffile sarg "/etc/squid/sarg.usertab" prep_mv_conffile sarg "/etc/squid/user_limit_block" rm_conffile sarg "/etc/squid/fonts/DejaVuSans.ttf" rm_conffile sarg "/etc/squid/fonts/FreeSans.ttf" if test -d /etc/squid/languages; then rm -rf /etc/squid/languages fi if test -d /etc/squid/images; then mv /etc/squid/images /usr/share/sarg fi if test -d /var/www/squid-reports; then if test -d /var/lib/sarg ; then mv /var/www/squid-reports/* /var/lib/sarg || true rmdir /var/www/squid-reports else mv /var/www/squid-reports /var/lib/sarg || true fi fi fi ;; esac #DEBHELPER# debian/docs0000644000000000000000000000002411236151214010031 0ustar README CONTRIBUTORS debian/source/0000755000000000000000000000000012141745632010473 5ustar debian/source/format0000644000000000000000000000001411676130325011700 0ustar 3.0 (quilt) debian/undocumented0000644000000000000000000000001711236151214011575 0ustar sarg-reports.8 debian/patches/0000755000000000000000000000000012141745632010622 5ustar debian/patches/02_config-file-references.patch0000644000000000000000000000230311676130325016442 0ustar Author: Luigi Gangitano Description: No description. --- a/sarg-php/sarg-block-it.php +++ b/sarg-php/sarg-block-it.php @@ -25,7 +25,7 @@ * */ -$filename = "/usr/local/squid/etc/block.txt"; +$filename = "/etc/squid/block.txt"; $url = $_GET['url']; $url = $url."\n"; --- a/sarg-php/sarg-squidguard-block.php +++ b/sarg-php/sarg-squidguard-block.php @@ -26,8 +26,8 @@ */ // Change to squidGuard and sarg config file paths -$SargConf = "/usr/local/sarg/sarg.conf"; -$squidGuardConf = "/usr/local/squidGuard/squidGuard.conf"; +$SargConf = "/etc/squid/sarg.conf"; +$squidGuardConf = "/etc/squid/squidGuard.conf"; global $SargConf; global $dbhome; @@ -37,7 +37,6 @@ include_once("style.php"); $url = $_GET['url']; -$squidGuard_conf = '/usr/local/squidGuard/squidGuard.conf'; function parse_config($line,$clave) { if (preg_match("/dbhome/i", $line)) { --- a/user_limit_block +++ b/user_limit_block @@ -24,8 +24,8 @@ # # -conf="/usr/local/sarg/sarg.conf" -squid_password_file="/usr/local/squid/etc/passwd" +conf="/etc/squid/sarg.conf" +squid_password_file="/etc/squid/passwd" tmp="/tmp/sarg_limit.$$" limit_file=`grep "per_user_limit" $conf|grep -v "#"|awk '{print $2}'` debian/patches/series0000644000000000000000000000004011676130325012030 0ustar 02_config-file-references.patch debian/sarg-reports0000644000000000000000000002322611527065362011555 0ustar #!/bin/bash # SARG - Daily/Weekly/Monthly Squid usage reports creation tool # Written by Ugo Viti # Thanks for enanchements to: # - martijn # - Stas Degteff https://sourceforge.net/users/stas_degteff/ VER=20050202 ## What is this? # sarg-reports (this file) is a simple bash script written to automate # the SARG (a powerful squid log analyzer) reports and log management. # Sarg it self, provide to end user a generic interface to create # reports based on squid access log (begin of log to current date). # sarg-reports (this script) is useful because it allow you to easly # create and manage Daily, Weekly and Monthly reports. # Try it, within 5 minutes you will be ready to rule :-) # using sarg-reports is very easy, read the following 3 steps to know how ## Requirements # a) An unix system with bash shell (like GNU/Linux, FreeBSD, etc...) # b) Squid - http://www.squid-cache.org # c) Sarg - http://web.onda.com.br/orso/sarg.html ## ## Installation guide and configuration parameters ## # 1) Download Squid and Sarg, Install, Configure and Tune # they before continue reading # 2) In root crontab (crontab -e) insert the following lines: # (the today report creation time depend mostly of your squid server # load average, tune it): # # --- BEGIN ROOT CRONTAB --- # PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin # 00 08-18/1 * * * sarg-reports today # 00 00 * * * sarg-reports daily # 00 01 * * 1 sarg-reports weekly # 30 02 1 * * sarg-reports monthly # --- END ROOT CRONTAB --- # # REMEMBER: if you use logrotate, configure it to rotate the logs within MONTHLY basis, # AFTER sarg-reports created the monthly html report. # 3) Customize the following variables: # (Please, configure accurately the sarg.conf file before) # # (SARG) The sarg executable location # (CONFIG) The sarg main configuration file location # (HTMLOUT) Location where will be saved the reports # (PAGETITLE) The title of main index page # (LOGOIMG) Image logo to view in main index page # (LOGOLINK) HTTP web page link of logo # (DAILY) Word 'daily' translation, translate it to your language # (WEEKLY) Word 'weekly' translation, translate it to your language # (MONTHLY) Word 'monthly' translation, translate it to your language # (EXCLUDELOG1) Exclude text from cron emails # + (normally, sarg, during cron activity, if it don't find any valid records, # (EXCLUDELOG2) it will output an error message (usually on 'today' reports). # I don't want to be warned by email about this, so, i wrote the 'text' # that will be never logged. # This is useful to receive email of real problems only (enjoy that) [ -f /etc/sarg/sarg-reports.conf ] || exit 0 . /etc/sarg/sarg-reports.conf #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ## Italian Language # SARG=/usr/bin/sarg # CONFIG=/etc/sarg/sarg.conf # HTMLOUT=/var/www/html/admin/log/proxy # PAGETITLE="Statistiche Proxy di $(hostname)" # LOGOIMG=http://www.initzero.it/images/initzero-logo.jpg # LOGOLINK=http://www.initzero.it # DAILY=Giornaliero # WEEKLY=Settimanale # MONTHLY=Mensile #EXCLUDELOG1="SARG: Nessun records trovato." #EXCLUDELOG2="SARG: Fine" #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ## Russian Language # SARG="/usr/bin/sarg" # CONFIG=/etc/sarg/sarg.conf # HTMLOUT=/var/www/sarg-reports # PAGETITLE="óÔÁÔÉÓÔÉËÁ ÓÅÒ×ÅÒÁ ÐÒÏËÓÉ Squid" # russian koi8-r # LOGOIMG=http://litek.ru/images/logotop.gif # LOGOLINK=http://litek.ru # DAILY="åÖÅÄÎÅ×ÎÁÑ" # russian koi8-r # WEEKLY="åÖÅÎÅÄÅÌØÎÁÑ" # russian koi8-r # MONTHLY="åÖÅÍÅÓÑÞÎÁÑ" # russian koi8-r #EXCLUDELOG1="SARG: Records in file:" #EXCLUDELOG2="SARG: ïÔÞÅÔ ÕÓÐÅÛÎÏ ÓÇÅÎÅÒÉÒÏ×ÁÎ ×" # sarg.conf: language Russian_koi8 #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ###################################################################### ## The configuration is end, so don't touch anything bellow # TEMP Files TMPFILE=`/bin/mktemp` ERRORS="${TMPFILE}.errors" # Date Calc MANUALDATE=$2 case "$(uname)" in "FreeBSD") TODAY=$(date +%d/%m/%Y) YESTERDAY=$(date -v-1d +%d/%m/%Y) WEEKAGO=$(date -v-1w +%d/%m/%Y) MONTHAGO=$(date -v-1m +01/%m/%Y)-$(date -v-1m +31/%m/%Y) ;; "OpenBSD") TODAY=$(date +%d/%m/%Y) YESTERDAY=$(date -r $((`date +%s` - 86400 )) +%d/%m/%Y) WEEKAGO=$(date -r $((`date +%s` - 604800)) +%d/%m/%Y) MONTHAGO=$(perl -e '@t=localtime(time); $y=$t[4]==0?$t[5]+1899:$t[5]+1900; $m=$t[4]==0?12:$t[4]; print "1/$m/$y-",$m==2?$y%4>0?28:29:$m==4||$m==6||$m==9||$m==11?30:31 ,"/$m/$y\n";') ;; *) TODAY=$(date --date "today" +%d/%m/%Y) YESTERDAY=$(date --date "1 day ago" +%d/%m/%Y) WEEKAGO=$(date --date "1 week ago" +%d/%m/%Y) MONTHAGO=$(date --date "1 month ago" +01/%m/%Y)-$(date --date "1 month ago" +31/%m/%Y) ;; esac # Fix for Red Hat 9 systems and coreutils prior to 5.0 version export LC_ALL=C # Main index.html creation create_index_html () { echo -e "\ \n\ \n\ $PAGETITLE\n\ \n\ \n\
\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\
$PAGETITLE
$DAILY
$WEEKLY
$MONTHLY
\n\
\n\ \n\ " > $HTMLOUT/index.html } reports_autorm () { BAKLIST="${TMPFILE}.BAKLIST" BAKLISTTOLEAVELIST="${BAKLIST}.TOLEAVE.LIST" BAKLISTTOLEAVEFIND="${BAKLIST}.TOLEAVE.FIND" touch $BAKLIST $BAKLISTTOLEAVELIST $BAKLISTTOLEAVEFIND cd $DESTINATION find -name "*$BAKNAME*" -maxdepth 1 | sed -e 's/.\///' | grep -wv "." | sort 1> $BAKLIST let TOLEAVEDAYS="$DAYBAK+1" if [ $TOLEAVEDAYS -ge "0" ] then cat $BAKLIST | tail -n $TOLEAVEDAYS > $BAKLISTTOLEAVELIST for BAK in $(cat $BAKLISTTOLEAVELIST) do echo "! -name $BAK" >> $BAKLISTTOLEAVEFIND done fi CURRENTH=$(date +%H) CURRENTM=$(date +%M) if [ ${CURRENTH:0:1} = 0 ] then CURRENTH=${CURRENTH:1:1} fi if [ ${CURRENTM:0:1} = 0 ] then CURRENTM=${CURRENTM:1:1} fi let MINUTES="((($DAYBAK*24)+$CURRENTH)*60)+$CURRENTM+1" # Purging old backups, only if backup return "OK" status find $DESTINATION -name "*$BAKNAME*" $(cat $BAKLISTTOLEAVEFIND) -maxdepth 1 -mmin +$MINUTES -exec rm -rf {} \; #find $DESTINATION $(cat $BAKLISTTOLEAVEFIND) -maxdepth 1 -mmin +$MINUTES -exec rm -rf {} \; } # Functions exclude_from_log () { cat $ERRORS | grep -v "$EXCLUDELOG1" | grep -v "$EXCLUDELOG2" rm -f $TMPFILE* } manual () { DAILYOUT=$HTMLOUT/$DAILY mkdir -p $DAILYOUT create_index_html if [ -z "$MANUALDATE" ] then echo "No date given, please specify a valid date (DD/MM/YYYY)" else $SARG -f $CONFIG -d $MANUALDATE -o $DAILYOUT fi } today () { DAILYOUT=$HTMLOUT/$DAILY mkdir -p $DAILYOUT create_index_html $SARG -f $CONFIG -d $TODAY -o $DAILYOUT >$ERRORS 2>&1 exclude_from_log } daily () { DAILYOUT=$HTMLOUT/$DAILY mkdir -p $DAILYOUT create_index_html $SARG -f $CONFIG -d day-1 -o $DAILYOUT >$ERRORS 2>&1 exclude_from_log } weekly () { WEEKLYOUT=$HTMLOUT/$WEEKLY mkdir -p $WEEKLYOUT create_index_html $SARG -f $CONFIG -d week-1 -o $WEEKLYOUT >$ERRORS 2>&1 exclude_from_log } monthly () { MONTHLYOUT=$HTMLOUT/$MONTHLY mkdir -p $MONTHLYOUT create_index_html $SARG -f $CONFIG -d month-1 -o $MONTHLYOUT >$ERRORS 2>&1 exclude_from_log } case $1 in manual) manual ;; today) today ;; daily) daily ;; weekly) weekly ;; monthly) monthly ;; *) echo "SARG - Daily / Weekly / Monthly - Squid proxy usage reports creation tool" echo "Written by Ugo Viti " echo "Version: $VER" echo echo "Usage: $0 [OPTIONS]" echo echo "Allowed options:" echo " manual, Create Manual report" echo " today, Create Today report" echo " daily, Create Daily report" echo " weekly, Create Weekly report" echo " monthly, Create Monthly report" exit 0 esac ## HISTORY: # 20050502 - Stas Degteff added support for non latin Charset and added support for OpenBSD # 20030826 - FreeBSD support (thanks to martijn to let me coding on your FreeBSD server :-)) # 20030715 - Some cleanups # 20030623 - Manual report creation # 20030620 - Main Index creation # 20030619 - Solved 'sort' bug on Red Hat 9 systems # 20030618 - First Version ## TODO: # - Smarty weekly recognition... # Like "begin of last week to end of last week", # doesn't like this script do: "7 days ago to yesterday" # - Monthly recognition isn't so elegant (is very ugly, i know) # - Suggestions are welcome :-) # - If you Rotate the squid logs before sarg-reports will run, # it will not create any html reports # (TIPS: Rotate the logs after sarg-reports) debian/compat0000644000000000000000000000000212141741373010367 0ustar 9 debian/control0000644000000000000000000000131212141742471010571 0ustar Source: sarg Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1~), autotools-dev, libgd2-noxpm-dev | libgd2-xpm-dev, libldap2-dev Section: web Priority: optional Maintainer: Luigi Gangitano Standards-Version: 3.9.4 Package: sarg Architecture: any Replaces: sqmgrlog Depends: ${shlibs:Depends}, ${misc:Depends}, ttf-dejavu-core | ttf-freefont Suggests: squid, httpd | apache2, squidguard, libapache2-mod-php5 Conflicts: sqmgrlog Description: squid analysis report generator 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. debian/postinst0000644000000000000000000000251611353532744011007 0ustar #! /bin/sh set -e # Move a conffile without triggering a dpkg question mv_conffile() { local OLDCONFFILE="$1" local NEWCONFFILE="$2" [ -e "$OLDCONFFILE" ] || return 0 echo "Preserving user changes to $NEWCONFFILE ..." mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new mv -f "$OLDCONFFILE" "$NEWCONFFILE" } case "$1" in install|configure) if dpkg --compare-versions "$2" lt 2.2.6-1; then mv_conffile "/etc/squid/sarg.conf" "/etc/sarg/sarg.conf" mv_conffile "/etc/squid/sarg.exclude_codes" "/etc/sarg/exclude_codes" mv_conffile "/etc/squid/sarg.hosts" "/etc/sarg/exclude_hosts" mv_conffile "/etc/squid/sarg-reports.conf" "/etc/sarg/sarg-reports.conf" mv_conffile "/etc/squid/sarg.users" "/etc/sarg/exclude_users" mv_conffile "/etc/squid/sarg.usertab" "/etc/sarg/usertab" mv_conffile "/etc/squid/user_limit_block" "/etc/sarg/user_limit_block" fi if [ -e /etc/squid/fonts/Verdana.TTF ] ; then rm /etc/squid/fonts/Verdana.TTF fi if [ -e /etc/squid/fonts/license ] ; then rm /etc/squid/fonts/license fi if [ -e /etc/squid/fonts/README ] ; then rm /etc/squid/fonts/README fi if [ -e /etc/squid/sarg-maint.sh ] ; then rm /etc/squid/sarg-maint.sh fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) # # Unknown action - do nothing. # exit 0 ;; esac #DEBHELPER# debian/sarg-reports.10000644000000000000000000000660312141744472011713 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH SARG-REPORTS 1 "may 17, 2008" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME sarg-reports \- Daily/Weekly/Monthly squid usage reports creation tool .SH SYNOPSIS .B sarg-reports .RB [OPTIONS] .SH DESCRIPTION This manual page documents briefly the .B sarg-reports command. .PP .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBsarg-reports\fP is a script written to automate the SARG (a powerful squid log analyzer) reports and log management. Sarg it self, provide to end user a generic interface to create reports based on squid access log (begin of log to current date). sarg-reports is useful because it allow you to easly create and manage Daily, Weekly and Monthly reports. .SH OPTIONS A summary of options is included below. .TP .B manual .br Create Manual report .TP .B today Create Today report .TP .B daily Create Daily report .TP .B weekly Create Weely report .TP .B monthly Create Monthly report .SH CRONTAB If you want the reports can be generated automatically insert the following lines (the today report creation time depend mostly of your sarg server load average, tune it): .PP .br PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin .br 00 08-18/1 * * * sarg-reports today .br 00 00 * * * sarg-reports daily .br 00 01 * * 1 sarg-reports weekly .br 30 02 1 * * sarg-reports monthly .br .PP REMEMBER: if you use logrotate, configure it to rotate the logs within MONTHLY basis, AFTER sarg-reports created the monthly html report. .SH VARIABLES Check before using the sarg-reports that the following variables are set to file /etc/sarg/sarg-reports.conf .TP .B SARG .br The sarg executable location .TP .B CONFIG .br The sarg main configuration file location .TP .B HTMLOUT .br Location where will be saved the reports .TP .B PAGETITLE .br The title of main index page .TP .B LOGOIMG .br Image logo to view in main index page .TP .B LOGOLINK .br HTTP web page link of logo .TP .B DAILY .br Word 'daily' translation, translate it to your language .TP .B WEEKLY .br Word 'weekly' translation, translate it to your language .TP .B MONTHLY .br Word 'monthly' translation, translate it to your language .TP .B EXCLUDELOG1 .br Exclude text from cron emails (normally, sarg, during cron activity, if it don't find any valid records, .TP .B EXCLUDELOG2 .br It will output an error message (usually on 'today' reports). I don't want to be warned by email about this, so, i wrote the 'text' that will be never logged. This is useful to receive email of real problems only. .SH AUTHOR sarg-reports was written by Ugo Viti .PP This manual page was written by Juan Angulo Moreno , for the Debian project (but may be used by others). debian/changelog0000644000000000000000000005113712146260431011046 0ustar sarg (2.3.6-1build1) saucy; urgency=low * Rebuild for libgd3. -- Colin Watson Mon, 20 May 2013 00:32:41 +0100 sarg (2.3.6-1) unstable; urgency=low * New upstream release * debian/{compat,control,rules} - Move the debhelper 9 compatibility and enable hardening flags * debian/control - Added dependency on dpkg-dev (>= 1.16.1~) - Bumped Standard-Version to 3.9.4 (no change needed) * debian/rules - Add executable bit to /etc/sarg/user_limit_block * debian/sarg-reports.1 - Fixed configuration file reference (Closes: #674036) -- Luigi Gangitano Mon, 06 May 2013 16:39:45 +0200 sarg (2.3.2-2) unstable; urgency=low * debian/rules - Fixed wrong auto detection of build system by dh (Closes: #654319) -- Luigi Gangitano Fri, 06 Jan 2012 01:32:52 +0100 sarg (2.3.2-1) unstable; urgency=low * New upstream release - Fixes FTBFS with latest GCC (Closes: #626228) * debian/{control,rules,install,manpages,source/format,patches/*} - Switch to source format 3.0 (quilt) * debian/control - Bumped Standard-Version to 3.9.2 (no change needed) -- Luigi Gangitano Mon, 26 Dec 2011 18:21:40 +0100 sarg (2.3.1-2) unstable; urgency=low * debian/{patches/03_build-with-gcc44,rules} - Removed configure.in patch, replaced with LDFLAG in debian/rules, thanks to Andrea Gasparini -- Luigi Gangitano Sat, 19 Feb 2011 17:48:24 +0100 sarg (2.3.1-1) unstable; urgency=low * New upstream release * debian/sarg-reports - Fix date interval for daily/weekly/monthly (Closes: #592705) * debian/preinst - Remove old language files (Closes: #606778) - Fix moving output files on upgrade * debian/patches/03_build-with-gcc44 - Added libm check to configure.in to comply with gcc-4.4 linker chages * debian/control - Bumped Standard-Version to 3.9.1 (no change needed) -- Luigi Gangitano Fri, 18 Feb 2011 19:59:33 +0100 sarg (2.3-1) unstable; urgency=low * New upstream release * debian/rules - Removed references to now non existent language dir * debian/control - Added build dependency on libldap2-dev - Bumped Standard-Version to 3.8.4 (no change needed) * debian/sarg.conf - Updated to match new upstream config file * debian/preinst - Fix moving old data files -- Luigi Gangitano Sat, 26 Jun 2010 00:49:09 +0200 sarg (2.2.7.1-2) unstable; urgency=low * debian/{preinst,postinst} - Move configuration files preserving user changes (Closes: #566402) - Do not move duplicate fonts - Remove fonts marked as configuration files -- Luigi Gangitano Sun, 28 Mar 2010 01:33:48 +0100 sarg (2.2.7.1-1) unstable; urgency=low * New upstream release * debian/sarg.conf - Updated default configuration file to match upstream changes. - Removed invalid config directive (Closes: #568009) * debian/README.source - Added simple dpatch-referring REAMDE.source * debian/{rules,control} - Remove duplicate font files and depend on ttf-dejavu-core | ttf-freefont (Closes: #567329) -- Luigi Gangitano Tue, 16 Feb 2010 11:07:18 +0100 sarg (2.2.7-1) UNRELEASED; urgency=low * New upstream release - Fixes sarg.hosts exclusion for subdomains (Closes: #408577) * debian/patches/01_makefile-install-path - Removed patch integrated upstream * debian/rules - Use --enable-sargphp instead of --enable-htmldir -- Luigi Gangitano Mon, 08 Feb 2010 08:00:10 +0100 sarg (2.2.6-1) unstable; urgency=low * New upstream release - Fixes issues in getword loop detection (Closes: #522284) - Removed patches integrated upstream - Fixes usertab parsing for IPv6 address (Closes: #504749) - Fixes typo in dansguardian_log.c (Closes: #540438) - Fixes error parsing squidGuard logs (Closes: #486895) * debian/sarg-reports.conf - Fixed typo (Closes: #517356) * debian/control - Added Build-Dep options on libgd2-xpm-dev (Closes: #540121) - Added Dependency on ${misc:Depends} - Added dependency on dpatch - Bumped Standard-Version to 3.8.3 * debian/compat - Upgraded debhelper compatibility to level 6 * debian/rules - Removed unnecessary upgrade of autoconf files - Added dpatch rules - Fixed configuration options and paths * debian/patches/01_makefile-install-path - Fixed build-time installation paths * debian/patches/02_config-file-references - Fixed references to configuration files * debian/squid.conf - Sinced with upstream changes * debian/{postrm,preinst,sarg.conf,sarg-reports,rules,dirs,sarg-reports.conf} - Moved configuration files to /etc/sarg and data directory to /var/lib/sarg (Closes: #553554, #502273) -- Luigi Gangitano Mon, 11 Jan 2010 15:07:10 +0100 sarg (2.2.5-2) unstable; urgency=low * debian/watch - Use SF redirector and make lintian happy * debian/{rules,compat} - Move DH_COMPAT to debian/compat and make lintian happy * debian/rules - Change make clean invocation and make lintian happier - Added support for DEB_BUILD_OPTIONS - Move documentation files from sarg-php to doc directory - Remove hidden file from /etc/squid/languages * debian/control - Removed dependency on bash, now essential - Bumped Standard-Version to 3.8.0 * debian/postinst - Make postint fail on error * debian/copyright - Added copyright notice - Updated maintainer reference * debian/sarg-reports.1 - Added man page, thanks to Juan Angulo Moreno (Closes: #481889) * debian/patches/show_read_statistics.patch - Added patch from Vladimir Lettiev fixing segfault with show_read_statistics set to no. (Closes: #444845, # 370811) * debian/patches/totger_patches.patch - Added patch from Thomas Bliesener fixing several buffer overflows (Closes: #470791) * debian/patches/opensuse_1_getword_boundary_limit.patch - Added patch from OpenSUSE to avoid segfaults in getword() calls * debian/patches/opensuse_2_enlarge_report_buffers.patch - Added patch from OpenSUSE to avoid overflow in report buffers * debian/patches/opensuse_3_too_small_font_buffer.patch - Added patch from OpenSUSE to avoid overflow in font buffer * debian/patches/opensuse_4_enlarge_log_buffer.patch - Added patch from OpenSUSE to avoid overflow in log buffer * debian/patches/opensuse_5_limit_sprintf.patch - Added patch from OpenSUSE to avoid segfaults in sprintf() calls * debian/patches/opensuse_6_limit_useragent_sprintf.patch - Added patch from OpenSUSE to avoid segfaults in sprintf() calls * debian/patches/opensuse_7_year_assertion.patch - Added patch from OpenSUSE to avoid assertion in year parsing -- Luigi Gangitano Sat, 10 Jan 2009 18:14:18 +0100 sarg (2.2.5-1) unstable; urgency=high * Urgency high due to security fixes * New upstream release - Fixes script insertion in user-agent report * debian/{sarg-reports,control} - Make sarg-reports a bash script and depend on bash. This works around bashishms in sarg-reports. (Closes: #465353) -- Luigi Gangitano Wed, 05 Mar 2008 00:34:29 +0100 sarg (2.2.4-1) UNRELEASED; urgency=low * New upstream release - Fixes security issue when parsing useragent.log -- Luigi Gangitano Mon, 03 Mar 2008 12:39:26 +0100 sarg (2.2.3.1-3) UNRELEASED; urgency=low * debian/control - Upgraded dependecies to apache2 and libapache2-mod-php5 -- Luigi Gangitano Fri, 4 Sep 2007 21:17:51 +0200 sarg (2.2.3.1-2) unstable; urgency=low * debian/sarg-reports.conf - Changed default image to sarg.png (Closes: #365664) * debian/sarg-reports - Fixed bashism (Closes: #423497) * debian/{sarg-reports,README.Debian} - Fixed typos (Closes: #430356) * user_limit_block - Fixed wrong references to configuration files (Closes: #401520) -- Luigi Gangitano Mon, 29 Jun 2007 20:50:16 +0200 sarg (2.2.3.1-1) unstable; urgency=low * New upstream release -- Luigi Gangitano Mon, 09 Apr 2007 11:15:09 +0200 sarg (2.2.2-1) unstable; urgency=low * New upstream release -- Luigi Gangitano Thu, 31 Aug 2006 18:03:25 +0200 sarg (2.2.1-2) unstable; urgency=low * debian/rules - removed bashish (Closes: #373244) * debian/control - Bumped Standard-Version to 3.7.2 (no change required) -- Luigi Gangitano Wed, 14 Jun 2006 14:30:16 +0200 sarg (2.2.1-1) unstable; urgency=low * New upstream release - Fixes various segfaults (Closes: #362310) * debian/sarg-reports.cron.{weekly,monthly} - Fixed typo (Closes: #365336) -- Luigi Gangitano Fri, 9 Jun 2006 17:10:26 +0200 sarg (2.1-4) unstable; urgency=low * debian/control - Removed parentheses from Suggests: line (Closes: #356404) -- Luigi Gangitano Sun, 19 Mar 2006 00:51:24 +0100 sarg (2.1-3) unstable; urgency=low * debian/sarg-reports - Switched to Ugo Viti's script for crontab execution (daily, weekly, montly) (Closes: #332391, #162974) - Removed old sarg-maint.sh from /etc (Closes: #326214) - Updated NEWS.Debian accordingly -- Luigi Gangitano Tue, 20 Dec 2005 20:19:29 +0100 sarg (2.1-2) unstable; urgency=low * debian/control - Changed build-depends to libgd2-noxpm-dev, since libgd2-dev is not in debian anymore. (Closes: #343919, #307999) -- Luigi Gangitano Tue, 20 Dec 2005 16:25:09 +0100 sarg (2.1-1) unstable; urgency=low * New upstream release * debian/postinst - Added token for debhelper * debian/copyright - Updated FSF address * debian/control - Bumped Standards-Version to 3.6.1. No change needed. * debian/rules - Bumped DH_COMPAT to 4 -- Luigi Gangitano Thu, 1 Dec 2005 20:29:54 +0100 sarg (2.0.9-1) unstable; urgency=low * New upstream release - Fixes call to sort without quotes (Closes: #317901) * debian/rules - Moved license and README files for the attache font to /usr/share/doc/sarg * debian/postinst - Check for presence of /etc/squid/fonts/{license,README} and remove -- Luigi Gangitano Tue, 9 Aug 2005 16:18:36 +0200 sarg (2.0.8-2) unstable; urgency=low * sarg.1 - Fixed reference to configuration and log files (Closes: #319058) -- Luigi Gangitano Wed, 20 Jul 2005 00:47:24 +0200 sarg (2.0.8-1) unstable; urgency=low * New upstream release * debian/postinst - Added postinst file - Check for presence of /etc/squid/fonts/Verdana.TTF and remove The font file is non-free -- Luigi Gangitano Thu, 9 Jun 2005 18:16:02 +0200 sarg (2.0.7-1) unstable; urgency=medium * New upstream release * Urgency medium because segfault fixes in this (and previous) version should go in Sarge * debian/squid.conf - Sinced with upstream changes (addition of dansguardian configuration and ntlm username format) -- Luigi Gangitano Tue, 3 May 2005 09:14:44 +0200 sarg (2.0.6-2) unstable; urgency=low * language/Turkish - applied sarg-turkish.patch fixing syntax errors (Closes: #279636) -- Luigi Gangitano Tue, 26 Apr 2005 12:24:23 +0200 sarg (2.0.6-1) unstable; urgency=low * New upstream release * languages/French - removed sarg-french.patch that have been superceeded upstream -- Luigi Gangitano Sun, 24 Apr 2005 01:52:18 +0200 sarg (2.0.5-2) unstable; urgency=low * debian/watch - Added watch file -- Luigi Gangitano Wed, 23 Mar 2005 15:33:35 +0100 sarg (2.0.5-1) unstable; urgency=low * New upstream release - Should fix some random segfaults -- Luigi Gangitano Wed, 23 Mar 2005 14:55:05 +0100 sarg (2.0.4-1) unstable; urgency=low * New upstream release -- Luigi Gangitano Thu, 24 Feb 2005 17:36:51 +0100 sarg (2.0.3-1) unstable; urgency=low * New upstream release * debian/patches/sarg-2.0.2-version.patch - Removed upstream patch that has been integrated * debian/control - converted description synopsis to lower case -- Luigi Gangitano Thu, 3 Feb 2005 22:53:56 +0100 sarg (2.0.2-1) unstable; urgency=low * New upstream release * debian/patches/sarg-2.0.2-version.patch - Added upstream patch to fix wrong result in -v option -- Luigi Gangitano Wed, 24 Nov 2004 00:06:53 +0100 sarg (2.0.1-1) unstable; urgency=low * New upstream release * debian/rules - Moved autoconf update in build to shrink diff file * debian/control - Added libgd2-dev dependency - Added suggestion to squidguard and libapache-mod-php4 -- Luigi Gangitano Tue, 5 Oct 2004 10:30:28 +0200 sarg (1.4.r1-3) unstable; urgency=low * sarg.1 - Fixed duplicated manpage (Closes: #246745) * debian/control - Bumped Standard-Version to 3.6.1 (no change needed) - Fixed depends on virtual package httpd (suggested apache) -- Luigi Gangitano Sat, 1 May 2004 23:13:51 +0200 sarg (1.4.r1-2) unstable; urgency=low * index.c - Applied sarg-index-patch from upstream * debian/control - Bumped Standard-Version to 3.5.10 (no change needed) -- Luigi Gangitano Wed, 9 Jul 2003 20:14:39 +0200 sarg (1.4.r1-1) unstable; urgency=low * New upstream release * README - updated from upstream site - removed duplicate text (closes: #192269) * languages/French - applied sarg-french.patch (closes: #189125) * languages/Polish - applied sarg-polish.patch (closes: #189178) -- Luigi Gangitano Mon, 12 May 2003 17:06:45 +0200 sarg (1.4.patch3-1) unstable; urgency=low * New upstream release -- Luigi Gangitano Sun, 13 Apr 2003 21:01:00 +0200 sarg (1.4.patch1-1) unstable; urgency=low * New upstream release * Bumped Standard-Version to 3.5.9 -- Luigi Gangitano Sun, 20 Mar 2003 19:11:00 +0100 sarg (1.3-PRE1-2) unstable; urgency=low * Copy config.guess/config.sub from autotools-dev (closes: #168577) * Debian Policy updated to 3.5.7.1 -- Luigi Gangitano Sun, 10 Nov 2002 22:57:54 +0100 sarg (1.3-PRE1-1) unstable; urgency=low * New upstream release -- Luigi Gangitano Thu, 17 Oct 2002 20:31:02 +0200 sarg (1.2.2-1) unstable; urgency=low * New upstream release -- Luigi Gangitano Wed, 5 Jun 2002 01:50:52 +0200 sarg (1.2.1-6) unstable; urgency=low * Fixed missing reference to the author * Deleted empty file in /etc/squid/languages * Added manpage for SARG(1) -- Luigi Gangitano Sun, 28 Apr 2002 22:46:54 +0200 sarg (1.2.1-5) unstable; urgency=low * Brought back from the morgue. (new maintainer) * debian/sarg.conf: applied patch from 133903 (closes: #133903) * Bug 110610 was fixed but not closed (closes: #110610) -- Frederic Peters Thu, 25 Apr 2002 10:19:11 +0200 sarg (1.2.1-4) unstable; urgency=low * Change maintainer -- Ivan E. Moore II Wed, 06 Mar 2001 18:12:00 -0700 sarg (1.2.1-3) unstable; urgency=low * Fix sarg-maint (Closes: #136445) -- Ivan E. Moore II Sat, 02 Mar 2001 09:01:00 -0700 sarg (1.2.1-2) unstable; urgency=low * Fix sarg-maint (Closes: #128706) * Fix sarg.conf as well * Nobody ITA'd it so I'll just close that and keep the package (Closes: #127703) -- Ivan E. Moore II Sun, 17 Feb 2001 18:13:00 -0700 sarg (1.2.1-1) unstable; urgency=low * New upstream version (Closes: #122497) -- Ivan E. Moore II Wed, 05 Dec 2001 09:58:00 -0700 sarg (1.2.0-0beta2-4) unstable; urgency=low * Build cleanup * Lintian cleanup -- Ivan E. Moore II Sun, 02 Nov 2001 22:43:00 -0700 sarg (1.2.0-0beta2-3) unstable; urgency=low * Fix spelling errors (Closes: #108991) -- Ivan E. Moore II Fri, 07 Sep 2001 16:36:00 -0700 sarg (1.2.0-0beta2-2) unstable; urgency=low * Provide undocumented manpage link (Closes: #110081) * Lintian cleanup -- Ivan E. Moore II Sun, 26 Aug 2001 00:28:00 -0700 sarg (1.2.0-0beta2-1) unstable; urgency=low * New upstream beta -- Ivan E. Moore II Thu, 05 Jul 2001 09:22:00 -0700 sarg (1.2.0-0beta1-1) unstable; urgency=low * New upstream beta -- Ivan E. Moore II Thu, 07 Jun 2001 00:43:00 -0700 sarg (1.1.1-4) unstable; urgency=low * Fix link (Closes: #98690) -- Ivan E. Moore II Fri, 25 May 2001 08:32:00 -0700 sarg (1.1.1-3) unstable; urgency=low * Update Standards version * Update Build-Depends * Remove old hacks which debhelper now handles * Change Recommends to Suggests (Closes: #97468) -- Ivan E. Moore II Mon, 14 May 2001 12:09:00 -0700 sarg (1.1.1-2) unstable; urgency=low * Removing cron bits and creating a maint script that logrotate can call -- Ivan E. Moore II Sun, 08 Apr 2001 22:00:00 -0700 sarg (1.1.1-1) unstable; urgency=low * New upstream version -- Ivan E. Moore II Mon, 02 Apr 2001 18:07:00 -0700 sarg (1.1-3) unstable; urgency=low * Fix config setting for exclude_codes (Closes: #91833) -- Ivan E. Moore II Mon, 26 Mar 2001 17:15:00 -0700 sarg (1.1-2.0.1) unstable; urgency=low * Build against older glibc -- Ivan E. Moore II Mon, 26 Mar 2001 13:42:00 -0700 sarg (1.1-2) unstable; urgency=low * Fix config file loading (Closes: #91511) -- Ivan E. Moore II Mon, 26 Mar 2001 09:11:00 -0700 sarg (1.1-1) unstable; urgency=low * New upstream version -- Ivan E. Moore II Fri, 23 Mar 2001 05:25:00 -0700 sarg (1.0-1) unstable; urgency=low * New upstream version and name...grrr -- Ivan E. Moore II Sat, 10 Mar 2001 13:54:00 -0700 sqmgrlog (3.0.1-1) unstable; urgency=low * New upstream version -- Ivan E. Moore II Mon, 05 Mar 2001 23:32:00 -0700 sqmgrlog (3.0-1) unstable; urgency=low * New upstream version -- Ivan E. Moore II Fri, 09 Feb 2001 02:12:00 -0700 sqmgrlog (2.12-2) unstable; urgency=low * Fixing cron scripts for proper environments -- Ivan E. Moore II Sat, 27 Jan 2001 21:44:00 -0700 sqmgrlog (2.12-1) unstable; urgency=low * New upstream version -- Ivan E. Moore II Thu, 09 Nov 2000 13:22:00 -0700 sqmgrlog (2.11-2) unstable; urgency=low * More build-depends work * Build on new libc6 -- Ivan E. Moore II Tue, 26 Sep 2000 22:00:00 -0700 sqmgrlog (2.11-1.0) unstable; urgency=low * Changing depends for httpd and squid to recommends -- Ivan E. Moore II Sat, 12 Aug 2000 05:30:00 -0700 sqmgrlog (2.11-0) unstable; urgency=low * New upstream version -- Ivan E. Moore II Sun, 16 Jul 2000 05:00:00 -0700 sqmgrlog (2.10-0) unstable; urgency=low * New upstream version * Fixing problem with cron scripts (Closes: #65623) -- Ivan E. Moore II Wed, 21 Jun 2000 18:00:00 -0700 sqmgrlog (2.9.9-2.0) unstable; urgency=low * Fixing conf file problems (Closes: #60190) * Fixing stderr output errors and cron jobs (Closes: #60239) -- Ivan E. Moore II Sat, 20 May 2000 14:15:00 -0700 sqmgrlog (2.9.9-1.2) unstable; urgency=low * More build cleanup * Adding in build-depends -- Ivan E. Moore II Mon, 15 May 2000 02:45:00 -0700 sqmgrlog (2.9.9-1.1) unstable; urgency=low * Added a pointer to /usr/share/common-licenses in the copyright file -- Ivan E. Moore II Tue, 25 Apr 2000 20:30:00 -0700 sqmgrlog (2.9.9-1) unstable; urgency=low * New upstream version -- Ivan E. Moore II Wed, 15 Mar 2000 02:00:00 -0700 sqmgrlog (2.9.8-3) unstable; urgency=low * Applying topsites patch -- Ivan E. Moore II Fri, 10 Mar 2000 18:30:00 -0700 sqmgrlog (2.9.8-2) unstable; urgency=low * Fixing daily cron to pull yesterdays report and not the same day * Same as above for the weekly reports -- Ivan E. Moore II Fri, 10 Mar 2000 00:10:00 -0700 sqmgrlog (2.9.8-1) unstable; urgency=low * Initial Release. -- Ivan E. Moore II Tue, 7 Mar 2000 21:37:57 -0700 debian/sarg.conf0000644000000000000000000004746011411233333010776 0ustar # sarg.conf # # TAG: access_log file # Where is the access.log file # sarg -l file # access_log /var/log/squid/access.log # TAG: graphs yes|no # Use graphics where is possible. # graph_days_bytes_bar_color blue|green|yellow|orange|brown|red # #graphs yes #graph_days_bytes_bar_color orange # TAG: graph_font # The full path to the TTF font file to use to create the graphs. It is required # if graphs is set to yes. # #graph_font /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf # TAG: title # Especify the title for html page. # title "Squid User Access Reports" # TAG: font_face # Especify the font for html page. # font_face Tahoma,Verdana,Arial # TAG: header_color # Especify the header color # header_color darkblue # TAG: header_bgcolor # Especify the header bgcolor # header_bgcolor blanchedalmond # TAG: font_size # Especify the text font size # font_size 9px # TAG: header_font_size # Especify the header font size # #header_font_size 9px # TAG: title_font_size # Especify the title font size # #title_font_size 11px # TAG: background_color # TAG: background_color # Html page background color # background_color white # TAG: text_color # Html page text color # text_color #000000 # TAG: text_bgcolor # Html page text background color # text_bgcolor lavender # TAG: title_color # Html page title color # title_color green # TAG: logo_image # Html page logo. # #logo_image none # TAG: logo_text # Html page logo text. # #logo_text "" # TAG: logo_text_color # Html page logo texti color. # #logo_text_color #000000 # TAG: logo_image_size # Html page logo image size. # width height # #image_size 80 45 # TAG: background_image # Html page background image # #background_image none # TAG: password # User password file used by Squid authentication scheme # If used, generate reports just for that users. # #password none # TAG: temporary_dir # Temporary directory name for work files # sarg -w dir # temporary_dir /tmp # TAG: output_dir # The reports will be saved in that directory # sarg -o dir # #output_dir /var/www/html/squid-reports output_dir /var/lib/sarg # TAG: output_email # Email address to send the reports. If you use this tag, no html reports will be generated. # sarg -e email # #output_email none # TAG: resolve_ip yes/no # Convert ip address to dns name # sarg -n resolve_ip # TAG: user_ip yes/no # Use Ip Address instead userid in reports. # sarg -p user_ip no # TAG: topuser_sort_field field normal/reverse # Sort field for the Topuser Report. # Allowed fields: USER CONNECT BYTES TIME # topuser_sort_field BYTES reverse # TAG: user_sort_field field normal/reverse # Sort field for the User Report. # Allowed fields: SITE CONNECT BYTES TIME # user_sort_field BYTES reverse # TAG: exclude_users file # users within the file will be excluded from reports. # you can use indexonly to have only index.html file. # exclude_users /etc/sarg/exclude_users # TAG: exclude_hosts file # Hosts, domains or subnets will be excluded from reports. # # Eg.: 192.168.10.10 - exclude ip address only # 192.168.10.0/24 - exclude full C class # s1.acme.foo - exclude hostname only # *.acme.foo - exclude full domain name # exclude_hosts /etc/sarg/exclude_hosts # TAG: useragent_log file # useragent.log file patch to generate useragent report. # #useragent_log none # TAG: date_format # Date format in reports: e (European=dd/mm/yy), u (American=mm/dd/yy), w (Weekly=yy.ww) # date_format u # TAG: per_user_limit file MB # Saves userid on file if download exceed n MB. # This option allow you to disable user access if user exceed a download limit. # #per_user_limit none # TAG: lastlog n # How many reports files must be keept in reports directory. # The oldest report file will be automatically removed. # 0 - no limit. # lastlog 0 # TAG: remove_temp_files yes # Remove temporary files: geral, usuarios, top, periodo from root report directory. # remove_temp_files yes # TAG: index yes|no|only # Generate the main index.html. # only - generate only the main index.html # index yes # TAG: index_tree date|file # How to generate the index. # index_tree file # TAG: overwrite_report yes|no # yes - if report date already exist then will be overwrited. # no - if report date already exist then will be renamed to filename.n, filename.n+1 # overwrite_report yes # TAG: records_without_userid ignore|ip|everybody # What can I do with records without user id (no authentication) in access.log file ? # # ignore - This record will be ignored. # ip - Use ip address instead. (default) # everybody - Use "everybody" instead. # records_without_userid ip # TAG: use_comma no|yes # Use comma instead point in reports. # Eg.: use_comma yes => 23,450,110 # use_comma no => 23.450.110 # use_comma yes # TAG: mail_utility mail|mailx # Mail command to use to send reports via SMTP # mail_utility mailx # TAG: topsites_num n # How many sites in topsites report. # topsites_num 100 # TAG: topsites_sort_order CONNECT|BYTES A|D # Sort for topsites report, where A=Ascendent, D=Descendent # topsites_sort_order CONNECT D # TAG: index_sort_order A/D # Sort for index.html, where A=Ascendent, D=Descendent # index_sort_order D # TAG: exclude_codes file # Ignore records with these codes. Eg.: NONE/400 # Write one code per line. Lines starting with a # are ignored. # Only codes matching exactly one of the line is rejected. The # comparison is not case sensitive. # exclude_codes /etc/sarg/exclude_codes # TAG: replace_index string # Replace "index.html" in the main index file with this string # If null "index.html" is used # #replace_index # TAG: max_elapsed milliseconds # If elapsed time is recorded in log is greater than max_elapsed use 0 for elapsed time. # Use 0 for no checking # max_elapsed 28800000 # 8 Hours # TAG: report_type type # What kind of reports to generate. # topusers - users, sites, times, bytes, connects, links to accessed sites, etc # topsites - site, connect and bytes report # sites_users - users and sites report # users_sites - accessed sites by the user report # date_time - bytes used per day and hour report # denied - denied sites with full URL report # auth_failures - autentication failures report # site_user_time_date - sites, dates, times and bytes report # downloads - downloads per user report # # Eg.: report_type topsites denied # #report_type topusers topsites sites_users users_sites date_time denied auth_failures site_user_time_date downloads report_type topusers topsites sites_users users_sites date_time denied auth_failures site_user_time_date downloads # TAG: usertab filename # You can change the "userid" or the "ip address" to be a real user name on the reports. # If resolve_ip is active, the ip address is resolved before being looked up into this # file. That is, if you want to map the ip address, be sure to set resolv_ip to no or # the resolved name will be looked into the file instead of the ip address. Note that # it can be used to resolve any ip address known to the dns and then map the unresolved # ip addresses to a name found in the usertab file. # Table syntax: # userid name or ip address name # Eg: # SirIsaac Isaac Newton # vinci Leonardo da Vinci # 192.168.10.1 Karol Wojtyla # # Each line must be terminated with '\n' # If usertab have value "ldap" (case ignoring), user names # will be taken from LDAP server. This method as approaches for reception # of usernames from Active Didectory # usertab /etc/sarg/usertab # TAG: LDAPHost hostname # FQDN or IP address of host with LDAP service or AD DC # default is '127.0.0.1' #LDAPHost 127.0.0.1 # TAG: LDAPPort port # LDAP service port number # default is '389' #LDAPPort 389 # TAG: LDAPBindDN CN=username,OU=group,DC=mydomain,DC=com # DN of LDAP user, who is authorized to read user's names from LDAP base # default is empty line #LDAPBindDN cn=proxy,dc=mydomain,dc=local # TAG: LDAPBindPW secret # Password of DN, who is authorized to read user's names from LDAP base # default is empty line #LDAPBindPW secret # TAG: LDAPBaseSearch OU=users,DC=mydomain,DC=com # LDAP search base # default is empty line #LDAPBaseSearch ou=users,dc=mydomain,dc=local # TAG: LDAPFilterSearch uid=%s # User search filter by user's logins in LDAP # First founded record will be used # %s - will be changed to userlogins from access.log file # filter string can have some tags '%s' # default value is 'uid=%s' #LDAPFilterSearch uid=%s # TAG: LDAPTargetAttr attributename # Name of the attribute containing a name of the user # default value is 'cn' #LDAPTargetAttr cn # TAG: long_url yes|no # If yes, the full url is showed in report. # If no, only the site will be showed # # YES option generate very big sort files and reports. # long_url no # TAG: date_time_by bytes|elap # Date/Time reports show the downloaded volume or the elapsed time or both. # date_time_by bytes # TAG: charset name # ISO 8859 is a full series of 10 standardized multilingual single-byte coded (8bit) # graphic character sets for writing in alphabetic languages # You can use the following charsets: # Latin1 - West European # Latin2 - East European # Latin3 - South European # Latin4 - North European # Cyrillic # Arabic # Greek # Hebrew # Latin5 - Turkish # Latin6 # Windows-1251 # Japan # Koi8-r # UTF-8 # charset Latin1 # TAG: user_invalid_char "&/" # Records that contain invalid characters in userid will be ignored by Sarg. # #user_invalid_char "&/" # TAG: privacy yes|no # privacy_string "***.***.***.***" # privacy_string_color blue # In some countries the sysadm cannot see the visited sites by a restrictive law. # Using privacy yes the visited url will be changes by privacy_string and the link # will be removed from reports. # #privacy no #privacy_string "***.***.***.***" #privacy_string_color blue # TAG: include_users "user1:user2:...:usern" # Reports will be generated only for listed users. # #include_users none # TAG: exclude_string "string1:string2:...:stringn" # Records from access.log file that contain one of listed strings will be ignored. # #exclude_string none # TAG: show_successful_message yes|no # Shows "Successful report generated on dir" at end of process. # show_successful_message no # TAG: show_read_statistics yes|no # Shows some reading statistics. # show_read_statistics no # TAG: topuser_fields # Which fields must be in Topuser report. # topuser_fields NUM DATE_TIME USERID CONNECT BYTES %BYTES IN-CACHE-OUT USED_TIME MILISEC %TIME TOTAL AVERAGE # TAG: user_report_fields # Which fields must be in User report. # user_report_fields CONNECT BYTES %BYTES IN-CACHE-OUT USED_TIME MILISEC %TIME TOTAL AVERAGE # TAG: bytes_in_sites_users_report yes|no # Bytes field must be in Site & Users Report ? # #bytes_in_sites_users_report no # TAG: topuser_num n # How many users in topsites report. 0 = no limit # topuser_num 0 # TAG: datafile file # Save the report results in a file to populate some database # #datafile none # TAG: datafile_delimiter ";" # ascii character to use as a field separator in datafile # #datafile_delimiter ";" # TAG: datafile_fields all # Which data fields must be in datafile # user;date;time;url;connect;bytes;in_cache;out_cache;elapsed # #datafile_fields user;date;time;url;connect;bytes;in_cache;out_cache;elapsed # TAG: datafile_url ip|name # Saves the URL as ip or name in datafile # #datafile ip # TAG: weekdays # The weekdays to take account ( Sunday->0, Saturday->6 ) # Example: #weekdays 1-3,5 # Default: #weekdays 0-6 # TAG: hours # The hours to take account # Example: #hours 7-12,14,16,18-20 # Default: #hours 0-23 # TAG: dansguardian_conf file # DansGuardian.conf file path # Generate reports from DansGuardian logs. # Use 'none' to disable it. # dansguardian_conf /usr/dansguardian/dansguardian.conf # #dansguardian_conf none # TAG: dansguardian_filter_out_date on|off # This option replaces dansguardian_ignore_date whose name was not appropriate with respect to its action. # Note the change of parameter value compared with the old option. # 'off' use the record even if its date is outside of the range found in the input log file. # 'on' use the record only if its date is in the range found in the input log file. # #dansguardian_filter_out_date on # TAG: squidguard_conf file # path to squidGuard.conf file # Generate reports from SquidGuard logs. # Use 'none' to disable. # You can use sarg -L filename to use an alternate squidGuard log. # squidguard_conf /usr/local/squidGuard/squidGuard.conf # #squidguard_conf none # TAG: redirector_log file # the location of the web proxy redirector log such as one created by squidGuard or Rejik. The option # may be repeated up to 64 times to read multiple files. # If this option is specified, it takes precedence over squidguard_conf. # The command line option -L override this option. # #redirector_log /usr/local/squidGuard/var/logs/urls.log # TAG: redirector_filter_out_date on|off # This option replaces squidguard_ignore_date and redirector_ignore_date whose names were not # appropriate with respect to their action. # Note the change of parameter value compared with the old options. # 'off' use the record even if its date is outside of the range found in the input log file. # 'on' use the record only if its date is in the range found in the input log file. # #redirector_filter_out_date on # TAG: redirector_log_format # Format string for web proxy redirector logs. # This option was named squidguard_log_format before sarg 2.3. # REJIK #year#-#mon#-#day# #hour# #list#:#tmp# #ip# #user# #tmp#/#tmp#/#url#/#end# # SQUIDGUARD #year#-#mon#-#day# #hour# #tmp#/#list#/#tmp#/#tmp#/#url#/#tmp# #ip#/#tmp# #user# #end# #redirector_log_format #year#-#mon#-#day# #hour# #tmp#/#list#/#tmp#/#tmp#/#url#/#tmp# #ip#/#tmp# #user# #end# # TAG: show_sarg_info yes|no # shows sarg information and site path on each report bottom # #show_sarg_info yes # TAG: show_sarg_logo yes|no # shows sarg logo # #show_sarg_logo yes # TAG: parsed_output_log directory # Saves the processed log in a sarg format after parsing the squid log file. # This is a way to dump all of the data structures out, after parsing from # the logs (presumably this data will be much smaller than the log files themselves), # and pull them back in for later processing and merging with data from previous logs. # #parsed_output_log none # TAG: parsed_output_log_compress /bin/gzip|/usr/bin/bzip2|nocompress # Command to run to compress sarg parsed output log. It may contain # options (such as -f to overwrite existing target file). The name of # the file to compresse is provided at the end of this # command line. Don't forget to quote things appropriately. # #parsed_output_log_compress /bin/gzip # TAG: displayed_values bytes|abbreviation # how the values will be displayed in reports. # eg. bytes - 209.526 # abbreviation - 210K # #displayed_values bytes # Report limits # TAG: authfail_report_limit n # TAG: denied_report_limit n # TAG: siteusers_report_limit n # TAG: squidguard_report_limit n # TAG: user_report_limit n # TAG: dansguardian_report_limit n # TAG: download_report_limit n # report limits (lines). # '0' no limit # #authfail_report_limit 10 #denied_report_limit 10 #siteusers_report_limit 0 #squidguard_report_limit 10 #dansguardian_report_limit 10 #user_report_limit 10 #user_report_limit 50 # TAG: www_document_root dir # Where is your Web DocumentRoot # Sarg will create sarg-php directory with some PHP modules: # - sarg-squidguard-block.php - add urls from user reports to squidGuard DB # #www_document_root /var/www/html # TAG: block_it module_url # This tag allow you to pass urls from user reports to a cgi or php module, # to be blocked by some Squid acl # # Eg.: block_it /sarg-php/sarg-block-it.php # sarg-block-it is a php that will append a url to a flat file. # You must change /var/www/html/sarg-php/sarg-block-it to point to your file # in $filename variable, and chown to a httpd owner. # # sarg will pass http://module_url?url=url # #block_it none # TAG: external_css_file path # Provide the path to an external css file to link into the HTML reports instead of # the inline css written by sarg when this option is not set. # # In versions prior to 2.3, this used to be an absolute file name to # a file to include verbatim in each HTML page but, as it takes a lot of # space, version 2.3 switched to a link to an external css file. # Therefore, this option must contain the HTTP server path on which a client # browser may find the css file. # # Sarg use theses style classes: # .logo logo class # .info sarg information class, align=center # .title_c title class, align=center # .header_c header class, align:center # .header_l header class, align:left # .header_r header class, align:right # .text text class, align:right # .data table text class, align:right # .data2 table text class, align:left # .data3 table text class, align:center # .link link class # # Sarg can be instructed to output the internal css it inline # into the reports with this command: # # sarg --css # # You can redirect the output to a file of your choice and edit # it to your liking. # #external_css_file none # TAG: user_authentication yes|no # Allow user authentication in User Reports using .htaccess # Parameters: # AuthUserTemplateFile - The template to use to create the # .htaccess file. In the template, %u is replaced by the # user's ID for which the report is generated. The path of the # template is relative to the directory containing sarg # configuration file. # # user_authentication no # AuthUserTemplateFile sarg_htaccess # TAG: download_suffix "suffix,suffix,...,suffix" # file suffix to be considered as "download" in Download report. # Use 'none' to disable. # download_suffix "zip,arj,bzip,gz,ace,doc,iso,adt,bin,cab,com,dot,drv$,lha,lzh,mdb,mso,ppt,rtf,src,shs,sys,exe,dll,mp3,avi,mpg,mpeg" # TAG: ulimit n # The maximum number of open file descriptors to avoid "Too many open files" error message. # You need to run sarg as root to use ulimit tag. # If you run sarg with a low privilege user, set to 'none' to disable ulimit # #ulimit 20000 # TAG: ntlm_user_format username|domainname+username # NTLM users format. # #ntlm_user_format domainname+username # TAG: realtime_refresh_time num sec # How many time to auto refresh the realtime report # 0 = disable # # realtime_refresh_time 3 # TAG: realtime_access_log_lines num # How many last lines to get from access.log file # # realtime_access_log_lines 1000 # TAG: realtime_types: GET,PUT,CONNECT,ICP_QUERY,POST # Which records must be in realtime report. # # realtime_types GET,PUT,CONNECT # TAG: realtime_unauthenticated_records: ignore|show # What to do with unauthenticated records in realtime report. # # realtime_unauthenticated_records: show # TAG: byte_cost value no_cost_limit # Cost per byte. # Eg. byte_cost 0.01 100000000 # per byte cost = 0.01 # bytes with no cost = 100 Mb # 0 = disable # # byte_cost 0.01 50000000 # TAG: squid24 on|off # Compatilibity with squid version <= 2.4 when using emulate_http_log on # # squid24 off debian/dirs0000644000000000000000000000025011322652034010045 0ustar usr/bin usr/sbin etc/sarg etc/cron.daily etc/cron.weekly etc/cron.monthly usr/share/lintian/overrides usr/share/man/man1 usr/share/sarg usr/share/doc/sarg var/lib/sarg debian/manpages0000644000000000000000000000003511676145325010714 0ustar sarg.1 debian/sarg-reports.1