我想在linux centOS 中使用 sarg 工具来报告用户使用网站的情况。但是安装后,当我使用命令时sarg -x -z
,输出是:
SARG: Init
SARG: Loading configuration from /usr/local/etc/sarg.conf
SARG: TAG: access_log /var/log/squid/access.log
SARG: TAG: output_dir /var/www/html/squid-reports
SARG: TAG: date_format e
SARG: TAG: overwrite_report yes
SARG: Parameters:
SARG: Hostname or IP address (-a) =
SARG: Useragent log (-b) =
SARG: Exclude file (-c) =
SARG: Date from-until (-d) =
SARG: Email address to send reports (-e) =
SARG: Config file (-f) = /usr/local/etc/sarg.conf
SARG: Date format (-g) = Europe (dd/mm/yyyy)
SARG: IP report (-i) = No
SARG: Input log (-l) = /var/log/squid/access.log
SARG: Resolve IP Address (-n) = No
SARG: Output dir (-o) = /var/www/html/squid-reports/
SARG: Use Ip Address instead of userid (-p) = No
SARG: Accessed site (-s) =
SARG: Time (-t) =
SARG: User (-u) =
SARG: Temporary dir (-w) = /tmp/sarg
SARG: Debug messages (-x) = Yes
SARG: Process messages (-z) = Yes
SARG:
SARG: sarg version: 2.3.1 Sep-18-2010
SARG: Reading access log file: /var/log/squid/access.log
SARG: Records in file: 0, reading: 100.00%
SARG: Records read: 0, written: 0, excluded: 0
SARG: No records found
SARG: End
这是/var/log/squid/
root@FW sarg]# ll /var/log/squid/
total 184
-rw-r-----. 1 squid squid 0 Jul 25 03:49 access.log
-rw-r----- 1 squid squid 12592 Jul 14 03:16 access.log-20130714
-rw-r----- 1 squid squid 208 Jul 25 03:49 access.log-20130725
-rw-r-----. 1 squid squid 6944 Sep 3 12:56 cache.log
-rw-r-----. 1 squid squid 1286 Aug 4 03:37 cache.log-20130804.gz
-rw-r-----. 1 squid squid 168 Aug 11 03:22 cache.log-20130811.gz
-rw-r----- 1 squid squid 929 Aug 18 03:48 cache.log-20130818.gz
-rw-r----- 1 squid squid 1285 Aug 25 03:41 cache.log-20130825.gz
-rw-r----- 1 squid squid 1301 Sep 1 13:24 cache.log-20130901.gz
-rw-r--r--. 1 root root 6517 Jul 25 08:51 squid.out
-rw-r-----. 1 squid squid 13968 Sep 4 13:56 store.log
-rw-r----- 1 squid squid 32398 Aug 4 03:37 store.log-20130804
-rw-r----- 1 squid squid 32592 Aug 11 03:22 store.log-20130811
-rw-r----- 1 squid squid 30652 Aug 18 03:48 store.log-20130818
-rw-r----- 1 squid squid 6180 Aug 25 03:41 store.log-20130825.gz
-rw-r----- 1 squid squid 5763 Sep 1 13:24 store.log-20130901.gz
这是sarg.conf
access_log /var/log/squid/access.log
output_dir /var/www/html/squid-reports
overwrite_report yes
.....
和网络报告
My Squid User Access Reports FILE/PERIOD CREATION
DATE USERS BYTES AVERAGE 24Jul2013-24Jul2013 Wed 24 Jul 2013 03:04:28 PM
ICT 1 5.57K 5.57K 21Jul2013-25Jul2013 Thu 25 Jul 2013 09:30:37 AM
ICT 0 0 14Jul2013-25Jul2013 Thu 25 Jul 2013 10:35:22 AM
ICT 1 5.57K 5.57K Generated by sarg-2.3.1 Sep-18-2010 on
25/Jul/2013-10:35
这是非常少的信息。我怎样才能增加它?
答案1
自 7 月 25 日起,您的日志文件大小为零,这就是您面临此问题的原因
-rw-r-----. 1 squid squid 0 Jul 25 03:49 access.log
所以只要检查你的磁盘空间和inode,可能是因为这个squid无法生成日志