Monitoring Squid Proxy

Then I did the same with “squidhost2”: cmk --debug --no-cache -vvII squidhost2 and I recognized the difference in the output:

Trying discovery with: systemd_units_sockets, df, mem_linux, check_squid_client_hits, mssql_transactionlogs, vbox_guest, ntp, domino_tasks, ps, uptime, check_squid_dns_time, mem_win, postfix_mailq, kernel, mem_vmalloc, job, diskstat, apt, local, systemd_units_services, kernel_performance, mounts, chrony, checkmk_agent, lnx_if, apache_status, kernel_util, ntp_time, check_squid_cpu, systemd_units_sockets_summary, docker_container_status_uptime, tcp_conn_stats, cifsmounts, cpu_loads, postfix_mailq_status, mrpe, nfsmounts, systemd_units_services_summary, check_squid_client_reqs, check_mk_only_from, check_squid_server_reqs, md, cpu_threads, mssql_datafiles
  1 apache_status
  1 apt
  1 check_squid_client_hits
  1 check_squid_client_reqs
  1 check_squid_cpu
  1 check_squid_dns_time
  1 check_squid_server_reqs
  1 checkmk_agent
  1 cpu_loads
  1 cpu_threads
  1 df
  1 diskstat
  1 kernel_performance
  1 kernel_util
  1 lnx_if
  1 mem_linux
  1 mounts
  1 mrpe
  1 ntp_time
  1 postfix_mailq
  1 postfix_mailq_status
  1 systemd_units_services_summary
  1 systemd_units_sockets_summary
  1 tcp_conn_stats
  1 uptime
SUCCESS - Found 25 services
OMD[mysite]:~$ 

So the output is different - but why?
And then I realized that on “squidhost1” I am using Squid as a reverse proxy on port 443:

root@squidproxy1 ~# netstat -pltn | grep squid
tcp        0      0 192.168.20.236:443      0.0.0.0:*               LISTEN      1040/(squid-1)      

whereas on squidproxy2 I use Squid as a web cache:

root@squidhost2 ~# netstat -pltn | grep squid
tcp6       0      0 :::3128                 :::*                    LISTEN      1093/(squid-1) 

So I was thinking, maybe the problem is because on squidproxy1 the service is not listening on localhost, but 192.168.20.236 instead?

This output looks not like the output from my plugin. Here a sample how it sould look (I have removed most of the non squid releated output).

OMD[build]:~$ cmk -vvII vsquid
Discovering services and host labels on: vsquid
vsquid:
+ FETCHING DATA
  Source: SourceInfo(hostname='vsquid', 

+ PARSE FETCHER RESULTS
<<<check_mk>>> / Transition NOOPParser -> HostSectionParser
....
<<<squid:sep(0)>>> / Transition HostSectionParser -> HostSectionParser
....
<<<cmk_update_agent_status:cached(1699627106,300):sep(0)>>> / Transition   
....
HostKey(hostname='vsquid', source_type=<SourceType.HOST: 1>)  -> Add sections: ['check_mk', ...., 'squid', ... , 'uptime']
  HostKey(hostname='vsquid', source_type=<SourceType.HOST: 1>)  -> Add sections: []
Received no piggyback data
+ ANALYSE DISCOVERED HOST LABELS
+ ANALYSE DISCOVERED SERVICES
+ EXECUTING DISCOVERY PLUGINS (29)
  Trying discovery with: ..., checkmk_agent,  squid, ...
  1 checkmk_agent
....
  4 squid
....
  1 uptime
SUCCESS - Found 20 services
OMD[build]:~$

looks like that. From the squidclient help:

Connection Settings
  -h | --host host     Send message to server on 'host'.  Default is localhost.
  -l | --local host    Specify a local IP address to bind to.  Default is none.
  -p | --port port     Port number on server to contact. Default is 3128.
  -T timeout           Timeout in seconds for read/write operations
  --https              Use TLS/SSL on the HTTP connection

so you can try to add the option -l | --local host Specify a local IP address to bind to. Default is none.

Also you are not listening on port 3128 (the defaut). Here the script is trying to find the right one by itself. For this to work the agent plugin needs to run as root. Or you can add a config file.

"$MK_CONFDIR"/squid.cfg

with this content

port=443

Hello @thl-cmk
Thank for your package. I just start to test it.
Do you have in mind to add the monitoring of squidclient output filedescriptor information ?
It could be valuable information when squid become overused vs filedescriptor available
Regards

I had not, but as i have added a option to configure the host for the squidlient to connect to, i have also added the swap counters and the file descriptors.

I’m sorry, I do not understand how to get the swatp and filedesriptor check … Here is what i get:

I saw a counter checkbox configuration, maybe that the trick. i Tick the box, but it requiere parameter and i don’t know what to put. I try to put “filedescriptors” but it doesnt help. Could you assist me ?

Regards

I guess you have updated the package and done a rediscover?

Oh, you made a recent update of the package, ok my bad.
The website seems inaccessible at the moment, but i will try when it will be available.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.