/*
* AUTHOR: Pedro Lineu Orso orso@penguintech.com.br
* 1998, 2005
* SARG Squid Analysis Report Generator http://sarg.sourceforge.net
*
* SARG donations:
* please look at http://sarg.sourceforge.net/donations.php
* ---------------------------------------------------------------------
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
*
*/
#include "include/conf.h"
#define LEGACY_WRITE_USER
#define LEGACY_WRITE_DOWNLOAD
#define REPORT_EVERY_X_LINES 5000
char *userfile;
char *excludefile;
char *excludeuser;
char sz_Last_User[ MAXLEN ] = { 0 } ;
int bool_ShowReadStatistics ;
numlist weekdays = { { 0, 1, 2, 3, 4, 5, 6 }, 7 };
numlist hours = { { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 }, 24 };
void getusers(char *pwdfile, int debug);
void gethexclude(char *hexfile, int debug);
void getuexclude(char *uexfile, int debug);
void ttx(char *user);
int compar( const void *, const void * );
#define _FILE_OFFSET_BITS 64
int main(argc,argv)
int argc;
char *argv[];
{
FILE *fp_in = NULL, *fp_ou = NULL, *fp_denied, *fp_usr, *fp_authfail, *fp_log;
char sz_Download_Unsort[ 20000 ] ;
FILE * fp_Download_Unsort = NULL ;
FILE * fp_Write_User = NULL ;
extern int optind;
extern int optopt;
extern char *optarg;
char w[MAXLEN];
char data[255];
char elap[255];
char none[255];
char ip[MAXLEN];
char msg[MAXLEN];
char tam[255];
char fun[255];
char wuser[MAXLEN];
char code[MAXLEN];
char code2[MAXLEN];
char smartfilter[MAXLEN];
char dia[128];
char wdata[128];
char mes[30];
char ano[30];
char hora[30];
char wtemp[MAXLEN];
char wtemp2[255];
char date[255];
char arq[255];
char arq_log[255];
char warq[255][255];
char hm[15], hmf[15], hmr[15], whm[15];
int chm=0;
char uagent[MAXLEN];
char hexclude[MAXLEN];
char csort[MAXLEN];
char tbuf[128];
char tbuf2[128];
char zip[20];
char *str;
char bufz[MAXLEN];
char bufy[MAXLEN];
int common;
int common_log=0;
int squid_log=0;
int ch;
int d;
int x, l, i;
int errflg=0;
int puser=0;
int fhost=0;
int dns=0;
int fuser=0;
int idata=0;
int narq=0;
int iarq=0;
int exstring=0;
int i0=0,i1=0,i2=0,i3=0,i4=0,i5=0,i6=0,i7=0,i8=0;
long totregsl=0;
long totregsg=0;
long totregsx=0;
long totper=0;
long int max_elapsed=0;
time_t tt;
struct tm *t;
unsigned long nreg=0;
off_t recs1=0;
unsigned long recs2=0;
struct rlimit rl;
int OutputNonZero = REPORT_EVERY_X_LINES ;
BgImage[0]='\0';
LogoImage[0]='\0';
LogoText[0]='\0';
PasswdFile[0]='\0';
OutputEmail[0]='\0';
Ip2Name[0]='\0';
UserAgentLog[0]='\0';
ExcludeHosts[0]='\0';
ExcludeUsers[0]='\0';
ConfigFile[0]='\0';
code[0]='\0';
LastLog[0]='\0';
UserIp[0]='\0';
MaxElapsed[0]='\0';
ReportType[0]='\0';
UserTabFile[0]='\0';
BlockIt[0]='\0';
ExternalCSSFile[0]='\0';
SquidGuardLogFormat[0]='\0';
SquidGuardLogAlternate[0]='\0';
strcpy(AccessLog,"/usr/local/squid/var/logs/access.log");
sprintf(ExcludeCodes,"%s/exclude_codes",SYSCONFDIR);
strcpy(GraphDaysBytesBarColor,"orange");
strcpy(BgColor,"#ffffff");
strcpy(TxColor,"#000000");
strcpy(TxBgColor,"lavender");
strcpy(TiColor,"darkblue");
strcpy(Width,"80");
strcpy(Height,"45");
strcpy(LogoTextColor,"#000000");
strcpy(HeaderColor,"darkblue");
strcpy(HeaderBgColor,"#dddddd");
strcpy(LogoTextColor,"#006699");
strcpy(FontSize,"9px");
strcpy(TempDir,"/tmp");
strcpy(OutputDir,"/usr/local/etc/httpd/htdocs/squid-reports");
strcpy(Ip2Name,"no");
strcpy(DateFormat,"u");
strcpy(OverwriteReport,"no");
strcpy(RemoveTempFiles,"yes");
strcpy(ReplaceIndex,"index.html");
strcpy(Index,"yes");
strcpy(RecordsWithoutUser,"ip");
strcpy(UseComma,"no");
strcpy(MailUtility,"mailx");
strcpy(TopSitesNum,"100");
strcpy(UserIp,"no");
strcpy(TopuserSortField,"BYTES");
strcpy(UserSortField,"BYTES");
strcpy(TopuserSortOrder,"reverse");
strcpy(UserSortOrder,"reverse");
strcpy(TopsitesSortField,"CONNECT");
strcpy(TopsitesSortType,"D");
strcpy(LongUrl,"no");
strcpy(language,"English");
strcpy(FontFace,"Verdana,Tahoma,Arial");
strcpy(datetimeby,"bytes");
strcpy(CharSet,"ISO-8859-1");
strcpy(Privacy,"no");
strcpy(PrivacyString,"***.***.***.***");
strcpy(PrivacyStringColor,"blue");
strcpy(SuccessfulMsg,"yes");
strcpy(TopUserFields,"NUM DATE_TIME USERID CONNECT BYTES %BYTES IN-CACHE-OUT USED_TIME MILISEC %TIME TOTAL AVERAGE");
strcpy(UserReportFields,"CONNECT BYTES %BYTES IN-CACHE-OUT USED_TIME MILISEC %TIME TOTAL AVERAGE");
strcpy(DataFileDelimiter,";");
strcpy(DataFileFields,"user;date;time;url;connect;bytes;in_cache;out_cache;elapsed");
strcpy(SiteUserTimeDateType,"table");
strcpy(ShowReadStatistics,"yes");
strcpy(IndexSortOrder,"D");
strcpy(ShowSargInfo,"yes");
strcpy(ShowSargLogo,"yes");
strcpy(ParsedOutputLog,"no");
strcpy(ParsedOutputLogCompress,"/bin/gzip");
strcpy(DisplayedValues,"abbreviation");
strcpy(HeaderFontSize,"9px");
strcpy(TitleFontSize,"11px");
strcpy(AuthUserFile,"/usr/local/sarg/passwd");
strcpy(AuthName,"SARG, Restricted Access");
strcpy(AuthType,"basic");
strcpy(Require,"require user admin %u");
strcpy(DownloadSuffix,"7z,ace,arj,avi,bat,bin,bz2,bzip,cab,com,cpio,dll,doc,dot,exe,gz,iso,lha,lzh,mdb,mov,mp3,mpeg,mpg,mso,nrg,ogg,ppt,rar,rtf,shs,src,sys,tar,tgz,vcd,vob,wma,wmv,zip");
strcpy(Graphs,"yes");
strcpy(Ulimit,"20000");
strcpy(NtlmUserFormat,"domainname+username");
strcpy(IndexTree,"file");
strcpy(RealtimeTypes,"GET,PUT,CONNECT");
strcpy(RealtimeUnauthRec,"ignore");
strcpy(SquidguardIgnoreDate,"off");
strcpy(DansguardianIgnoreDate,"off");
strcpy(DataFileUrl,"ip");
dia[0]='\0';
mes[0]='\0';
ano[0]='\0';
hora[0]='\0';
tmp[0]='\0';
tmp2[0]='\0';
tmp3[0]='\0';
wtemp[0]='\0';
wtemp2[0]='\0';
us[0]='\0';
date[0]='\0';
df[0]='\0';
uagent[0]='\0';
hexclude[0]='\0';
addr[0]='\0';
hm[0]='\0';
hmf[0]='\0';
site[0]='\0';
outdir[0]='\0';
elap[0]='\0';
email[0]='\0';
zip[0]='\0';
UserInvalidChar[0]='\0';
DataFile[0]='\0';
SquidGuardConf[0]='\0';
DansGuardianConf[0]='\0';
excode=0;
denied_count=0;
download_count=0;
authfail_count=0;
dansguardian_count=0;
squidguard_count=0;
DeniedReportLimit=10;
AuthfailReportLimit=10;
DansGuardianReportLimit=10;
SquidGuardReportLimit=10;
DownloadReportLimit=50;
UserReportLimit=0;
debug=0;
debugz=0;
debugm=0;
iprel=0;
userip=0;
color1=0;
color2=0;
color3=0;
sarglog=0;
isalog=0;
dotinuser=0;
realt=0;
realtime_refresh=3;
realtime_access_log_lines=1000;
cost=0.01;
nocost=50000000;
bzero(IncludeUsers, MAXLEN);
bzero(ExcludeString, MAXLEN);
for(x=0; x<=254; x++)
warq[x][0]='\0';
language_load(language);
strcpy(Title,text[88]);
while((ch = getopt(argc, argv, "a:b:c:d:e:f:g:u:l:L:o:s:t:w:hijmnprvxyz")) != -1){
switch(ch)
{
case 'a':
没有合适的资源?快使用搜索试试~ 我知道了~
sarg-2.1.tar.gz_Squid!_report generator_sarg download
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 188 浏览量
2022-09-21
04:39:38
上传
评论
收藏 345KB GZ 举报
温馨提示
共111个文件
c:38个
php:6个
po:4个
SARG的全称是:Squid Analysis Report Generator SARG作为一款Squid日志分析工具,它采用html格式,详细列出了每一位用户访问internet的站点信息,时间占用信息,排名,连接次数,访问量,访问量等
资源推荐
资源详情
资源评论
收起资源包目录
sarg-2.1.tar.gz_Squid!_report generator_sarg download (111个子文件)
sarg.1 4KB
BETA-TESTERS 282B
Bulgarian_windows1251 3KB
log.c 45KB
util.c 27KB
html.c 23KB
topuser.c 22KB
getconf.c 20KB
report.c 19KB
grepday.c 17KB
index.c 15KB
email.c 10KB
smartfilter.c 10KB
useragent.c 9KB
topsites.c 7KB
repday.c 7KB
datafile.c 7KB
squidguard_log.c 7KB
dansguardian_report.c 7KB
squidguard_report.c 6KB
siteuser.c 6KB
authfail.c 6KB
denied.c 6KB
download.c 6KB
css.c 5KB
realtime.c 5KB
dansguardian_log.c 5KB
sort.c 4KB
totday.c 3KB
lastlog.c 3KB
totger.c 3KB
usage.c 3KB
decomp.c 2KB
splitlog.c 2KB
ip2name.c 2KB
convlog.c 2KB
charset.c 2KB
exclude.c 2KB
auth.c 2KB
language.c 2KB
indexonly.c 2KB
Catalan 3KB
ChangeLog 41KB
sarg.conf 16KB
configure 132KB
CONTRIBUTORS 2KB
COPYING 18KB
COPYING 18KB
Czech 3KB
DONATIONS 93B
Dutch 3KB
English 2KB
exclude_codes 9B
French 3KB
German 3KB
Greek 3KB
config.guess 20KB
conf.h 6KB
extern.h 2KB
defs.h 1KB
info.h 95B
htaccess 148B
Hungarian 2KB
configure.in 3KB
Makefile.in 3KB
Indonesian 2KB
INSTALL 306B
install-sh 5KB
Italian 3KB
Japanese 3KB
LANGUAGES 508B
Latvian 2KB
license 18KB
LICENSE 18KB
messages.mo 850B
messages.mo 821B
messages.mo 812B
messages.mo 373B
.new 0B
ll.novo 0B
sarg-squidguard-block.php 3KB
style.php 2KB
sarg-squidguard-block2.php 2KB
language.php 2KB
sarg-block-it.php 2KB
sarg-realtime.php 30B
sarg.png 7KB
sarg-squidguard-block.png 291B
datetime.png 199B
graph.png 95B
messages.po 1KB
messages.po 1KB
messages.po 1KB
messages.po 1KB
Polish 3KB
Portuguese 3KB
README 3KB
README 91B
Romanian 3KB
Russian_koi8 3KB
共 111 条
- 1
- 2
资源评论
小贝德罗
- 粉丝: 69
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功