-
Notifications
You must be signed in to change notification settings - Fork 6
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
Added metrics strongswan connection #8
Added metrics strongswan connection #8
Conversation
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.
Looks good! We'll merge this one along with your other PRs as we prep for the next release. Thank you again @yuri-zubov - these PRs are awesome 👍
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.
LGTM.
Just some minor grammatical fixups.
bin/metrics-strongswan-connection.rb
Outdated
def run | ||
ipsec_status = run_ipsec_listcounters | ||
|
||
founded = false |
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.
can we use found
?
bin/metrics-strongswan-connection.rb
Outdated
result = line.match(/(?<name>.*)\{.*(?<bytes_i>\d+)\ bytes_i.*\ (?<bytes_o>\d+)\ bytes_o/) | ||
next unless result | ||
|
||
founded = true |
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.
can we use found
?
bin/metrics-strongswan-connection.rb
Outdated
output "#{config[:scheme]}.#{result[:name]}.bytes_i", result[:bytes_i] | ||
output "#{config[:scheme]}.#{result[:name]}.bytes_o", result[:bytes_o] | ||
end | ||
if founded |
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.
can we use found
?
Any chance we could get a testing artifact? |
@majormoses, yes I will write a small test, please merge this #7 PR. |
#7 merged 👍 |
recheck again, please |
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 looks great, just a couple of minor things.
@@ -4,8 +4,6 @@ cache: | |||
install: | |||
- bundle install | |||
rvm: | |||
- 2.1 | |||
- 2.2 |
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.
hmm we normally keep support for all versions of !EOL?
versions per: https://github.com/sensu-plugins/documentation/blob/master/docs/FAQ.md#what-is-the-policy-on-supporting-end-of-lifeeol-ruby-versions
Per the ruby support dates: https://www.ruby-lang.org/en/downloads/branches/
Ruby 2.2
status: security maintenance
release date: 2014-12-25
EOL date: scheduled for 2018-03-31
In this case I am willing to make an exception because of the low volume this repo has had and it's close to an official EOL date. We will still version this as a major so that anyone who might be using this and pinning their gems will be unaffected until they are ready for it.
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.
@majormoses <<~ operator in heredoc is supported by ruby 2.3
CHANGELOG.md
Outdated
@@ -4,6 +4,9 @@ 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] | |||
- Added new metrics-strongswan-connection.rb plugin for getting connection metrics (@yuri-zubov) |
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.
Can you please put this under a ### Added
header?
CHANGELOG.md
Outdated
@@ -4,6 +4,9 @@ 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] | |||
- Added new metrics-strongswan-connection.rb plugin for getting connection metrics (@yuri-zubov) | |||
### Breaking Changes | |||
Dropping ruby `< 2.3` support (@yuri-zubov) |
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.
missing the -
to make it an item in an unordered list.
sensu-plugins-strongswan.gemspec
Outdated
@@ -39,6 +39,6 @@ Gem::Specification.new do |s| | |||
s.add_development_dependency 'rake', '~> 10.0' | |||
s.add_development_dependency 'redcarpet', '~> 3.2' | |||
s.add_development_dependency 'rspec', '~> 3.1' | |||
s.add_development_dependency 'rubocop', '~> 0.40.0' | |||
s.add_development_dependency 'rubocop', '~> 0.53' |
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.
test/fixtures.rb
Outdated
@@ -1,27 +1,56 @@ | |||
# rubocop:disable Layout/TrailingWhitespace |
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.
Hmm I don't believe a heredoc should trigger this I will double check on this though.
@majormoses fixed comments |
Pull Request Checklist
Is this in reference to an existing issue?
General
Update Changelog following the conventions laid out on here
Update README with any necessary configuration snippets
Binstubs are created if needed
RuboCop passes
Existing tests pass
New Plugins
Tests
Add the plugin to the README
Does it have a complete header as outlined here
Purpose
Known Compatibility Issues