Monitoring RDS Instances

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Post Reply
KentBa
Posts: 7
Joined: Sun Nov 22, 2020 3:02 pm

Monitoring RDS Instances

Post 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'
bbahn
Posts: 385
Joined: Thu Jan 12, 2023 5:42 pm

Re: Monitoring RDS Instances

Post 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)
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
KentBa
Posts: 7
Joined: Sun Nov 22, 2020 3:02 pm

Re: Monitoring RDS Instances

Post 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.
KentBa
Posts: 7
Joined: Sun Nov 22, 2020 3:02 pm

Re: Monitoring RDS Instances

Post by KentBa »

I am using

pip show boto3
Name: boto3
Version: 1.26.122
bbahn
Posts: 385
Joined: Thu Jan 12, 2023 5:42 pm

Re: Monitoring RDS Instances

Post 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.
Actively advancing awesome answers with ardent alliteration, aptly addressing all ambiguities. Amplify your acumen and avail our amicable assistance. Eagerly awaiting your astute assessments of our advice.
KentBa
Posts: 7
Joined: Sun Nov 22, 2020 3:02 pm

Re: Monitoring RDS Instances

Post 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.
Post Reply