Module: check_mk
Branch: master
Commit: 5112d456aaa860697d4ee2188e38aec16662788e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5112d456aaa860…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Dec 14 10:53:51 2018 +0100
6827 aws_s3_summary: New check which gives an overview over all AWS/S3 buckets
Change-Id: Icfc76d2d1b1a66a6f74878a18b08b04b87aee9c9
---
.werks/6827 | 10 ++++++++++
checkman/aws_s3_summary | 13 +++++++++++++
checks/aws_s3_summary | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 71 insertions(+)
diff --git a/.werks/6827 b/.werks/6827
new file mode 100644
index 0000000..8359594
--- /dev/null
+++ b/.werks/6827
@@ -0,0 +1,10 @@
+Title: aws_s3_summary: New check which gives an overview over all AWS/S3 buckets
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1544781208
+Class: feature
+
+
diff --git a/checkman/aws_s3_summary b/checkman/aws_s3_summary
new file mode 100644
index 0000000..88d4e3e
--- /dev/null
+++ b/checkman/aws_s3_summary
@@ -0,0 +1,13 @@
+title: AWS S3 Summary
+agents: aws
+catalog: applications
+license: GPL
+distribution: check_mk
+description:
+ This check monitors all AWS S3 buckets and reports
+ a summary of their states.
+ To make this check work you have to configure the related
+ special agent {{Amazon Web Services (AWS)}}.
+
+inventory:
+ One summary service is created.
diff --git a/checks/aws_s3_summary b/checks/aws_s3_summary
new file mode 100644
index 0000000..88e68fb
--- /dev/null
+++ b/checks/aws_s3_summary
@@ -0,0 +1,48 @@
+#!/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 inventory_aws_s3_summary(parsed):
+ if parsed:
+ return [(None, {})]
+
+
+def check_aws_s3_summary(item, params, parsed):
+ yield 0, 'Buckets: %s' % len(parsed)
+ long_output = []
+ for row in parsed:
+ long_output.append("Bucket: %s, Creation date: %s" %
(row['Name'], row['CreationDate']))
+ if long_output:
+ yield 0, '\n%s' % '\n'.join(long_output)
+
+
+check_info['aws_s3_summary'] = {
+ 'parse_function': parse_aws,
+ 'inventory_function': inventory_aws_s3_summary,
+ 'check_function': check_aws_s3_summary,
+ 'service_description': 'AWS/S3 Summary',
+ 'includes': ['aws.include'],
+}