Skip to content

Commit

Permalink
Added support for implicit FTPS and gem dependencies (#3)
Browse files Browse the repository at this point in the history
* Added support for implicit FTPS and gem dependencies

* changes per @eheydrick comments
  • Loading branch information
swibowo authored and eheydrick committed May 31, 2017
1 parent d4726fc commit a92cfc3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)

## [Unreleased]
### Added
- check-ftp.rb: added support for implicit FTPS. (@swibowo)

### Changed
- Define `net` and `double-bag-ftps` dependency (@swibowo)

## [1.0.0] - 2017-05-14
### Added
Expand Down
7 changes: 7 additions & 0 deletions bin/check-ftp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ class CheckFTP < Sensu::Plugin::Check::CLI
short: '-t SECS',
proc: proc(&:to_i),
default: 15
option :implicit_ftps,
short: '-i',
boolean: true,
default: false

def write_file
file = Tempfile.new("sensu_#{Time.now.to_i}.txt")
Expand Down Expand Up @@ -114,6 +118,9 @@ def ftps_login
ftps.ssl_context = DoubleBagFTPS.create_ssl_context(
verify_mode: verify
)
if config[:implicit_ftps]
ftps.ftps_mode = DoubleBagFTPS::IMPLICIT
end
ftps.connect(config[:host])
ftps
rescue => e
Expand Down
3 changes: 2 additions & 1 deletion sensu-plugins-ftp.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Gem::Specification.new do |s|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
s.version = SensuPluginsFtp::Version::VER_STRING

s.add_runtime_dependency 'sensu-plugin', '~> 1.2'
s.add_runtime_dependency 'sensu-plugin', '~> 1.2'
s.add_runtime_dependency 'double-bag-ftps', '~> 0.1.3'

s.add_development_dependency 'bundler', '~> 1.7'
s.add_development_dependency 'codeclimate-test-reporter', '~> 0.4'
Expand Down

0 comments on commit a92cfc3

Please sign in to comment.