Collection of CheckMK checks (see https://checkmk.com/). All checks and plugins are provided as is. Absolutely no warranty. Send any comments to thl-cmk[at]outlook[dot]com

Skip to content
Snippets Groups Projects
Commit 26ddf79a authored by thl-cmk's avatar thl-cmk :flag_na:
Browse files

update project

parent 0673dcdf
No related branches found
No related tags found
No related merge requests found
......@@ -56,14 +56,14 @@ def parse_squid(string_table) -> Dict[str, float]:
except ValueError:
continue
if 'kbytes' in entry:
value = value * 1024 + 8 # change kbytes to bits
value = value * 1024 + 8 # change kbytes to bits
section[entry] = value
return section
register.agent_section(
name="squid",
name='squid',
parse_function=parse_squid,
)
......@@ -164,7 +164,7 @@ def check_squid(item, params, section: Dict[str, float]) -> CheckResult:
for value in squid_map[item].keys():
entry = squid_map[item][value]
levels_upper = params.get(entry['levels_upper'], None)
yield from check_levels_predictive(
yield from check_levels_predictive(
label=entry['label'],
value=section[value],
levels=levels_upper,
......
......@@ -29,8 +29,6 @@ def get_squid_files(conf) -> FileGenerator:
yield Plugin(
base_os=OS.LINUX,
source=Path('squid'),
# interval=interval,
# timeout=timeout
)
yield PluginConfig(
......
......@@ -2,13 +2,14 @@
# based on https://github.com/allangood/check_mk/tree/master/plugins/squid by Allan GooD: allan.cassaro@gmail.com
#
# 2023-05-20: changed separator to :sep(0)
# changed section from check_squid to squid
#
# https://etutorials.org/Server+Administration/Squid.+The+definitive+guide/Chapter+14.+Monitoring+Squid/14.2+The+Cache+Manager/
#
# Table 14-1. Cache manager pages for squidclient mgr:<page>
#
# 2023-05-20: changed separator to :sep(0)
# changed section from check_squid to squid
# 2023-05-22: fixed missing "<" in section name
#
MK_CONFDIR="/etc/check_mk"
......@@ -22,7 +23,7 @@ fi
if type squidclient > /dev/null 2>&1 ; then
echo "<<squid:sep(0)>>>"
echo "<<<squid:sep(0)>>>"
# one squid instance
squidclient -p "$port" -T2 mgr:5min | grep =
......
......@@ -27,14 +27,13 @@ check_metrics['check_mk-squid'] = {
'predict_util': {'auto_graph': False},
}
metric_info['client_hits_per_second'] = {'title': _('Cache hits'), 'unit': '1/s', 'color': '11/a', }
metric_info['client_requests_per_second'] = {'title': _('Requests'), 'unit': '1/s', 'color': '31/a', }
metric_info['client_errors_per_second'] = {'title': _('Errors'), 'unit': '1/s', 'color': '21/a', }
metric_info['predict_client_hits_per_second'] = {'title': _('Cache hits (Predicted)'), 'unit': '1/s', 'color': '52/a', }
metric_info['predict_client_requests_per_second'] = {'title': _('Requests (Predicted)'), 'unit': '1/s', 'color': '51/a', }
metric_info['predict_client_requests_per_second'] = {'title': _('Requests (Predicted)'), 'unit': '1/s',
'color': '51/a', }
graph_info['squid_client'] = {
'title': _('Squid Client statistics'),
......
......@@ -42,35 +42,6 @@ def _valuespec_squid():
return Dictionary(
title=_('Squid Web Proxy (Linux)'),
elements=[
# ('client_requests',
# Tuple(
# title=_('Set levels for Client Requests'),
# elements=[
# Integer(title=_('Warning at'), default_value=600, unit='/s'),
# Integer(title=_('Critical at'), default_value=800, unit='/s'),
# ])),
# not sure if client hits as upper levels are use full
# ('client_hits',
# Tuple(
# title=_('Set levels for Client Hits'),
# elements=[
# Integer(title=_('Warning at'), default_value=600, unit='/s'),
# Integer(title=_('Critical at'), default_value=800, unit='/s'),
# ])),
# ('server_requests',
# Tuple(
# title=_('Set levels for Server Requests'),
# elements=[
# Integer(title=_('Warning at'), default_value=600, unit='/s'),
# Integer(title=_('Critical at'), default_value=800, unit='/s'),
# ])),
# ('cpu_usage',
# Tuple(
# title=_('Set levels for Squid CPU usage'),
# elements=[
# Float(title=_('Warning at'), default_value=60.0, unit='%'),
# Float(title=_('Critical at'), default_value=80.0, unit='%')
# ])),
('client_requests',
Levels(
title=_('Set levels for Client Requests'),
......
......@@ -12,7 +12,7 @@
'gui': ['wato/squid.py', 'metrics/squid.py']},
'name': 'squid',
'title': 'Squid3 Health Check',
'version': '2.0.2-2023-05-21',
'version': '2.0.3-2023-05-22',
'version.min_required': '2.1.0b1',
'version.packaged': '2.1.0p21',
'version.usable_until': None}
\ No newline at end of file
File added
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment