watchmonkey_cli 1.8.1 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0402993ee90f4420cf6ef881e75e54034745d0c9
4
- data.tar.gz: 31ef5cb4ab287f6d85b4a89dad0d9424df64389e
2
+ SHA256:
3
+ metadata.gz: f520c622c2fbd97082aae49885ac87d40fc3cbae0e78e123e16bdc951f6ab40d
4
+ data.tar.gz: a1fc9e07a10fbc66498ffb8716f5178eb60592dee2fa75d5e8742571e0efcc5b
5
5
  SHA512:
6
- metadata.gz: d1a53b66cd588368d4a71a3b4bfc465090dbdf7a3cbfa174d5b196593e1ab524a886de63dabb7893e2a1544846a83d04bd8f0beeeae88d80cc3a1f1a0032f5a7
7
- data.tar.gz: fea9197ddc193e83b746b4cd250ab42a89e183724e8a20944923e8db17cef2a892330ec6fc874bbc8564df4315a1f682704855eab37aa9d15ad1f3ed7d7fc32e
6
+ metadata.gz: e2465f14f285a3072b2c1ce88e4c35513cf7738b93f237f0b8c60cc8d9f0961ae02e70394484e8fd6da5b90a8d0e72445b861ef4d73927cdeeaa597d7c435152
7
+ data.tar.gz: 3e8be97c0ca8c54064ae93ce96ee3d646e93aae0e03a6b192141ef6fdf9ca24f3a648afe68e3260930186d5119db580f1c822fb1d246f026f68ecf5f6c36389f
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.8.1
1
+ 1.8.2
@@ -4,7 +4,7 @@ module WatchmonkeyCli
4
4
  self.checker_name = "ssl_expiration"
5
5
 
6
6
  def enqueue page, opts = {}
7
- opts = { threshold: 1.months }.merge(opts)
7
+ opts = { threshold: 1.months, verify: true }.merge(opts)
8
8
  app.enqueue(self, page, opts)
9
9
  end
10
10
 
@@ -12,7 +12,7 @@ module WatchmonkeyCli
12
12
  uri = URI.parse(page)
13
13
  http = Net::HTTP.new(uri.host, uri.port)
14
14
  http.use_ssl = true
15
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
15
+ http.verify_mode = opts[:verify] ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
16
16
  cert = nil
17
17
  http.start do |h|
18
18
  cert = h.peer_cert
@@ -25,7 +25,7 @@ module WatchmonkeyCli
25
25
  return if status == "chunks"
26
26
  result.error! "#{dev} seems broken (expected U+, got `#{status}')" if status !~ /\[U+\]/
27
27
  if opts[:log_checking] && progress && m = progress.match(/\[[=>\.]+\]\s+([^\s]+)\s+=\s+([^\s]+)\s+\(([^\/]+)\/([^\)]+)\)\s+finish=([^\s]+)\s+speed=([^\s]+)/i)
28
- info "#{dev} on is checking (status:#{m[1]}|done:#{m[2]}|eta:#{m[5]}|speed:#{m[6]}|blocks_done:#{m[3]}/#{m[4]})"
28
+ result.info "#{dev} is checking (status:#{m[1]}|done:#{m[2]}|eta:#{m[5]}|speed:#{m[6]}|blocks_done:#{m[3]}/#{m[4]})"
29
29
  end
30
30
  end
31
31
  end
@@ -31,11 +31,12 @@ module WatchmonkeyCli
31
31
  end
32
32
 
33
33
  # body
34
+ fixed_body = result.result.body.force_encoding("utf-8")
34
35
  if rx = opts[:body]
35
36
  if rx.is_a?(String)
36
- result.error! "body does not include `#{rx}'!" if !result.result.body.include?(rx)
37
+ result.error! "body does not include `#{rx}'!" if !fixed_body.include?(rx)
37
38
  elsif rx.is_a?(Regexp)
38
- result.error! "body does not match `#{rx}'!" if !result.result.body.match(rx)
39
+ result.error! "body does not match `#{rx}'!" if !fixed_body.match(rx)
39
40
  end
40
41
  end
41
42
 
@@ -1,4 +1,4 @@
1
1
  module WatchmonkeyCli
2
- VERSION = "1.8.1"
2
+ VERSION = "1.8.2"
3
3
  UPDATE_URL = "https://raw.githubusercontent.com/2called-chaos/watchmonkey_cli/master/VERSION"
4
4
  end
@@ -7,8 +7,9 @@ require "thread"
7
7
  require "monitor"
8
8
  require "optparse"
9
9
  require "open3"
10
+ require "shellwords"
10
11
  require "net/ftp"
11
- require 'net/https'
12
+ require "net/https"
12
13
 
13
14
  # 3rd party
14
15
  require "active_support"
@@ -16,7 +17,7 @@ require "active_support/core_ext"
16
17
  require "active_support/time_with_zone"
17
18
  begin ; require "pry" ; rescue LoadError ; end
18
19
  require "httparty"
19
- require 'net/ssh'
20
+ require "net/ssh"
20
21
 
21
22
  # lib
22
23
  require "watchmonkey_cli/version"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watchmonkey_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Pachnit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-05 00:00:00.000000000 Z
11
+ date: 2018-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  version: '0'
164
164
  requirements: []
165
165
  rubyforge_project:
166
- rubygems_version: 2.2.2
166
+ rubygems_version: 2.7.3
167
167
  signing_key:
168
168
  specification_version: 4
169
169
  summary: Watchmonkey CLI - dead simple agentless monitoring via SSH, HTTP, FTP, etc.