Page 1 of 1

Monitoring RDS Instances

Posted: Wed Nov 29, 2023 11:34 pm
by KentBa
Hi

I am monitoring RDS Instances using this plugin https://manpages.org/pmp-check-aws-rdspy/7#description

Script can be found here https://github.com/percona/percona-moni ... aws-rds.py

It's working for all RDS instances except anything in the eu-west-3 region.

I am not so confident with Python and need some help.

Error message I am getting back is

Traceback (most recent call last):
File "/usr/local/nagios/libexec/./check_rds_baseline.py", line 404, in <module>
main()
File "/usr/local/nagios/libexec/./check_rds_baseline.py", line 232, in main
info = rds.get_list()
File "/usr/local/nagios/libexec/./check_rds_baseline.py", line 68, in get_list
result[reg] = rds.get_all_dbinstances()
AttributeError: 'NoneType' object has no attribute 'get_all_dbinstances'

Re: Monitoring RDS Instances

Posted: Thu Nov 30, 2023 11:39 am
by bbahn
Hello KentBa,

Have you renamed the script from pmp-check-aws-rdspy.py to check_rds_baseline.py?

If so, based on the following it looks like your connection failed, causing rds to be null since the connection failed:

Code: Select all

try:
    rds = boto.rds.connect_to_region(reg, profile_name=self.profile)
    result[reg] = rds.get_all_dbinstances()
You should check your AWS credentials for that region and ensure that your permissions are consistent. It's also possible that your connection to that region is poor or broken. You may also need to update your Boto library. You could try adding a print statement such as the following to the exception:

Code: Select all

except (boto.provider.ProfileNotFoundError, boto.exception.BotoServerError) as msg:
    print("Error connecting to region {}: {}".format(reg, msg))
    debug(msg)

Re: Monitoring RDS Instances

Posted: Thu Nov 30, 2023 4:10 pm
by KentBa
Thanks, yes I renamed the script.

AWS credentials are okay, the credentials are not region specific and do work for all other regions. I am also using the credentials for other Cloudwatch checks for this region in Nagios.

It's almost like the boto library doesnt' think eu-west-3 exists. I will try updating it.

Re: Monitoring RDS Instances

Posted: Thu Nov 30, 2023 4:17 pm
by KentBa
I am using

pip show boto3
Name: boto3
Version: 1.26.122

Re: Monitoring RDS Instances

Posted: Mon Dec 04, 2023 4:33 pm
by bbahn
Have you verified the integrity of the eu-west-3 server? If there is something wrong with the server or its configuration, that might explain why Boto is unable to connect to it.

Re: Monitoring RDS Instances

Posted: Thu Dec 14, 2023 8:58 pm
by KentBa
It's not just one server, it's all of them. Infact I can't even list any instances in the eu-west-3 region the -L parameter . The same thing happens for ap-southeast-3 or if I try to do it, and I get the same error when trying to list a region that doesn't exist.