[squid-users] Fwd: Getting a squid clients list

Amos Jeffries squid3 at treenet.co.nz
Thu Sep 2 13:52:38 UTC 2021


On 3/09/21 1:28 am, U Zee wrote:
> Can anyone help with running squidclient remotely and getting the list 
> of clients, or any other way to get the list of clients?
> 


You just need to adjust the squid.conf of the running Squid to allow 
management access to the machine you are fetching from.


Be aware:
   Make sure that you only use reconfigure and avoid a restart of the 
proxy after making these changes. A restart will erase some or all of 
the info you are looking to find.


With the CLIENT_IP being address of the machine you are going to do the 
fetch from these commands go at the top of squid.conf:

   acl mgr_client src CLIENT_IP
   http_access allow mgr_client
   cachemgr_passwd none client_list


... *reconfigure* (not restart) the proxy.

... run the squidclient fetch you want

.. undo or at least comment out the above settings and reconfigure.



Amos


> Thanks very much
> 
> On Tuesday, August 31, 2021, 05:50:12 PM GMT+3, U Zee 
> <uzee001 at yahoo.com> wrote:
> 
> 
> Thanks for the pointer Eliezer. I installed it on an Ubuntu 20 machine 
> and tried but it didn't seem to work:
> 
> root at ub20-srv1:~# squidclient -h squid.mydomain.com mgr:client_list
> HTTP/1.0 403 Forbidden
> Server: squid/2.6.STABLE13
> Date: Tue, 31 Aug 2021 14:45:09 GMT
> Content-Type: text/html
> Content-Length: 1115
> Expires: Tue, 31 Aug 2021 14:45:09 GMT
> X-Squid-Error: ERR_ACCESS_DENIED 0
> X-Cache: MISS from squid.mydomain.com
> Via: 1.0 squid.mydomain.com:3128 (squid/2.6.STABLE13)
> Proxy-Connection: close
> 
> root at ub20-srv1:~# squidclient -h squid.mydomain.com  mgr:info
> HTTP/1.0 403 Forbidden
> Server: squid/2.6.STABLE13
> Date: Tue, 31 Aug 2021 14:46:33 GMT
> Content-Type: text/html
> Content-Length: 1101
> Expires: Tue, 31 Aug 2021 14:46:33 GMT
> X-Squid-Error: ERR_ACCESS_DENIED 0
> X-Cache: MISS from squid.mydomain.com
> Via: 1.0 squid.mydomain.com:3128 (squid/2.6.STABLE13)
> Proxy-Connection: close
> 
> Although the proxy function seems to be working, but I cannot get the 
> "mgr" function to work:
> 
> root at ub20-srv1:~# squidclient -h squid.mydomain.com -v http://vmware.com
> Request:
> GET http://vmware.com HTTP/1.0
> Host: vmware.com
> User-Agent: squidclient/4.10
> Accept: */*
> Connection: close
> .
> HTTP/1.0 301 Moved Permanently
> Location: https://www.vmware.com/
> Content-Length: 0
> X-Cache: MISS from squid.mydomain.com
> Via: 1.0 squid.mydomain.com:3128 (squid/2.6.STABLE13)
> Proxy-Connection: close
> 
> 
> 
> 
> 
> On Monday, August 30, 2021, 02:56:29 PM GMT+3, NgTech LTD 
> <ngtech1ltd at gmail.com> wrote:
> 
> 
> 
> Hey Uzee,
> 
> You can use squidclient from another machine to access this machine.
> I do not remember how by heart but Amos might know if I am guessing right.
> 
> Eliezer
> 
> בתאריך יום ב׳, 30 באוג׳ 2021, 14:44, מאת U Zee ‏<uzee001 at yahoo.com 
> <mailto:uzee001 at yahoo.com>>:
> 
>     <sigh> I know and sadly installing it is not possible either.
>     Without going into the details too much, its a machine with a legacy
>     environment where yum and some other tools are broken and people who
>     knew about the configs are long gone.
> 
>     On Monday, August 30, 2021, 01:29:47 PM GMT+3, Amos Jeffries
>     <squid3 at treenet.co.nz <mailto:squid3 at treenet.co.nz>> wrote:
> 
> 
>     On 30/08/21 10:18 pm, U Zee wrote:
>      > Thanks Amos. I don't think the clientdb features you mentioned are
>      > enabled, I'm getting a command not found.
>      > Also I don't see anything configured for logging in squid.conf (I
>     don't
>      > know if there is any other place for it)
>      >
>      > bash-3.00# ps -ef|grep squid
>      > root      2467     1  0  2020 ?        00:00:00 /usr/squid/sbin/squid
>      > nobody    2471  2467  0  2020 ?        07:49:45 (squid)
>      > root     28018 20110  0 13:12 pts/0    00:00:00 grep squid
>      >
>      > bash-3.00# /usr/squid/sbin/squid -v
>      > Squid Cache: Version 2.6.STABLE13
>      > configure options: '--prefix=/usr/squid' 'CC=gcc' 'CFLAGS=-O3 -g'
>      >
>      > bash-3.00# squidclient mgr:client_list | grep "Address"
>      > bash: squidclient: command not found
> 
>     That is the squidclient tool missing on your machine.
> 
> 
>     Amos
>     _______________________________________________
>     squid-users mailing list
>     squid-users at lists.squid-cache.org
>     <mailto:squid-users at lists.squid-cache.org>
>     http://lists.squid-cache.org/listinfo/squid-users
>     <http://lists.squid-cache.org/listinfo/squid-users>
>     _______________________________________________
>     squid-users mailing list
>     squid-users at lists.squid-cache.org
>     <mailto:squid-users at lists.squid-cache.org>
>     http://lists.squid-cache.org/listinfo/squid-users
>     <http://lists.squid-cache.org/listinfo/squid-users>
> 
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org <mailto:squid-users at lists.squid-cache.org>
> http://lists.squid-cache.org/listinfo/squid-users 
> <http://lists.squid-cache.org/listinfo/squid-users>
> 
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-users
> 


More information about the squid-users mailing list