-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update check-elb-sum-requests.rb to AWS SDK v2 #297
Conversation
@boutetnico any chance you could show us the input and output before and after the change? Here is an example I am gonna review shortly but showing that its still functional even if only manual increases the confidence of accepting changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good, have a couple of questions and feedback. Keep up the good work your ruby skills seem just fine to me. I was also a sysadmin who learned to code.
CHANGELOG.md
Outdated
@@ -4,6 +4,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). | |||
This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md) | |||
|
|||
## [Unreleased] | |||
### Breaking Changes | |||
- `check-elb-sum-requests.rb` was updated to aws-sdk v2 and no longer take `aws_access_key` and `aws_secret_access_key` options. (@boutetnico) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd split these up into two entries but I can do that for you. Basically the removal of the CLI args are the breaking change aside from that upgrading to v2 should be backwards compatible and that should go under ### Changed
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -132,7 +121,6 @@ def check_sum_requests(elb) | |||
|
|||
@severities.each_key do |severity| | |||
threshold = config[:"#{severity}_over"] | |||
puts metric_value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this being removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this because it looks like a debug statement that was left and forgot. See example output:
$ ./check-elb-sum-requests.rb -a <key> -k <secret> -r eu-west-1
264.0
264.0
CheckELBSumRequests OK: <AWS::ELB::LoadBalancer name:my_alb>; ( within 60 seconds between 2018-10-28 07:55:37 +0000 to 2018-10-28 07:56:37 +0000)
bin/check-elb-sum-requests.rb
Outdated
else | ||
"#{elbs.size} load balancers total" | ||
end | ||
@message = "#{elbs.size} load balancers total" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are removing the check to be grammatically correct we should add a parenthesis around the plural form
balancer(s)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted, will change it, thanks.
@majormoses thank you for your review, I have updated my PR according to your feedback. Please have a look at examples in my first post. |
released: https://rubygems.org/gems/sensu-plugins-aws/versions/14.0.0 I had to manually release because we have clogged up travis by enabling https://dependabot.com to help us with a lot of the maintenance work involved in keeping this project working so I can spend more time adding features and fixing bugs. |
Disclosure: I'm not a Ruby programmer, I cannot run the test suite, please review my changes.
Pull Request Checklist
Issue related: #240
General
Update Changelog following the conventions laid out here
Update README with any necessary configuration snippets
Binstubs are created if needed
RuboCop passes
Existing tests pass
Purpose
Update to AWS SDK v2.
Known Compatibility Issues
This is a breaking change because it removes
aws_access_key
andaws_secret_access_key
options per #2.Examples
Before this PR
Check all ELB in a region having 1 LB
Check all ELB in a region having 1 LB with a warning status
Check all ELB in a region having 2 LB
Check all ELB in a region having 2 LB with a warning status
After this PR
Check all ELB in a region having 1 LB
Check all ELB in a region having 1 LB with a warning status
Check all ELB in a region having 2 LB
Check all ELB in a region having 2 LB with a warning status