Module: check_mk
Branch: master
Commit: 72e4829691a1d570602c61541837397052d185ba
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=72e4829691a1d5…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Dec 14 13:08:58 2018 +0100
aws_ebs: Started
Change-Id: Ifaf8af578ac4d0cb7f913f5033c35b3f3ac398f4
---
checkman/aws_ebs | 12 ++++++++
checks/aws_ebs | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 97 insertions(+)
diff --git a/checkman/aws_ebs b/checkman/aws_ebs
new file mode 100644
index 0000000..44e8fdf
--- /dev/null
+++ b/checkman/aws_ebs
@@ -0,0 +1,12 @@
+title: AWS EBS Disk IO
+agents: aws
+catalog: cloud/aws
+license: GPL
+distribution: check_mk
+description:
+ This check monitors disk IO of AWS EBS.
+ To make this check work you have to configure the related
+ special agent {{Amazon Web Services (AWS)}}.
+
+inventory:
+ One service per volume is created.
diff --git a/checks/aws_ebs b/checks/aws_ebs
new file mode 100644
index 0000000..e0b2f84
--- /dev/null
+++ b/checks/aws_ebs
@@ -0,0 +1,85 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2018 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-
+# 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.
+
+
+def parse_aws_ebs(info):
+ return _extract_aws_metrics_by_labels([
+ "VolumeReadOps",
+ "VolumeWriteOps",
+ "VolumeReadBytes",
+ "VolumeWriteBytes",
+ "VolumeQueueLength",
+ "VolumeThroughputPercentage",
+ "VolumeConsumedReadWriteOps",
+ "VolumeTotalReadTime",
+ "VolumeTotalWriteTime",
+ "VolumeIdleTime",
+ "BurstBalance",
+ "IOPerformance",
+ ], parse_aws(info))
+
+
+# .--Disk IO-------------------------------------------------------------.
+# | ____ _ _ ___ ___ |
+# | | _ \(_)___| | __ |_ _/ _ \ |
+# | | | | | / __| |/ / | | | | | |
+# | | |_| | \__ \ < | | |_| | |
+# | |____/|_|___/_|\_\ |___\___/ |
+# | |
+# +----------------------------------------------------------------------+
+# | main check |
+# '----------------------------------------------------------------------'
+
+
+def check_aws_ebs(item, params, parsed):
+ now = time.time()
+ disks = {}
+ for disk_name, metrics in parsed.iteritems():
+ disks.setdefault(
+ disk_name, {
+ "read_ios": get_rate("aws_ebs_disk_io_read_ios.%s" %
item, now,
+ metrics['VolumeReadOps']),
+ "write_ios": get_rate("aws_ebs_disk_io_write_ios.%s"
% item, now,
+ metrics['VolumeWriteOps']),
+ "read_throughput":
get_rate("aws_ebs_disk_io_read_throughput.%s" % item, now,
+ metrics['VolumeReadBytes']),
+ "write_throughput":
get_rate("aws_ebs_disk_io_write_throughput.%s" % item, now,
+ metrics['VolumeWriteBytes']),
+ "queue_length":
get_rate("aws_ebs_disk_io_queue_len.%s" % item, now,
+ metrics['VolumeQueueLength']),
+ })
+ return check_diskstat_dict(item, params, disks)
+
+
+check_info['aws_ebs'] = {
+ 'parse_function': parse_aws_ebs,
+ 'inventory_function': discover(),
+ 'check_function': check_aws_ebs,
+ 'service_description': 'AWS/EBS Disk IO %s',
+ 'includes': ['diskstat.include', 'aws.include'],
+ 'group': 'diskstat',
+ 'has_perfdata': True,
+}