Module: check_mk
Branch: master
Commit: 740030c1d83f4e156683c91a4cbee5ce5407b45c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=740030c1d83f4e…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Jan 9 16:08:35 2019 +0100
aws_s3: Minor improvements
Change-Id: I352079ee72d399bd86d99580eafb3144ed1d4bf3
---
checks/aws_s3 | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/checks/aws_s3 b/checks/aws_s3
index 3b81742..9381d6c 100644
--- a/checks/aws_s3
+++ b/checks/aws_s3
@@ -47,12 +47,15 @@ def check_aws_s3_summary(item, params, parsed):
buckets_by_region = {}
long_output = []
for bucket_name, row in parsed.iteritems():
- buckets_by_region.setdefault(row['LocationConstraint'], []).append(row)
+ region = row['LocationConstraint']
+ if not region:
+ region = "unknown"
+ buckets_by_region.setdefault(region, []).append(row)
long_output.append("Bucket: %s, Region: %s, Creation date: %s"\
- % (bucket_name, row['LocationConstraint'],
row['CreationDate']))
+ % (bucket_name, region, row['CreationDate']))
for region, buckets in buckets_by_region.iteritems():
- yield 0, "%s buckets in region %s" % (len(buckets), region)
+ yield 0, "%s: %s" % (region, len(buckets))
if long_output:
yield 0, '\n%s' % '\n'.join(long_output)
@@ -98,5 +101,5 @@ def check_aws_s3_objects(item, params, metrics):
check_info['aws_s3.objects'] = {
'inventory_function': discover(),
'check_function': check_aws_s3_objects,
- 'service_description': 'AWS/S3 %s Objects',
+ 'service_description': 'AWS/S3 Objects %s',
}