Re: [squid-users] Querying cache

From: Miguel Cruz <toky.cruz_at_gmail.com>
Date: Tue, 6 Oct 2009 19:32:26 -0400

Thanks for the info. I've found some info on the net about setting up
squid for snmp but it seems everything I've found is outdated.

If anyone can point me to a good resource to read about this. I've
read about using the mib.txt but still not sure how to query it.

I've created acls on squid .conf:
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl CONNECT method CONNECT
acl snmpaccess snmp_community MYCOMMUNITYSTRING
.... later on...
snmp_access allow snmpaccess localhost

I think the mib.txt file can give me what i'm looking for after seeing
this part of it:

cacheNumObjCount OBJECT-TYPE
                SYNTAX Gauge32
                MAX-ACCESS read-only
                STATUS current
                DESCRIPTION
                        " Number of objects stored by the cache "
        ::= { cacheSysPerf 7 }

To explain my setup better, I have (lets say) 20 squid_servers and I
want to be able to query them to see how many files they have in their
cache (since they are caching the content of an http server that
serves plain text files) from 1 server that sits on the same network.

Hope this helps
Thanks

On Mon, Oct 5, 2009 at 6:06 PM, Amos Jeffries <squid3_at_treenet.co.nz> wrote:
> On Mon, 5 Oct 2009 16:33:10 -0400, Miguel Cruz <toky.cruz_at_gmail.com> wrote:
>> Hello all,
>>
>> I would like to know if there is a way to query squid for the total
>> amount of files that it has in its cache.
>>
>> Reason is we are using squid in http_accell mode and if I do a wget on
>> "/" I can get a listing of all the files that reside on the docroot
>> and all the directories that are there but not of the files inside the
>> directories.  So if I was to "massage" the index.html to clear the
>> http tags I could get a list that I can count and use to do another
>> wget into the directories I find but this seems "over-engineered".
>> Instead of getting the required data in 1 connection I would have to
>> connect multiple times.
>>
>> This is part of my squid.conf file:
>>
>> httpd_accel_host 10.x.x.x
>> httpd_accel_port 80
>> httpd_accel_single_host on
>> httpd_accel_with_proxy off
>> httpd_accel_uses_host_header off
>>
>> Thanks in advanced
>> Miguel
>
> To get the number of files in squids cache use SNMP and via the cachemgr
> interface (squidclient mgr:info or cachemgr.cgi).
>
> However the problem you describe with "/" URL providing a list of files is
> not related to Squid at all. "/" URL is requested from the web server like
> any other. It's the same URL browsers fetch when only a domain name is
> entered in the address bar.
>
> The results you get back are created by the web server. You describe a
> directory listing files stored on the web server. It might be that none of
> the files listed there are cacheable and stored in squid at all.
>
>
> Please seriously consider upgrading your squid though. You will find any
> release 2.6 or higher to be much better for reverse-proxy usage. In speed,
> capability, and ease of configuration.
>
>
> Amos
>
Received on Tue Oct 06 2009 - 23:32:34 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 07 2009 - 12:00:02 MDT