LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-16-2004, 11:37 PM   #1
hitesh_linux
Member
 
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472

Rep: Reputation: 30
How to monitor proxy !!


Hi,

I have setup Squid proxy. service runnning nicely. I m using dialup connection.

Here is the cache_log report.

CPU Usage: 0.700 seconds = 0.140 user + 0.560 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 715
Memory usage for squid via mallinfo():
total space in arena: 1904 KB
Ordinary blocks: 1899 KB 1 blks
Small blocks: 0 KB 1 blks
Holding blocks: 200 KB 1 blks
Free Small blocks: 0 KB
Free Ordinary blocks: 4 KB
Total in use: 2099 KB 110%
Total free: 4 KB 0%
2004/09/17 09:39:56| Open FD 9 /var/spool/squid/swap.state.new
2004/09/17 09:39:56| Squid Cache (Version 2.5.STABLE1): Exiting normally.

where squid save all web pages which i had visited? how can i know it's give me same web pages, i visited early. Can i monitor proxy Live?

As per cache_log file storing space. I know it's storing cache.But, where? here is the /var/log/squid list.

[root@mail squid]# ls -l
total 148
-rw-r--r-- 1 squid squid 0 Sep 17 08:39 access.log
-rw-r--r-- 1 squid squid 135179 Sep 17 09:39 cache_log
-rw-r--r-- 1 squid squid 6359 Sep 17 08:43 cache.log
-rw-r--r-- 1 squid squid 0 Sep 17 08:39 store.log

is there any way i can check all visited webpages list under some file. if any one want me to put squid.conf file please let me know.

Note : One strange point, When try to delete old cache from 'webmin'. it's took long long time. all most it's hang. i have to cancel it manually. so is there any way i can clear old cache from command line.(console)

when i try to start & stop services it showing me FAIL. when i am not connect using dialup. once i connected and try to start & stop the services it's showing OK. what could be the problem?

Please help me...

-Hitesh

Last edited by hitesh_linux; 09-16-2004 at 11:43 PM.
 
Old 09-17-2004, 05:11 AM   #2
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
i dont know online monitoring for squid. but i know a log analyzer called sarg. it reads squid "access.log" and generates a web page. so if u have apache, u can configure it to publish squid logs. so u will be able to see detailed information such as who surfed where and get how much data from net... etc.
http://sarg.sourceforge.net

squid stores cache in /var/spool/squid/ by defult on redhat like distros. there can be lots of directory and subdirectories. it depends what is said in squid.conf about "cache_dir"

check /var/log/messages when squid fails to restart. maybe it is an issue about dns. because when the internet connection is offline, squid cannot reach your ISP dns server. it is just an idea
 
Old 09-17-2004, 05:12 AM   #3
mardanian
Member
 
Registered: Mar 2004
Distribution: Fedora
Posts: 254

Rep: Reputation: 30
for monitoring squid there are lot of software.

1) cachemgr that comes with squid
2) snmp + mrtg http://people.ee.ethz.ch/~oetiker/webtools/mrtg/

3) on http://www.squid-cache.org/ check on left side under "Related"

your second question regarding start/stop
when you are not connected you probably configured you squid to startup with dnslookup, by disabling this your problem would be solved, I duno what distro you are using and how you starting squid
if you are on rh + fedora and you had installed squid from .rpm then im sorry coz i always preferred to installed squid from source.

however on rh, fc you may do this
1) chkconfig squid off

and then in rc.local file put a line

path/squid/sbin/squid -D

replace path with the path where squid binaries are installed -D will tell squid to start without doing dns test on startup.

3) why you frequently deletes your cache strange huh?
squid is alll about cachig and you periodically "delete" your cache why? webmin hangs coz cache directory kinda large containing thoursands of file and it definity takes sometime to deletes are those files

however
rm -fr dirname

is your friend


regards
 
Old 09-20-2004, 10:03 PM   #4
hitesh_linux
Member
 
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472

Original Poster
Rep: Reputation: 30
Thanx for the reply.

I have tried sarg, i have downloaded from site and try to configure it. here it is.....

Configuring sarg:
--------------------

