bin/check-rds.rb in sensu-plugins-aws-18.4.1 vs bin/check-rds.rb in sensu-plugins-aws-18.4.2

- old
+ new

@@ -159,11 +159,11 @@ db end def find_db_cluster_writer(id) wr = rds.describe_db_clusters(db_cluster_identifier: id).db_clusters[0].db_cluster_members.detect(&:is_cluster_writer).db_instance_identifier - unknown 'DB cluster not found.' if cl.nil? + unknown 'DB cluster not found.' if wr.nil? wr end def cloud_watch_metric(metric_name, unit) cloud_watch.get_metric_statistics( @@ -319,10 +319,10 @@ end def run instances = [] if config[:db_cluster_id] - db_cluster_writer_id = find_db_cluster_writer(db_cluster_id) + db_cluster_writer_id = find_db_cluster_writer(config[:db_cluster_id]) instances << find_db_instance(db_cluster_writer_id) end if config[:db_instance_id].nil? || config[:db_instance_id].empty? rds.describe_db_instances[:db_instances].map { |db| instances << db }