Module: check_mk
Branch: master
Commit: 01e6308268a519208ba6858509597b8011b0165e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=01e6308268a519…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jul 1 15:42:35 2014 +0200
aix_diskiod: new check for disk IO on AIX
---
.werks/1039 | 8 ++++
ChangeLog | 1 +
agents/check_mk_agent.aix | 10 +++++
checkman/aix_diskiod | 77 ++++++++++++++++++++++++++++++++
checks/aix_diskiod | 69 ++++++++++++++++++++++++++++
pnp-templates/check_mk-aix_diskiod.php | 1 +
web/plugins/perfometer/check_mk.py | 1 +
7 files changed, 167 insertions(+)
diff --git a/.werks/1039 b/.werks/1039
new file mode 100644
index 0000000..e597bc9
--- /dev/null
+++ b/.werks/1039
@@ -0,0 +1,8 @@
+Title: aix_diskiod: new check for disk IO on AIX
+Level: 2
+Component: checks
+Version: 1.2.5i5
+Date: 1404222142
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 5ac7e61..5bfe9ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@
* 1034 Always provide also 64 bit version of Windows agent
* 0170 hp_proliant_power: New check to monitor the Power Meter on Prolaint Servers
and iLO Boards
* 0172 zfsget: Check is now usable in cluster_mode...
+ * 1039 aix_diskiod: new check for disk IO on AIX
* 0994 FIX: agent plugin smart: fixed syntax error
* 0989 FIX: logwatch.ec: Fix forwarding multiple messages via syslog/TCP...
* 0943 FIX: if.include: fixed incorrect traffic percentage values in the check output
of if checks...
diff --git a/agents/check_mk_agent.aix b/agents/check_mk_agent.aix
index c42abe6..401b858 100755
--- a/agents/check_mk_agent.aix
+++ b/agents/check_mk_agent.aix
@@ -23,6 +23,10 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+# Remove locale settings to eliminate localized outputs where possible
+export LC_ALL=C
+unset LANG
+
export MK_LIBDIR="/to/be/changed"
export MK_CONFDIR="/to/be/changed"
@@ -66,6 +70,12 @@ fi
echo '<<<vmstat_aix>>>'
vmstat | tail -n1
+echo '<<<aix_diskiod>>>'
+iostat -d | tr -s ' ' | grep hdisk
+
+echo '<<<aix_memory>>>'
+vmstat -v | tr -s ' ' | cut -d " " -f 2
+
echo '<<<mpstat_aix>>>'
mpstat -a | tail -n1
diff --git a/checkman/aix_diskiod b/checkman/aix_diskiod
new file mode 100644
index 0000000..3615add
--- /dev/null
+++ b/checkman/aix_diskiod
@@ -0,0 +1,77 @@
+title: Throughput on AIX hard disks
+agents: aix
+catalog: os/storage
+license: GPL
+distribution: check_mk
+description:
+
+ This check measures the disk IO of hard disks on AIX. The agent provides this
+ information via the command {diskio -d}. This check is compatible with {diskstat},
+ but only supports throughput, no latency and queue lengths. Please read further
+ details in the man page of {diskstat}.
+
+item:
+ Either {"SUMMARY"} for a summarized check of alls LUNs or the
+ name of the disk device, e.g. {"hdisk15"}.
+
+examples:
+ # create one check for all disks
+ diskstat_inventory_mode = "summary"
+
+ # Set default levels for diskstat
+ diskstat_default_levels = {
+ "read" : (10, 20), # level for read MB/sec
+ "write" : (20, 40), # level for write MB/sec
+ "average" : 15, # averaging in minutes
+ }
+
+ # Alternative: just enable averaging over 10 minutes,
+ # do not apply levels:
+ diskstat_default_levels = {
+ "average" : 15
+ }
+
+ # Settings for certain hosts:
+ check_parameters += [
+ ( {"write" : (20, 50), "average" : 10 }, [ "oracle" ],
ALL_HOSTS, [ "Disk IO" ])
+ ]
+
+perfdata:
+ The disk throughput for read and write in bytes per second. If averaging
+ is turned on, then two additional values are sent: the averaged read and
+ write throughput.
+
+inventory:
+ The inventory is configured via {diskstat_inventory_mode}. If this is set
+ to {"single"} (the default), then one check will be created for each
+ disk. If it is set to {"summary"} then only one service per host will be
+ created that has at least one hard disk. If set to {"legacy"} then a
+ separate check for read and write will be created (deprecated).
+
+[parameters]
+"read": The levels to be applied to the read throughput. It this entry is
+ {None} or missing in the dictionary, then no levels are applied. This is
+ the defaut. The values are in MB per second. Setting {"read"} to {(20, 40)}
+ will warn if 20 MB/s is exceeded and make the check critical at 40 MB/s.
+ If averaging is turned on, then the levels are applied to the averaged
+ values!
+
+"write": The levels for the write throughput.
+
+"average": If this is not {None}, it will be interpreted as a time range
+ in minutes to do averaging over. Set this to {15} in order to have
+ the levels applied to a 15-minute average instead of the current
+ values (approx.). Turning the average on will also create two additional
+ performance values. Make sure that your graphing tool is setup to
+ a changing number of variables.
+
+[configuration]
+diskstat_defaul_levels(dict): The default parameter used for inventorized
+ checks. This is preset to the empty dictionary.
+ That means that no averaging is done and no
+ levels are applied.
+
+diskstat_inventory_mode(string): Either {"single"} for one service per disk
+ or {"summary"} for the throughput of all disks summed up in one service.
+ Also possible is {"legacy"} for the old style mode (see above). Default
+ is {"single"}.
diff --git a/checks/aix_diskiod b/checks/aix_diskiod
new file mode 100644
index 0000000..7a8d3e3
--- /dev/null
+++ b/checks/aix_diskiod
@@ -0,0 +1,69 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)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-
+# ails. 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.
+
+# <<<aix_diskiod>>>
+# hdisk3 0.9 237.0 9.1 1337054478 1628926522
+# hdisk5 0.9 237.1 8.8 1333731705 1633897629
+# hdisk7 0.9 256.2 10.1 1537047014 1669194644
+# hdisk6 0.9 236.6 9.1 1334163361 1626627852
+# hdisk2 0.9 237.6 9.1 1334458233 1639383130
+# hdisk9 0.8 239.4 9.3 1337740029 1658392394
+# hdisk8 0.9 238.3 8.9 1332262996 1649741796
+# hdisk4 0.9 237.4 8.8 1332426157 1638419364
+# hdisk13 0.5 238.1 8.3 394246756 2585031872
+# hdisk11 0.5 238.3 8.3 397601918 2584807275
+
+# Columns means:
+# 1. device
+# 2. % tm_act
+# 3. Kbps
+# 4. tps
+# 5. Kb_read -> Kilobytes read since system boot
+# 6. Kb_wrtn -> Kilobytes written since system boot
+
+def aix_diskiod_convert(info):
+ converted = []
+ for device, tm_act, kbps, tps, kb_read, kb_written in info:
+ converted.append((device, int(kb_read) * 1024, int(kb_written) * 1024))
+ return converted
+
+
+def inventory_aix_diskiod(info):
+ return inventory_diskstat_generic(aix_diskiod_convert(info))
+
+
+def check_aix_diskiod(item, params, info):
+ return check_diskstat_generic(item, params, time.time(), aix_diskiod_convert(info))
+
+check_info["aix_diskiod"] = {
+ 'check_function': check_aix_diskiod,
+ 'inventory_function': inventory_aix_diskiod,
+ 'service_description': 'Disk IO %s',
+ 'has_perfdata': True,
+ 'group': 'disk_io',
+ 'includes': [ "diskstat.include" ],
+}
+
diff --git a/pnp-templates/check_mk-aix_diskiod.php
b/pnp-templates/check_mk-aix_diskiod.php
new file mode 120000
index 0000000..8b45325
--- /dev/null
+++ b/pnp-templates/check_mk-aix_diskiod.php
@@ -0,0 +1 @@
+check_mk-diskstat.php
\ No newline at end of file
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 7cf2b33..74c4bf7 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -583,6 +583,7 @@ def perfometer_check_mk_diskstat(row, check_command, perf_data):
perfometers["check_mk-diskstat"] = perfometer_check_mk_diskstat
perfometers["check_mk-winperf_phydisk"] = perfometer_check_mk_diskstat
perfometers["check_mk-hpux_lunstats"] = perfometer_check_mk_diskstat
+perfometers["check_mk-aix_diskiod"] = perfometer_check_mk_diskstat
perfometers["check_mk-mysql.innodb_io"] = perfometer_check_mk_diskstat
perfometers["check_mk-esx_vsphere_counters.diskio"] =
perfometer_check_mk_diskstat
perfometers["check_mk-emcvnx_disks"] = perfometer_check_mk_diskstat