Module: check_mk
Branch: master
Commit: 8cf0d9907456bee9b6221e246ef7b1d4c2f6c0ef
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8cf0d9907456be…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Wed Nov 14 14:46:20 2018 +0100
6903 FIX mk_jolokia: CA default for https connection
The previous default value for "cert_path" in the mk_jolokia
plugin configuration led to a crash.
The new default is 'None' which means the server certificate is
ignored altogether.
Change-Id: I2446dd5a025cbff550d654a3264d66a8d4d52fd9
---
.werks/6903 | 16 ++++++++++++++++
agents/plugins/mk_jolokia | 2 +-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/6903 b/.werks/6903
new file mode 100644
index 0000000..61b34a1
--- /dev/null
+++ b/.werks/6903
@@ -0,0 +1,16 @@
+Title: mk_jolokia: CA default for https connection
+Level: 1
+Component: checks
+Class: fix
+Compatible: incomp
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1542121791
+
+The previous default value for "cert_path" in the mk_jolokia
+plugin configuration led to a crash.
+
+The new default is 'None' which means the server certificate is
+ignored altogether.
+
diff --git a/agents/plugins/mk_jolokia b/agents/plugins/mk_jolokia
index 8b95504..bd603e9 100755
--- a/agents/plugins/mk_jolokia
+++ b/agents/plugins/mk_jolokia
@@ -419,7 +419,7 @@ def yield_configured_instances():
mode = "digest"
suburi = "jolokia"
instance = None
- cert_path = "_default"
+ cert_path = None
client_cert = None
client_key = None
service_url = None
Module: check_mk
Branch: master
Commit: 8590981f343752948870a708b3f7041d36602767
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8590981f343752…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Nov 14 13:23:15 2018 +0100
Introduced special agent for monitoring Amazon Web Services
Change-Id: I4736dca691ae76988fcef52a4ab10c273a471350
---
agents/special/agent_aws | 72 +++++++++++++++++++++++++++++
checks/agent_aws | 39 ++++++++++++++++
cmk/gui/plugins/wato/datasource_programs.py | 46 ++++++++++++++++++
tests/unit/checks/test_agent_aws.py | 14 ++++++
4 files changed, 171 insertions(+)
diff --git a/agents/special/agent_aws b/agents/special/agent_aws
new file mode 100755
index 0000000..60a1e84
--- /dev/null
+++ b/agents/special/agent_aws
@@ -0,0 +1,72 @@
+#!/usr/bin/env 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.
+"""
+Special agent for monitoring Amazon web services (AWS) with Check_MK.
+"""
+
+import sys
+import argparse
+import boto3
+
+
+def parse_arguments(argv):
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--debug", action="store_true", help='''Raise Python exceptions.''')
+ parser.add_argument("--aws-access-key-id", help='''The access key for your AWS account.''')
+ parser.add_argument("--aws-secret-access-key", help='''The secret key for your AWS account.''')
+ parser.add_argument("--region", help='''The region to use.''')
+ return parser.parse_args(argv)
+
+
+def main():
+ args = parse_arguments(sys.argv[1:])
+
+ if not args.aws_access_key_id or not args.aws_secret_access_key or not args.region:
+ sys.stderr.write("Access key ID, secret access key and region must be set.\n")
+ return 1
+
+ s = boto3.session.Session(
+ aws_access_key_id=args.aws_access_key_id,
+ aws_secret_access_key=args.aws_secret_access_key,
+ region_name=args.region)
+
+ try:
+ _cloudwatch = s.client('cloudwatch')
+ except ValueError, err:
+ # If region name is not valid we get a ValueError
+ # but not in all cases, eg.:
+ # 1. 'eu-central-' raises a ValueError
+ # 2. 'foobar' does not raise a ValueError
+ # In the second case we get an exception raised by botocore
+ # during we execute an operation, eg. cloudwatch.get_metrics(**kwargs):
+ # - botocore.exceptions.EndpointConnectionError
+ sys.stderr.write("ERROR: %s\n" % err)
+ return 3
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/checks/agent_aws b/checks/agent_aws
new file mode 100644
index 0000000..f08a435
--- /dev/null
+++ b/checks/agent_aws
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 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 agent_aws_arguments(params, hostname, ipaddress):
+ return [
+ "--aws-access-key-id",
+ params["--aws-access-key-id"],
+ "--aws-secret-access-key",
+ passwordstore_get_cmdline("%s", params["--aws-secret-access-key"]),
+ "--region",
+ params["--region"],
+ ]
+
+
+special_agent_info['aws'] = agent_aws_arguments
diff --git a/cmk/gui/plugins/wato/datasource_programs.py b/cmk/gui/plugins/wato/datasource_programs.py
index 15ab062..e778235 100644
--- a/cmk/gui/plugins/wato/datasource_programs.py
+++ b/cmk/gui/plugins/wato/datasource_programs.py
@@ -1445,3 +1445,49 @@ register_rule(
help=_("This rule allows you to check multiple BI aggregations from multiple sites at once. "
"You can also assign aggregations to specific hosts through the piggyback mechanism."),
match='first')
+
+register_rule(
+ 'datasource_programs',
+ 'special_agents:aws',
+ Dictionary(
+ elements=[
+ ("--aws-access-key-id",
+ TextAscii(
+ title=_("The access key for your AWS account"),
+ allow_empty=False,
+ )),
+ ("--aws-secret-access-key",
+ IndividualOrStoredPassword(
+ title=_("The secret key for your AWS account"),
+ allow_empty=False,
+ )),
+ ("--region",
+ DropdownChoice(
+ title=_("The region to use"),
+ choices=sorted([
+ ("ap-south-1", _("Asia Pacific (Mumbai)")),
+ ("ap-northeast-3", _("Asia Pacific (Osaka-Local)")),
+ ("ap-northeast-2", _("Asia Pacific (Seoul)")),
+ ("ap-southeast-1", _("Asia Pacific (Singapore)")),
+ ("ap-southeast-2", _("Asia Pacific (Sydney)")),
+ ("ap-northeast-1", _("Asia Pacific (Tokyo)")),
+ ("ca-central-1", _("Canada (Central)")),
+ ("cn-north-1", _("China (Beijing)")),
+ ("cn-northwest-1", _("China (Ningxia)")),
+ ("eu-central-1", _("EU (Frankfurt)")),
+ ("eu-west-1", _("EU (Ireland)")),
+ ("eu-west-2", _("EU (London)")),
+ ("eu-west-3", _("EU (Paris)")),
+ ("sa-east-1", _("South America (Sao Paulo)")),
+ ("us-east-2", _("US East (Ohio)")),
+ ("us-east-1", _("US East (N. Virginia)")),
+ ("us-west-1", _("US West (N. California)")),
+ ("us-west-2", _("US West (Oregon)")),
+ ],
+ key=lambda x: x[1]),
+ )),
+ ],
+ optional_keys=[],
+ ),
+ title=_('Amazon Web Services (AWS)'),
+ match='first')
diff --git a/tests/unit/checks/test_agent_aws.py b/tests/unit/checks/test_agent_aws.py
new file mode 100644
index 0000000..bba4178
--- /dev/null
+++ b/tests/unit/checks/test_agent_aws.py
@@ -0,0 +1,14 @@
+import pytest
+
+
+(a)pytest.mark.parametrize("params,result", [
+ ({
+ "--aws-access-key-id": "user",
+ "--aws-secret-access-key": "d1ng",
+ "--region": 'region-eu',
+ }, ['--aws-access-key-id', 'user', '--aws-secret-access-key', 'd1ng', '--region', 'region-eu']),
+])
+def test_aws(check_manager, params, result):
+ agent = check_manager.get_special_agent("agent_aws")
+ arguments = agent.argument_func(params, "host", "address")
+ assert arguments == result
Module: check_mk
Branch: master
Commit: 5201eed184041179146d9a741abeee78aadca9fc
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5201eed1840411…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Wed Nov 14 13:22:17 2018 +0100
6636 FIX hr_fs: Fix discovery for VCenter appliances
Previously, due to a bogus type value provided by
these appliances via SNMP, the filesystem checks
would not be discovered. This has been fixed.
Change-Id: Id52210cde800571ee70f0b55bff66b46767123e5
---
.werks/6636 | 13 +++++++++++++
checks/hr_fs.include | 7 ++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.werks/6636 b/.werks/6636
new file mode 100644
index 0000000..83d5c1a
--- /dev/null
+++ b/.werks/6636
@@ -0,0 +1,13 @@
+Title: hr_fs: Fix discovery for VCenter appliances
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1542198055
+
+Previously, due to a bogus type value provided by
+these appliances via SNMP, the filesystem checks
+would not be discovered. This has been fixed.
diff --git a/checks/hr_fs.include b/checks/hr_fs.include
index bb56877..f1d0b22 100644
--- a/checks/hr_fs.include
+++ b/checks/hr_fs.include
@@ -53,7 +53,12 @@ def inventory_hr_fs(info):
mplist = []
for hrtype, hrdescr, _hrunits, hrsize, _hrused in info:
hrdescr = fix_hr_fs_mountpoint(hrdescr)
- if hrtype in [ ".1.3.6.1.2.1.25.2.1.4" ] and \
+ # NOTE: These types are defined in the HR-TYPES-MIB.
+ # .1.3.6.1.2.1.25.2.1 +
+ # +-> .4 "hrStorageFixedDisk"
+ if hrtype in [ ".1.3.6.1.2.1.25.2.1.4",
+ # This strange value below is needed for VCenter Appliances
+ ".1.3.6.1.2.1.25.2.3.1.2.4"] and \
hrdescr not in inventory_df_exclude_mountpoints and \
saveint(hrsize) != 0:
mplist.append(hrdescr)