Monitoring Squid Proxy

can you do a cmk -d | grep "<<<"

Sure!

<<<cmk_agent_ctl_status:sep(0)>>>
<<<checkmk_agent_plugins_lnx:sep(0)>>>
<<<labels:sep(0)>>>
<<<df_v2>>>
<<<df_v2>>>
<<<systemd_units>>>
<<<nfsmounts_v2:sep(0)>>>
<<<cifsmounts>>>
<<<mounts>>>
<<<ps_lnx>>>
<<<mem>>>
<<<cpu>>>
<<<uptime>>>
<<<lnx_if>>>
<<<lnx_if:sep(58)>>>
<<<tcp_conn_stats>>>
<<<diskstat>>>
<<<kernel>>>
<<<md>>>
<<<vbox_guest>>>
<<<postfix_mailq>>>
<<<postfix_mailq_status:sep(58)>>>
<<<job>>>
<<<ntp:cached(1698664434,120)>>>
<<<mrpe>>>
<<<local:sep(0)>>>
<<<apache_status:sep(124)>>>
<<<check_squid>>>
<<<apt:sep(0):cached(1698662993,3600)>>>

What version of the squid plugin have you installed?

Honestly - I am not sure…

This is what is in the file “squid”:


if type squidclient > /dev/null 2>&1 ; then
   echo "<<<check_squid>>>"
   squidclient -p 3128 -T2 mgr:5min | grep =
fi

Why do I have the feeling I am doing something wrong? :thinking:

this looks different form my plugin. So if you like update to my version and try again. Squid Web Proxy

Thanks.
Here is what I did + what happend:

  • downloaded the file squid-2.0.4-2023-09-21.mkp
  • renamed the file squid-2.0.4-2023-09-21.mkp to squid.mkp
  • logged in to my CheckMK server as site user
  • issued the command `OMD[mysite]:~$ mkp install /tmp/squid.mkp
  • got this reply:
    This command is deprecated. Please use the add and enable commands.

Looks like the docu was written for another version of CheckMK server ?

So i tried OMD[mysite]:~$ mkp add /tmp/squid.mkp and got this back:

squid 2.0.4-2023-09-21

My next guess was to enable the plugin:

  • OMD[mysite]:~$ mkp enable squid 2.0.4-2023-09-21 and this gave me:

[squid 2.0.4-2023-09-21]: Installing

Then I restarted the CheckMK server (just in case…).

But still no output for:
OMD[mysite]: ~$ cmk -d my-squid-host-name | grep -A10 “<<squid:sep(0)>>”

Funny thing:
I can now see new services on the Squid host!

But when I try to activate the changes, I get an error (failed) message:

looks like you have still some old stuff on your cmk server check_squid. I guess under ~/local/share/checkmk/checks

Hmmm… I don´t see any old stuff…

your error message says something different. can you do a find for check_squid?

Sorry for the delayed reply.

sudo find / -type f -name “check_squid” doesn´t show anything - if that is what you meant?

ok. I assume you removed the old Squid plugin before you installed the new one (including all rules, like enforced services), right?

you can try a cmk --debug --no-cache --vvII squidhost followed by cmk --debug -u

I assume you removed the old Squid plugin before you installed the new one (including all rules, like enforced services), right?

Well… I can´t recall - and I am not denying it :slight_smile:

Is it possible there is a typo?

image

This OMD[mysite]:~$ cmk --debug --no-cache -vI squidhost would give some output:

Discovering services and host labels on: squidhost
squidhost:

  • FETCHING DATA
    [TCPFetcher] Execute data source
    [PiggybackFetcher] Execute data source
    No piggyback files for ‘squidhost’. Skip processing.
    No piggyback files for ‘192.168.20.236’. Skip processing.
  • ANALYSE DISCOVERED HOST LABELS
    SUCCESS - Found no new host labels
  • ANALYSE DISCOVERED SERVICES
  • EXECUTING DISCOVERY PLUGINS (39)
    SUCCESS - Found no new services
    OMD[mysite]:~$

Tryy a upper cae U, cmk --debug -U

is this the complete output? Thre is one I missing -vII

Hello, and - again - apologies for the late reply. I am quite busy with other projects at work.

Here comes the new output:

OMD[mysite]:~$ cmk --debug --no-cache -vII squidhost
Discovering services and host labels on: squidhost
squidhost:

  • FETCHING DATA
    [TCPFetcher] Execute data source
    [PiggybackFetcher] Execute data source
    No piggyback files for ‘squidhost’. Skip processing.
    No piggyback files for ‘192.168.20.236’. Skip processing.
  • ANALYSE DISCOVERED HOST LABELS
    SUCCESS - Found 2 host labels
  • ANALYSE DISCOVERED SERVICES
  • EXECUTING DISCOVERY PLUGINS (39)
    1 apt
    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 19 services
    OMD[mysite]:~$

Tryy a upper cae U, cmk --debug -U

Here we go:

OMD[mysite]:~$ cmk --debug -U
Generating configuration for core (type nagios)…
Precompiling host checks…OK
Validating Nagios configuration…OK
OMD[mysite]:~$

ok. no error here but also no squid.

In the discovery is still one v missing.

cmk --debug --no-cache --vvII squidhost

if in the cmk -d squidhost | grep "<<<" still no <<<squid:sep(0)>>>

you can try to change the agent plugin (/usr/lib/check_mk_agent/plugins/squid) to use the full path to the squidclient. On my sysrtem
/usr/bin/squidclient -p "$port" -T2 mgr:5min | grep =

I think I found at least a part of the problem.

Let´s assume I have more than one VM with Squid installed. For the sake of the discussionI call them “squidhost1” and “squidhost2”

Below is the partial output from cmk --debug --no-cache -vvII squidhost1

Trying host label discovery with: apt, check_mk, check_squid, checkmk_agent_plugins_lnx, cifsmounts, cmk_agent_ctl_status, cpu, df_v2, diskstat, job, kernel, labels, lnx_if, local, md, mem, mounts, mrpe, multipath, nfsmounts_v2, ntp, postfix_mailq, postfix_mailq_status, ps_lnx, systemd_units, tcp_conn_stats, uptime, vbox_guest
  cmk/os_family: linux (check_mk)
  cmk/device_type: vm (labels)
Trying host label discovery with: 
SUCCESS - Found 2 host labels
+ ANALYSE DISCOVERED SERVICES
+ EXECUTING DISCOVERY PLUGINS (44)
  Trying discovery with: local, checkmk_agent, uptime, ntp, lnx_if, diskstat, check_squid_dns_time, nfsmounts, tcp_conn_stats, docker_container_status_uptime, systemd_units_sockets_summary, cpu_threads, mem_vmalloc, apt, kernel, vbox_guest, systemd_units_services_summary, multipath, mssql_datafiles, check_squid_cpu, cifsmounts, cpu_loads, check_squid_client_hits, postfix_mailq_status, check_squid_client_reqs, mem_win, mssql_transactionlogs, chrony, check_squid_server_reqs, ps, systemd_units_sockets, kernel_util, df, md, mounts, mrpe, domino_tasks, kernel_performance, check_mk_only_from, mem_linux, job, systemd_units_services, ntp_time, postfix_mailq
  1 apt
  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 19 services
OMD[mysite]:~$