SARG: (language) Cannot open language file: /usr/local/sarg/languages/English
[root@mail sarg-1.4.1]# ./config.status
creating Makefile
[root@mail sarg-1.4.1]# ./configure
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking for gcc... (cached) gcc
checking whether the C compiler (gcc -g) works... yes
checking whether the C compiler (gcc -g) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for dirent.h that defines DIR... (cached) yes
checking for opendir in -ldir... (cached) no
checking how to run the C preprocessor... (cached) gcc -E
checking for ANSI C header files... (cached) yes
checking for stdio.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/time.h... (cached) yes
checking for time.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/dirent.h... (cached) no
checking for dirent.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for netdb.h... (cached) yes
checking for arpa/inet.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for ctype.h... (cached) yes
checking for working const... (cached) yes
checking whether struct tm is in sys/time.h or time.h... (cached) time.h
using /usr/bin as the SARG binary
using /usr/local/man/man1 as the SARG man page
using /usr/local/sarg as the SARG configuration dir
creating ./config.status
creating Makefile
[root@mail sarg-1.4.1]#

Make:
--------
[root@mail sarg-1.4.1]# make
make: Nothing to be done for `all'.
[root@mail sarg-1.4.1]# make install
creating /usr/local/man/man1
mkdir: cannot create directory `/usr/local/man/man1': No such file or directory
make: [install] Error 1 (ignored)
cp sarg /usr/bin/sarg
chmod 755 /usr/bin/sarg
cp sarg.1 /usr/local/man/man1/sarg.1
cp: cannot create regular file `/usr/local/man/man1/sarg.1': No such file or directory
make: *** [install] Error 1

Directory & file of Sarg:
---------------------------
[root@mail sarg-1.4.1]# ls
authfail.c copying getconf.o lastlog.o siteuser.c topuser.c
authfail.o datafile.c html.c log.c siteuser.o topuser.o
cfgaux datafile.o html.o log.o smartfilter.c totday.c
ChangeLog decomp.c include Makefile smartfilter.o totday.o
charset.c decomp.o index.c Makefile.in sort.c totger.c
charset.o denied.c index.o README sort.o totger.o
config.cache denied.o indexonly.c repday.c splitlog.c usage.c
config.log DONATIONS indexonly.o repday.o splitlog.o usage.o
config.status email.c ip2name.c report.c squidguard_log.c useragent.c
configure email.o ip2name.o report.o squidguard_log.o useragent.o
configure.in exclude.c language.c sarg squidguard_report.c util.c
CONTRIBUTORS exclude_codes language.o sarg.1 squidguard_report.o util.o
convlog.c exclude.o languages sarg.conf topsites.c
convlog.o getconf.c lastlog.c sarg.html topsites.o
[root@mail sarg-1.4.1]# sarg
SARG: (language) Cannot open language file: /usr/local/sarg/languages/English
[root@mail sarg-1.4.1]#


i got some error messages while doing make. can you tell how to solve this problem.

I have gone through the following path:

/usr/local/sarg/languages/English

but language directory it empty (no English) directory.

What should i do to configure & run "Sarg".

Please help me.....

--Hitesh

Last edited by hitesh_linux; 09-20-2004 at 10:05 PM.
 
Old 09-21-2004, 05:18 AM   #5
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
if u have redhat or fedora u can try following rpms:
http://dag.wieers.com/packages/sarg/

good luck
 
Old 09-21-2004, 09:38 PM   #6
hitesh_linux
Member
 
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472

Original Poster
Rep: Reputation: 30
Thanx Maxut for quick reply.

I have downloaded/installed sarg for RHL 9. and when i check under browser with URL (mail.hylix.com/sarg/index.html) it shows following things:

Squid User's Access Report
DIRECTORY DESCRIPTION
ONE-SHOT One shot reports
daily Daily reports
weekly Weekly reports
monthly Monthly reports

But when i click on any one of directory i got following error.

Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster
Error 404
mail.hylix.com
Wed 22 Sep 2004 08:02:41 AM IST
Apache/2.0.40 (Red Hat Linux)

And when it type 'sarg' at console. it show's following messages.

[root@mail root]# sarg
SARG: No records found
SARG: End
[root@mail root]#


Now, what could be the problem? shell i have to do some configure under sarg.conf file? if so, what should i make changes?

any idea?

--Hitesh
 
Old 09-22-2004, 03:29 AM   #7
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
yep. check sarg.conf and make sure about squid log path
Code:
access_log /var/log/squid/access.log
and check where it creates web pages.
Code:
output_dir /usr/local/apache2/htdocs/squid-reports
make sure that apache is working and publish squidlogs..


if u want apache to ask password to allow squid reports:
httpd.conf :
<Directory "/usr/local/apache2/htdocs/squid-reports">
deny from all
AllowOverride AuthConfig
Order deny,allow
</Directory>

NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin webmaster@domain.com
DocumentRoot /usr/local/apache2/htdocs/squid-reports
ServerName squid.domain.com
</VirtualHost>
....
.....

and here is my .htaccess file in /usr/local/apache2/htdocs/squid-reports directory
# cat /usr/local/apache2/htdocs/squid-reports/.htaccess
AuthType Basic
AuthUserFile /usr/local/apache2/conf/.htpasswd
AuthName Squid-logs
require valid-user
satisfy any

Code:
chmod 644 /usr/local/apache2/htdocs/squid-reports/.htaccess
chown apache /usr/local/apache2/htdocs/squid-reports/.htaccess
to create /usr/local/apache2/conf/.htpasswd file:
Code:
htpasswd -bc /usr/local/apache2/conf/.htpasswd admin paasword
chmod 644 /usr/local/apache2/conf/.htpasswd
also u need a squid.domain.com record in your DNS server. it must point to ip of your apache server. if not, try ip of apache server instead of http://squid.domain.com
good luck

Last edited by maxut; 09-22-2004 at 03:31 AM.
 
Old 09-23-2004, 01:25 AM   #8
m4dj4ck
Member
 
Registered: Aug 2004
Location: the coven
Distribution: slackies
Posts: 55

Rep: Reputation: 15
yes.it took some time to clear the cache even if u clear it from webmin or console or anywhere. if you want faster file caching or cache-clearing, u should use reiserfs filesystem as it is much more specialized in small files accessing and deleting.
 
Old 10-08-2004, 12:01 AM   #9
hitesh_linux
Member
 
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472

Original Poster
Rep: Reputation: 30
hey maxut,

I checked under /etc/sarg/sarg.conf file.

access_log /var/log/squid/access.log [this option if uncommented]

about <output_dir /usr/local/apache2/htdocs/squid-reports > line, it showing me this:

# TAG: output_dir
# The reports will be saved in that directory
# sarg -o dir
#
#output_dir /var/www/html/squid-reports
output_dir /var/www/sarg/ONE-SHOT

so, i tried in web browser with <mail.hylix.com/sarg/index.html> it showing, but when i clicked any html link it showing same error. here it is..
------------------------------------------------------------------------------------------------
Squid User's Access Report
DIRECTORY DESCRIPTION
ONE-SHOT One shot reports
daily Daily reports
weekly Weekly reports
monthly Monthly reports

Not Found

The requested URL /sarg/ONE-SHOT/index.html was not found on this server.
---------------------------------------------------------------------------------------------------

and when check under /usr/local path, <apache2> direcotry does not exists. what should i do now? [/usr/local/apache2/htdocs/squid-reports]

forget to tell u , I am using fedora core 1....

please help me...

-/Hitesh

Last edited by hitesh_linux; 10-08-2004 at 12:02 AM.
 
Old 10-08-2004, 02:41 AM   #10
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
i use /usr/local/apache2/htdocs/squid-reports, because i have installed apache2 from source. and apache2 was installed there by the defualt u can go with /var/www/sarg
i forgot to tell u. sarg must be run first, so it will create web pages from squid access logs. then u can check them trou browser. i added a cron job so sarg runs everyday and create web pages. i can check the logs by day

try to run sarg.
/usr/bin/sarg
 
Old 10-08-2004, 11:56 AM   #11
hitesh_linux
Member
 
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472

Original Poster
Rep: Reputation: 30
Hi,

I followed that also, here it is...

[root@mail squid]# /usr/bin/sarg
SARG: No records found
SARG: End
[root@mail squid]#

should i start sarg services?

Thanx...

-/Hitesh
 
Old 10-09-2004, 01:42 AM   #12
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
as i told b4, sarg is not online monitoring tool. when u run sarg , it reads squid access.log and creates cool web pages to analyze logs. then sarg ends. u can add it as cron job. so it will generate web pages at the time u specified.
sarg doesnt work as a service. it just works as a program.
Quote:
[root@mail squid]# /usr/bin/sarg
SARG: No records found
SARG: End
it seems that access.log of squid is empty. check the /var/log/squid/access.log
u can read sarg man page. make sure that u defined where the access.log located, in sarg.conf:
access_log /path/to/squid/access.log

ps: sorry for bad english
good luck
 
  


Reply



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
squid proxy server configuration & distribution of internet without proxy gaurav_gupta082 Linux From Scratch 2 07-31-2010 11:25 AM
configure squid proxy with microsoft proxy as a parent proxy nintykola Linux - Software 1 08-28-2007 01:38 AM
New monitor problems, Fedora Cora 3, Samsung 913N monitor gingermeatboy Linux - Hardware 2 08-23-2005 08:22 AM
Proxy problem: can`t connect SSH through proxy... bugzilla Linux - Networking 3 09-16-2004 10:36 AM
how to enable proxy by variables-proxy is IP-adres joeSVK Linux - Networking 0 02-11-2004 07:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:02 PM.

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