Module: check_mk
Branch: master
Commit: 06df86ec0181d602543797ed2b9bf4091ced1488
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=06df86ec0181d6…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Nov 28 14:20:49 2018 +0100
6819 aws_exceptions: New check which collects all exceptions during execution of AWS
special agent
Change-Id: I59c104ae3be3d991f2212e3fb50517783573edf5
---
.werks/6819 | 10 ++++++++++
checkman/aws_exceptions | 12 ++++++++++++
checks/aws_exceptions | 47 +++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 69 insertions(+)
diff --git a/.werks/6819 b/.werks/6819
new file mode 100644
index 0000000..1f5f21d
--- /dev/null
+++ b/.werks/6819
@@ -0,0 +1,10 @@
+Title: aws_exceptions: New check which collects all exceptions during execution of AWS
special agent
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1543411225
+Class: feature
+
+
diff --git a/checkman/aws_exceptions b/checkman/aws_exceptions
new file mode 100644
index 0000000..8107b94
--- /dev/null
+++ b/checkman/aws_exceptions
@@ -0,0 +1,12 @@
+title: AWS Exceptions
+agents: aws
+catalog: applications
+license: GPL
+distribution: check_mk
+description:
+ This check collects all exceptions during the execution of the
+ special agent {{agent_aws}} for monitoring Amazon Web Service.
+ If no exceptions occur the check is OK, otherwise CRIT.
+
+inventory:
+ One service is created.
diff --git a/checks/aws_exceptions b/checks/aws_exceptions
new file mode 100644
index 0000000..b2db9fb
--- /dev/null
+++ b/checks/aws_exceptions
@@ -0,0 +1,47 @@
+#!/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_exceptions(info):
+ if info:
+ return [(None, {})]
+
+
+def check_aws_exceptions(item, params, info):
+ for line in info:
+ joined_line = " ".join(line)
+ if joined_line == 'No exceptions':
+ state = 0
+ else:
+ state = 2
+ yield state, joined_line
+
+
+check_info['aws_exceptions'] = {
+ 'inventory_function': inventory_aws_exceptions,
+ 'check_function': check_aws_exceptions,
+ 'service_description': 'AWS Exceptions',
+}