From 6ab2d911d167e9a04f7841aa932b07d389f017c2 Mon Sep 17 00:00:00 2001 From: Peter Keel Date: Wed, 27 May 2020 12:24:56 +0200 Subject: [PATCH 1/2] pmp-check-aws-rds.py: fix for python3 --- nagios/bin/pmp-check-aws-rds.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nagios/bin/pmp-check-aws-rds.py b/nagios/bin/pmp-check-aws-rds.py index 57b7834..d4909e4 100755 --- a/nagios/bin/pmp-check-aws-rds.py +++ b/nagios/bin/pmp-check-aws-rds.py @@ -98,7 +98,7 @@ def debug(val): """Debugging output""" global options if options.debug: - print 'DEBUG: %s' % val + print('DEBUG: %s' % val) def main(): @@ -222,7 +222,7 @@ def main(): sys.exit() elif options.db_list: info = rds.get_list() - print 'List of all DB instances in %s region(s):' % (options.region,) + print('List of all DB instances in %s region(s):' % (options.region,)) pprint.pprint(info) sys.exit() elif not options.ident: @@ -233,7 +233,7 @@ def main(): if info: pprint.pprint(vars(info)) else: - print 'No DB instance "%s" found on your AWS account and %s region(s).' % (options.ident, options.region) + print('No DB instance "%s" found on your AWS account and %s region(s).' % (options.ident, options.region)) sys.exit() elif not options.metric or options.metric not in metrics.keys(): @@ -356,7 +356,7 @@ def main(): try: storage = db_classes[info.instance_class] except: - print 'Unknown DB instance class "%s"' % info.instance_class + print('Unknown DB instance class "%s"' % info.instance_class) sys.exit(CRITICAL) free = '%.2f' % (free / 1024 ** 3) @@ -382,12 +382,12 @@ def main(): # Final output if status != UNKNOWN and perf_data: - print '%s %s | %s' % (short_status[status], note, perf_data) + print('%s %s | %s' % (short_status[status], note, perf_data)) elif status == UNKNOWN and not options.forceunknown: - print '%s %s | null' % ('OK', note) + print('%s %s | null' % ('OK', note)) sys.exit(0) else: - print '%s %s' % (short_status[status], note) + print('%s %s' % (short_status[status], note)) sys.exit(status) From e11823b1bff6c8cac5e7ffb293d1f7976a56c123 Mon Sep 17 00:00:00 2001 From: Peter Keel Date: Thu, 28 May 2020 12:08:43 +0200 Subject: [PATCH 2/2] pmp-check-aws-rds.py: adsd t3 db instance types --- nagios/bin/pmp-check-aws-rds.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nagios/bin/pmp-check-aws-rds.py b/nagios/bin/pmp-check-aws-rds.py index d4909e4..39096c0 100755 --- a/nagios/bin/pmp-check-aws-rds.py +++ b/nagios/bin/pmp-check-aws-rds.py @@ -155,6 +155,12 @@ def main(): 'db.t2.large': 8, 'db.t2.xlarge': 16, 'db.t2.2xlarge': 32, + 'db.t3.micro': 1, + 'db.t3.small': 2, + 'db.t3.medium': 4, + 'db.t3.large': 8, + 'db.t3.xlarge': 16, + 'db.t3.2xlarge': 32, 'db.m3.medium': 3.75, 'db.m3.large': 7.5, 'db.m3.xlarge': 15,