Netgate SG-1000 microFirewall

Author Topic: [SOLVED] squidclient  (Read 4382 times)

0 Members and 1 Guest are viewing this topic.

Offline bellera

  • Hero Member
  • *****
  • Posts: 5569
  • Karma: +117/-51
    • View Profile
[SOLVED] squidclient
« on: April 08, 2014, 07:14:04 am »
Tested with squid3-dev 3.3.10 pkg 2.2.1 & 2.2.2

I wanted to use squidclient for viewing delay_pools monitoring:

Code: [Select]
squidclient mgr:delay | less
I had to indicate my LAN address because I haven't activated squid for localhost address:

Code: [Select]
squidclient -h 192.168.0.1 mgr:delay | less
Code: [Select]
squidclient -h 192.168.0.1 cache_object://delay
Code: [Select]
http://192.168.0.1:3128/squid-internal-mgr/
However, I got a denied response. Here is the beginning of the header:

Code: [Select]
HTTP/1.1 403 Forbidden
Server: squid/3.3.10
Mime-Version: 1.0
Date: Tue, 08 Apr 2014 11:58:12 GMT
Content-Type: text/html
Content-Length: 3260
X-Squid-Error: ERR_ACCESS_DENIED 0

squidclient is working correctly because if I put something like:

Code: [Select]
squidclient -h 192.168.0.1 http://www.google.com
I got the page.

I think I need some more permission at squid.conf, but I can't see which one.

Related pages I found

http://wiki.squid-cache.org/action/show/Features/CacheManager?action=show&redirect=SquidFaq%2FCacheManager#Cache_manager_access_from_squidclient

http://www.linuxcertif.com/man/1/squidclient/

https://forum.pfsense.org/index.php?topic=30057.0

https://redmine.pfsense.org/issues/114

Google squidclient pfsense

Google monitoring delay pools
« Last Edit: April 08, 2014, 12:33:13 pm by bellera »

Offline bellera

  • Hero Member
  • *****
  • Posts: 5569
  • Karma: +117/-51
    • View Profile
Re: squidclient
« Reply #1 on: April 08, 2014, 12:23:47 pm »
https://github.com/pfsense/pfsense-packages/blob/master/config/squid3/33/squid_ng.xml

squid_ng.xml have code related to activate cachemgr.cgi but I can't find this option at the WebGUI.


Offline bellera

  • Hero Member
  • *****
  • Posts: 5569
  • Karma: +117/-51
    • View Profile
Re: squidclient
« Reply #2 on: April 08, 2014, 12:26:25 pm »
Adding LAN Address to Proxy server: Cache management: External Cache-Managers permits to work with squidclient

Code: [Select]
[2.1-RELEASE][admin@pfsense.localdomain]/usr/local/pkg(11): squidclient -h pfsense.localdomain mgr:delay
HTTP/1.1 200 OK
Server: squid/3.3.10
Mime-Version: 1.0
Date: Tue, 08 Apr 2014 17:26:13 GMT
Content-Type: text/plain
Expires: Tue, 08 Apr 2014 17:26:13 GMT
Last-Modified: Tue, 08 Apr 2014 17:26:13 GMT
X-Cache: MISS from localhost
X-Cache-Lookup: MISS from localhost:3128
Via: 1.1 localhost (squid/3.3.10)
Connection: close

Delay pools configured: 1

Pool: 1
Class: 2

Aggregate:
Disabled.

Individual:
Disabled.



Memory Used: 1500 bytes

Offline bellera

  • Hero Member
  • *****
  • Posts: 5569
  • Karma: +117/-51
    • View Profile
Re: squidclient
« Reply #3 on: April 08, 2014, 12:31:47 pm »
Display the menu
Code: [Select]
squidclient -h pfsense.localdomain mgr:
Display redirector statistics
Code: [Select]
[2.1-RELEASE][admin@pfsense.localdomain]/usr/local/pkg(23): squidclient -h pfsense.localdomain mgr:redirector
HTTP/1.1 200 OK
Server: squid/3.3.10
Mime-Version: 1.0
Date: Tue, 08 Apr 2014 17:31:13 GMT
Content-Type: text/plain
Expires: Tue, 08 Apr 2014 17:31:13 GMT
Last-Modified: Tue, 08 Apr 2014 17:31:13 GMT
X-Cache: MISS from localhost
X-Cache-Lookup: MISS from localhost:3128
Via: 1.1 localhost (squid/3.3.10)
Connection: close

Redirector Statistics:
program: /usr/pbi/squidguard-squid3-i386/bin/squidGuard
number active: 8 of 16 (0 shutting down)
requests sent: 162
replies received: 161
queue length: 0
avg service time: 0 msec

      #      FD     PID # Requests   # Replies Flags    Time Offset Request
      1      35   21817         138         137 B      0.025       1 (none)
      2      38   21850           9           9       0.000       0 (none)
      3      40   22029           3           3       0.001       0 (none)
      4      50   22108           0           0       0.000       0 (none)
      5      52   22275           0           0       0.000       0 (none)
      6      54   22309           0           0       0.000       0 (none)
      7      56   22602           0           0       0.000       0 (none)
      8      58   22846           0           0       0.000       0 (none)

Flags key:

   B = BUSY
   W = WRITING
   C = CLOSING
   S = SHUTDOWN PENDING

Offline bellera

  • Hero Member
  • *****
  • Posts: 5569
  • Karma: +117/-51
    • View Profile
Re: [SOLVED] squidclient
« Reply #4 on: April 16, 2014, 02:40:27 am »
Sticky thread about Monitor Squid Status, https://forum.pfsense.org/index.php?topic=28835.0