From a76bc3805436ddb096595b434b008f1e47c54228 Mon Sep 17 00:00:00 2001 From: mpana Date: Wed, 5 Sep 2018 23:52:16 +0300 Subject: [PATCH] almost there --- .vscode/tags | 41 +++++ agents/bakery/mk_nfsiostat | 10 ++ agents/plugins/mk_nfsiostat | 6 + checks/nfsiostat | 144 ++++++++++++++++++ info | 23 +++ nfsiostat-1.0.mkp | Bin 0 -> 3847 bytes web/plugins/metrics/metrics_nfsiostat.py | 86 +++++++++++ web/plugins/wato/agent_bakery_nfsiostat.py | 0 .../wato/check_parameters_nfsiostat.py | 114 ++++++++++++++ 9 files changed, 424 insertions(+) create mode 100644 .vscode/tags create mode 100644 agents/bakery/mk_nfsiostat create mode 100644 agents/plugins/mk_nfsiostat create mode 100644 checks/nfsiostat create mode 100644 info create mode 100644 nfsiostat-1.0.mkp create mode 100644 web/plugins/metrics/metrics_nfsiostat.py create mode 100644 web/plugins/wato/agent_bakery_nfsiostat.py create mode 100644 web/plugins/wato/check_parameters_nfsiostat.py diff --git a/.vscode/tags b/.vscode/tags new file mode 100644 index 0000000..56c7b04 --- /dev/null +++ b/.vscode/tags @@ -0,0 +1,41 @@ +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ +!_TAG_PROGRAM_NAME Exuberant Ctags // +!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ +!_TAG_PROGRAM_VERSION 5.8 // +check_parameters.py ../web/plugins/wato/check_parameters.py 1;" kind:file line:1 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:103 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:12 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:19 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:26 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:33 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:40 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:47 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:54 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:61 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:68 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:75 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:82 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:89 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:96 +elements ../web/plugins/wato/check_parameters.py /^ elements=[$/;" kind:variable line:8 +match_type ../web/plugins/wato/check_parameters.py /^ match_type="dict",$/;" kind:variable line:113 +nfsiostat.py ../web/plugins/metrics/nfsiostat.py 1;" kind:file line:1 +optional_keys ../web/plugins/wato/check_parameters.py /^ optional_keys=True, $/;" kind:variable line:7 +title ../web/plugins/wato/check_parameters.py /^ title=_("Operations"),$/;" kind:variable line:11 +title ../web/plugins/wato/check_parameters.py /^ title=_("RPC Backlog"),$/;" kind:variable line:18 +title ../web/plugins/wato/check_parameters.py /^ title=_("Read Average Executions (ms)"),$/;" kind:variable line:60 +title ../web/plugins/wato/check_parameters.py /^ title=_("Read Average RTT (ms)"),$/;" kind:variable line:53 +title ../web/plugins/wato/check_parameters.py /^ title=_("Read Operations"),$/;" kind:variable line:25 +title ../web/plugins/wato/check_parameters.py /^ title=_("Read Retransmissions"),$/;" kind:variable line:46 +title ../web/plugins/wato/check_parameters.py /^ title=_("Read kB\/op"),$/;" kind:variable line:39 +title ../web/plugins/wato/check_parameters.py /^ title=_("Read"),$/;" kind:variable line:32 +title ../web/plugins/wato/check_parameters.py /^ title=_("Write Avg RTT (ms)"),$/;" kind:variable line:95 +title ../web/plugins/wato/check_parameters.py /^ title=_("Write Avg exe (ms)"),$/;" kind:variable line:102 +title ../web/plugins/wato/check_parameters.py /^ title=_("Write B\/s"),$/;" kind:variable line:81 +title ../web/plugins/wato/check_parameters.py /^ title=_("Write Bytes"),$/;" kind:variable line:74 +title ../web/plugins/wato/check_parameters.py /^ title=_("Write Operations\/s"),$/;" kind:variable line:67 +title ../web/plugins/wato/check_parameters.py /^ title=_("Write Retransmissions"),$/;" kind:variable line:88 +title ../web/plugins/wato/check_parameters.py /^ title=_("NFS IO Statistics"),$/;" kind:variable line:111 +title ../web/plugins/wato/check_parameters.py /^ title=_("NFS IO Statistics"),$/;" kind:variable line:6 diff --git a/agents/bakery/mk_nfsiostat b/agents/bakery/mk_nfsiostat new file mode 100644 index 0000000..9709abd --- /dev/null +++ b/agents/bakery/mk_nfsiostat @@ -0,0 +1,10 @@ +#!/usr/bin/env python +# -*- encoding: utf-8; py-indent-offset: 4 -*- + +def bake_nfsiostat(opsys, conf, conf_dir, plugins_dir): + shutil.copy2(cmk.paths.local_agents_dir + "/plugins/mk_nfsiostat", plugins_dir + "/mk_nfsiostat") + +bakery_info["mk_nfsiostat"] = { + "bake_function" : bake_nfsiostat, + "os" : [ "linux", ], +} \ No newline at end of file diff --git a/agents/plugins/mk_nfsiostat b/agents/plugins/mk_nfsiostat new file mode 100644 index 0000000..c0eb91c --- /dev/null +++ b/agents/plugins/mk_nfsiostat @@ -0,0 +1,6 @@ +#!/bin/bash + +if command nfsiostat > /dev/null ; then + echo '<<>>' + nfsiostat | paste -sd " " - | tr -s ' ' +fi \ No newline at end of file diff --git a/checks/nfsiostat b/checks/nfsiostat new file mode 100644 index 0000000..683fe2c --- /dev/null +++ b/checks/nfsiostat @@ -0,0 +1,144 @@ +#!/usr/bin/python +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2018 mk@mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# This file is part of Check_MK. +# The official homepage is at http://mathias-kettner.de/check_mk. +# +# check_mk is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation in version 2. check_mk is distributed +# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- +# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more de- +# tails. You should have received a copy of the GNU General Public +# License along with GNU Make; see the file COPYING. If not, write +# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +# Boston, MA 02110-1301 USA. + + +# example output +# +#y.y.y.y:/mount/name mounted on /var/log/da: +# +# op/s rpc bklog +#2579.20 0.00 +#read: ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms) +# 0.000 0.000 0.000 0 (0.0%) 0.000 0.000 +#write: ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms) +# 2578.200 165768.087 64.296 0 (0.0%) 21.394 13980.817 +# +#x.x.x.x:/mount/name mounted on /data: +# ... + +factory_settings["nfsiostat_default_levels"] = { + "op_s" : (70.00, 100.00), + "rpc_backlog" : (70.00, 100.00), + "read_ops" : (160.00, 200.00), + "read_b_s" : (200.00, 250.00), + "read_b_op" : (200.00, 250.00), + "read_retrans" : (10.0, 20.0), + "read_avg_rtt_ms" : (170.00, 200.00), + "read_avg_exe_ms" : (180.00, 200.00), + "write_ops_s" : (100.00, 200.00), + "write_b_s" : (200.00, 250.00), + "write_b_op" : (200.00, 250.00), + "write_retrans" : (10.0, 20.0), + "write_avg_rtt_ms" : (190.00, 200.00), + "write_avg_exe_ms" : (198.00, 200.0), +} + +# we can convert once it is clear what the format/standards are +# count, (item (name), title, factor, fmt,) +param_name = { + "0" : ("op_s","Operations", 1, "%.2f/s"), + "1" : ("rpc_backlog", "RPC Backlog", 1, "%.2f"), + "2" : ("read_ops", "Read operations", 1, "%.3f/s"), + "3" : ("read_b_s", "Reads per second", 1000, "%.3fB/s"), + "4" : ("read_b_op", "Read bytes", 1000, "%.3fB/op"), + "5" : ("read_retrans", "Read Retransmission", 1, "%.1f%%"), + "6" : ("read_retrans", "Read Retransmission", 1, "%.1f%%"), + "7" : ("read_avg_rtt_ms", "Read average RTT", 1000, "%.3f/s",), + "8" : ("read_avg_exe_ms", "Read average EXE", 1000, "%.3f/s",), + "9" : ("write_ops_s", "Write operations", 1, "%.3f/s"), + "10" : ("write_b_s", "Writes per second", 1000, "%.3fkB/s"), + "11" : ("write_b_op", "Write bytes", 1000, "%.3fB/op"), + "12" : ("write_retrans", "Write Retransmission", 1, "%.1f%%"), + "13" : ("write_retrans", "Write Retransmission", 1, "%.3f%%"), + "14" : ("write_avg_rtt_ms", "Write Average RTT", 1, "%.3f/ms"), + "15" : ("write_avg_exe_ms", "Write Average EXE", 1, "%.3f/ms"), +} + + +def parse_nfsiostat(info): + #removes double list + [new_info] = info + import re + # provides a dictionary with mountpoint as key and a list of 16 metrics + # in exact order + parsed = {m[0]: m[1:] for m in re.findall(r'(\S+:/\S+)%s' % \ + (r'.*?([\d.]+)' * 16), str(new_info).strip('[]'), flags=re.DOTALL)} + return parsed + + +def inventory_nfsiostat(parsed): + inventory = [] + for mountname in parsed.keys(): + yield mountname, "nfsiostat_default_levels" + + +def check_nfsiostat(item, params, parsed): + # check the value we recieved against our map of values + # assign appropriate type to value + def check_nfsiostat_params(count, value): + item = param_name[str(count)][0] + title = param_name[str(count)][1] + factor = param_name[str(count)][2] + fmt = param_name[str(count)][3] + value = float(value) + crit = float(params[item][1]) + warn = float(params[item][0]) + # convert + value = factor * value + # match on item or fmt + if item == "read_ops": + # if fmt == "%.3f/s": + value = value / factor + + if value >= crit: + perfdata = [ (item, value, warn, crit ) ] + return(2, "%s: %s" % (title, fmt % value), perfdata) + elif value >= warn: + perfdata = [ (item, value, warn, crit ) ] + return(1, "%s: %s" % (title, fmt % value), perfdata) + else: + perfdata = [ (item, value, warn, crit ) ] + return(0, "%s: %s" % (title, fmt % value), perfdata) + + for mountpoint, values in parsed.items(): + # We have duplicate items at index 5 and 12. We exclude the dupes here + if mountpoint == item: + count = 0 + for value in values: + if count != 5 and count != 12: + yield(check_nfsiostat_params(count, value)) + count = count + 1 + + +check_info['nfsiostat'] = { + 'parse_function' : parse_nfsiostat, + 'inventory_function' : inventory_nfsiostat, + 'check_function' : check_nfsiostat, + 'service_description' : 'NFS IO stats %s', + 'group' : 'nfsiostats', + 'default_levels_variable': 'nfsiostat_default_levels', + 'has_perfdata' : True, + #'includes' : ['size_trend.include', 'df.include'] +} \ No newline at end of file diff --git a/info b/info new file mode 100644 index 0000000..c657c03 --- /dev/null +++ b/info @@ -0,0 +1,23 @@ +{'author': 'Marius Pana (mp@spearhead.systems)', + 'description': 'The nfsiostat checks nfs IO statictics.', + 'download_url': 'https://code.spearhead.cloud/Spearhead/check_mk-check-nfsiostat', + 'files': {'agents': ['plugins/mk_nfsiostat', 'bakery/mk_nfsiostat], + 'alert_handlers': [], + 'bin': [], + 'checkman': [], + 'checks': ['nfsiostat'], + 'doc': [], + 'inventory': [], + 'lib': [], + 'locales': [], + 'mibs': [], + 'notifications': [], + 'pnp-templates': [], + 'web': ['plugins/metrics/nfsiostat.py', + 'plugins/wato/check_parameters.py']}, + 'name': 'nfsiostat', + 'num_files': 4, + 'title': 'Check NFS IO stats', + 'version': '1.0', + 'version.min_required': '1.5.0', + 'version.packaged': '1.5.0'} \ No newline at end of file diff --git a/nfsiostat-1.0.mkp b/nfsiostat-1.0.mkp new file mode 100644 index 0000000000000000000000000000000000000000..93119e48203221e2eab761d0ac0f4425afedd1b7 GIT binary patch literal 3847 zcmajOWmFS@q5xnRH9)0DNK7f|P&$+$O4sNd5|W~T)aa5H7>zW7fXGBZI;02EDWkgw zBS!AsfA8PD-#H&g91w`?`)m%tzjN?(a`*JI@e&df78Q1Lc~5X)35U+B(vGz6>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*E_qu2-y+BD| zos~3m6=KueW}c}P5(rm{;lYG`jcdMZXh$;!my5-5^=d`v(@mZ7!wC}~X92f{^m6sO zQulW}ZNE^A!rTGCHMG+BQw#SMeuD|C8EFxdzx(Z%03$(ATYYG1aJ1jMpFvX$3V3rt zSX|xQj08%1MW+-E9c|p3+5^#CdRH31D?I(&e{&$%9V^nsC-=N4zc_ca_PbFy8fW_A nq_e_n&jb?K920rkIeZZH1pFBMUtx6m@PyXoEAa#c1O)#FOM#H^ literal 0 HcmV?d00001 diff --git a/web/plugins/metrics/metrics_nfsiostat.py b/web/plugins/metrics/metrics_nfsiostat.py new file mode 100644 index 0000000..32aa4c9 --- /dev/null +++ b/web/plugins/metrics/metrics_nfsiostat.py @@ -0,0 +1,86 @@ +metric_info['op_s'] = { + 'title': _('Operations per second'), + 'unit': 'count', + 'color': '#90ee90', +} + +metric_info['rpc_backlog'] = { + 'title': _('RPC Backlog'), + 'unit': 'count', + 'color': '#90ee90', +} + +metric_info['read_ops'] = { + 'title': _('Read operations'), + 'unit': '1/s', + 'color': '34/a', +} + +metric_info['read_b_s'] = { + 'title': _('Read size per second'), + 'unit': 'bytes/s', + 'color': '#80ff20', +} + +unit_info['bytes/op'] = { + 'title': _('Read size per operation'), + 'unit': 'bytes/op', + 'color': '#4080c0', + "render" : bytes_human_readable, +} + +metric_info['read_b_op'] = { + 'title': _('Read size per operation'), + 'unit': 'bytes/op', + 'color': '#4080c0', + "render" : bytes_human_readable, +} + +metric_info['read_retrans'] = { + 'title': _('Read retransmission'), + 'unit': '%', + 'color': '#90ee90', +} + +metric_info['read_avg_rtt_ms'] = { + 'title': _('Read average rtt'), + 'unit': 's', + 'color': '#90ee90', +} + +metric_info['read_avg_exe_ms'] = { + 'title': _('Read average exe'), + 'unit': 's', + 'color': '#90ee90', +} + +metric_info['write_ops_s'] = { + 'title': _('Write operations'), + 'unit': '1/s', + 'color': '34/a', +} + +metric_info['write_b_s'] = { + 'title': _('Writes size per second'), + 'unit': 'bytes/s', + 'color': '#80ff20', +} + +metric_info['write_b_op'] = { + 'title': _('Writes size per operation'), + 'unit': 'bytes/op', + 'color': '#4080c0', + "render" : bytes_human_readable, +} + +metric_info['write_avg_rtt_ms'] = { + 'title': _('Write average rtt'), + 'unit': 's', + 'color': '#90ee90', +} + +metric_info['write_avg_exe_ms'] = { + 'title': _('Write average exe'), + 'unit': 's', + 'color': '#90ee90', +} \ No newline at end of file diff --git a/web/plugins/wato/agent_bakery_nfsiostat.py b/web/plugins/wato/agent_bakery_nfsiostat.py new file mode 100644 index 0000000..e69de29 diff --git a/web/plugins/wato/check_parameters_nfsiostat.py b/web/plugins/wato/check_parameters_nfsiostat.py new file mode 100644 index 0000000..ba92a37 --- /dev/null +++ b/web/plugins/wato/check_parameters_nfsiostat.py @@ -0,0 +1,114 @@ +register_check_parameters( + subgroup_storage, + "nfsiostats", + _("NFS IO Statistics"), + Dictionary( + title=_("NFS IO Statistics"), + optional_keys=True, + elements=[ + ("op_s", + Tuple( + title=_("Operations"), + elements=[ + Float(title=_("Warning at"), default_value=70.00, unit="1/s"), + Float(title=_("Critical at"), default_value=100.00, unit="1/s"), + ])), + ("rpc_backlog", + Tuple( + title=_("RPC Backlog"), + elements=[ + Float(title=_("Warning below"), default_value=70.00, unit="queue"), + Float(title=_("Critical below"), default_value=100.00, unit="queue"), + ])), + ("read_ops", + Tuple( + title=_("Read Operations"), + elements=[ + Float(title=_("Warning at"), default_value=150.000, unit="1/s"), + Float(title=_("Critical at"), default_value=200.000, unit="1/s"), + ])), + ("read_b_s", + Tuple( + title=_("Read Bytes"), + elements=[ + Float(title=_("Warning at"), default_value=200.000, unit="bytes/s"), + Float(title=_("Critical at"), default_value=250.000, unit="bytes/s"), + ])), + ("read_b_op", + Tuple( + title=_("Read kB/op"), + elements=[ + Float(title=_("Warning at"), default_value=200.000, unit="bytes/op"), + Float(title=_("Critical at"), default_value=250.000, unit="bytes/op"), + ])), + ("read_retrans", + Tuple( + title=_("Read Retransmissions"), + elements=[ + Percentage(title=_("Warning at"), default_value=10.0), + Percentage(title=_("Critical at"), default_value=20.0), + ])), + ("read_avg_rtt_ms", + Tuple( + title=_("Read Average RTT (ms)"), + elements=[ + Float(title=_("Warning at"), default_value=150.000, unit="ms"), + Float(title=_("Critical at"), default_value=200.000, unit="ms"), + ])), + ("read_avg_exe_ms", + Tuple( + title=_("Read Average Executions (ms)"), + elements=[ + Float(title=_("Warning at"), default_value=15.000, unit="ms"), + Float(title=_("Critical at"), default_value=16.000, unit="ms"), + ])), + ("write_ops_s", + Tuple( + title=_("Write Operations/s"), + elements=[ + Float(title=_("Warning at"), default_value=15.000, unit="1/s"), + Float(title=_("Critical at"), default_value=16.000, unit="1/s"), + ])), + ("write_b_s", + Tuple( + title=_("Write Bytes"), + elements=[ + Float(title=_("Warning at"), default_value=200.000, unit="bytes/s"), + Float(title=_("Critical at"), default_value=250.000, unit="bytes/s"), + ])), + ("write_b_op", + Tuple( + title=_("Write B/s"), + elements=[ + Float(title=_("Warning at"), default_value=200.000, unit="bytes/s"), + Float(title=_("Critical at"), default_value=250.000, unit="bytes/s"), + ])), + ("write_retrans", + Tuple( + title=_("Write Retransmissions"), + elements=[ + Percentage(title=_("Warning at"), default_value=10.0), + Percentage(title=_("Critical at"), default_value=20.0), + ])), + ("write_avg_rtt_ms", + Tuple( + title=_("Write Avg RTT (ms)"), + elements=[ + Float(title=_("Warning at"), default_value=10.000, unit="ms"), + Float(title=_("Critical at"), default_value=20.000, unit="ms"), + ])), + ("write_avg_exe_ms", + Tuple( + title=_("Write Avg exe (ms)"), + elements=[ + Float(title=_("Warning at"), default_value=10.000, unit="ms"), + Float(title=_("Critical at"), default_value=20.000, unit="ms"), + ])), + ] + ), + + TextAscii( + title=_("NFS IO Statistics"), + ), + match_type="dict", +) \ No newline at end of file