Module: check_mk
Branch: master
Commit: 4669f0b44c2cd857fa5aaf2f69bf5f6e77649f9a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4669f0b44c2cd8…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Apr 4 10:07:14 2019 +0200
7362 FIX AWS/RDS services: Use DB identifier instead of DB name as item; DB name may be
missing or not set
You have to perform a re-discovery in order to create new items
and remove old items. Configured rules for these services must
also be adapted.
Change-Id: Ib2aba8a4e5181f76465a3b4bdb5d34f1258caf77
---
.werks/7362 | 13 +++++++++++++
checks/aws_rds | 6 +++---
checks/aws_rds_summary | 8 ++++----
3 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/.werks/7362 b/.werks/7362
new file mode 100644
index 0000000..6a37b29
--- /dev/null
+++ b/.werks/7362
@@ -0,0 +1,13 @@
+Title: AWS/RDS services: Use DB identifier instead of DB name as item; DB name may be
missing or not set
+Level: 1
+Component: checks
+Class: fix
+Compatible: incomp
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1554365041
+
+You have to perform a re-discovery in order to create new items
+and remove old items. Configured rules for these services must
+also be adapted.
diff --git a/checks/aws_rds b/checks/aws_rds
index 66194ce..3644373 100644
--- a/checks/aws_rds
+++ b/checks/aws_rds
@@ -57,7 +57,7 @@ def parse_aws_rds(info):
"AllocatedStorage",
],
parse_aws(info),
- extra_keys=['DBName']).itervalues():
+ extra_keys=['DBInstanceIdentifier']).itervalues():
for key, factor in [
('AllocatedStorage', 1.074e+9),
@@ -69,7 +69,7 @@ def parse_aws_rds(info):
metrics[key] *= factor
except KeyError:
pass
- parsed.setdefault(metrics['DBName'], metrics)
+ parsed.setdefault(metrics['DBInstanceIdentifier'], metrics)
return parsed
@@ -194,7 +194,7 @@ def check_aws_rds_network_io(item, params, metrics):
"",
"",
"",
- metrics.get('DBName', item),
+ metrics.get('DBInstanceIdentifier', item),
"",
]]
return check_if_common_single(item, params, interfaces)
diff --git a/checks/aws_rds_summary b/checks/aws_rds_summary
index a93b66c..2e3aec8 100644
--- a/checks/aws_rds_summary
+++ b/checks/aws_rds_summary
@@ -27,7 +27,7 @@
def parse_aws_rds_summary(info):
try:
- return {instance['DBName']: instance for instance in parse_aws(info)}
+ return {instance['DBInstanceIdentifier']: instance for instance in
parse_aws(info)}
except IndexError:
return {}
@@ -75,10 +75,10 @@ check_info['aws_rds_summary'] = {
@get_parsed_item_data
def check_aws_rds_summary_db(item, params, data):
- db_id = data['DBInstanceIdentifier']
+ db_name = data.get('DBName')
pre_info = ""
- if db_id is not None:
- pre_info = "[%s] " % db_id
+ if db_name is not None:
+ pre_info = "[%s] " % db_name
yield 0, '%sStatus: %s' % (pre_info, data['DBInstanceStatus'])
multi_az = data.get('MultiAZ')