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

U Zee uzee001 at yahoo.com
Sun Sep 5 08:59:43 UTC 2021


 Thanks so much Amos, really appreciate it. It also turns out that I did have the squidclient tool on my squid server, it just wasn't in the path :) I ran: squidclient mgr:client_list | grep "Address" and it gave me 28 IPs, then I also ran mgr:info and that too showed "Number of clients accessing cache:  28" which confirmed it as well.However, if you have a couple of minutes, I wanted to clarify one thing regarding the total squid clients that I'm trying to find.Before I was able to run squidclient, I had run a 'netstat -an' and grep'ed for 3128 and ran this in a loop for 4-5 days to get all connections to the proxy. The list of clients resulting from that shows 62. My understanding of squidclient is that it captures all the information since squid was started, which in my case is July 2020, so the client_list from squidclient tool should have had everything that I found from my 4-5 days of netstat, no? What am I missing or not understanding correctly? And more importantly, which source (squidclient or netstat) should be trusted?
Thanks once again-uzee
    On Thursday, September 2, 2021, 04:57:05 PM GMT+3, Amos Jeffries <squid3 at treenet.co.nz> wrote:  
 
 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
> 
_______________________________________________
squid-users mailing list
squid-users at lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20210905/082c6ff2/attachment-0001.htm>


More information about the squid-users mailing list