File pmp-check-aws-rds-python3.patch of Package percona-monitoring-plugins
--- a/nagios/bin/pmp-check-aws-rds.py 2023-06-10 01:45:53.870322115 +0200
+++ b/nagios/bin/pmp-check-aws-rds.py 2023-06-10 01:58:33.103648836 +0200
@@ -98,7 +98,7 @@
"""Debugging output"""
global options
if options.debug:
- print 'DEBUG: %s' % val
+ print('DEBUG: %s' % val)
def main():
@@ -155,6 +155,12 @@
units = ('percent', 'GB')
# Parse options
+ 'db.t3.micro': 1,
+ 'db.t3.small': 2,
+ 'db.t3.medium': 4,
+ 'db.t3.large': 8,
+ 'db.t3.xlarge': 16,
+ 'db.t3.2xlarge': 32,
parser = optparse.OptionParser()
parser.add_option('-l', '--list', help='list of all DB instances',
action='store_true', default=False, dest='db_list')
@@ -193,7 +199,7 @@
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:
@@ -204,7 +210,7 @@
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():
@@ -327,7 +333,7 @@
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)
@@ -353,12 +359,12 @@
# 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)