Squid monitoring with Awstats

by Igloo on May 18th in Linux, Linux How To's:

There are no guides on the net about how to setup awstats monitoring with squid. Not completely at least.

I am using squid Version 3.0.STABLE8 with awstats 6.7 (build 1.892)

settings for /etc/squid3/squid.conf

acl snmpcommunity snmp_community public
acl network src 192.168.1.0/24
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl purge method PURGE
acl CONNECT method CONNECT
http_access allow all
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
acl our_networks src 192.168.1.0/24 127.0.0.1
http_access allow our_networks
http_access deny all
icp_access allow all
http_port yourip:3128 transparent
hierarchy_stoplist cgi-bin ?
cache_dir ufs /var/spool/squid 2048 16 256
maximum_object_size 1048576 KB
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern .               0       20%     4320
acl apache rep_header Server ^Apache
extension_methods REPORT MERGE MKACTIVITY CHECKOUT
cache_mgr Matt@yourdomain.com
mail_from squid@yourdomain.com
visible_hostname squid.yourdomain.com
snmp_port 3401
snmp_access allow all
always_direct allow all
dns_nameservers  192.168.1.254
hosts_file /etc/hosts
append_domain .yourdomain.com
coredump_dir /var/spool/squid
access_log /var/log/squid3/access.log
emulate_httpd_log on

Then your awstats config file:

LogFile="/var/log/squid3/access.log"
LogType=W
LogFormat=4
SiteDomain="squid.yourdomain.com"
HostAliases="yourdomain.com"
LevelForBrowsersDetection=0
LevelForOSDetection=0
LevelForRefererAnalyze=0
LevelForRobotsDetection=0
LevelForSearchEnginesDetection=0
LevelForKeywordsDetection=0
LevelForFileTypesDetection=2
LevelForWormsDetection=2
ShowDomainsStats=0
ShowRobotsStats=0
ShowWormsStats=HBL
ShowFileSizesStats=0
ShowOSStats=0
ShowBrowsersStats=0
ShowOriginStats=0
ShowKeyphrasesStats=0
ShowKeywordsStats=0
ShowMiscStats=0

Then it should run fine :)

 /usr/lib/cgi-bin/awstats.pl -config=squid -update
Be Sociable, Share!

Trackbacks/Pingbacks

  1. How to AWStats With Squid on CentOS 5.× | KING SABRI
  2. Anonymous

Leave a Reply

*

Powered By Wordpress Designed By Ridgey