watchmonkey_cli 1.13.0 → 1.14.0

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
2
  SHA256:
3
- metadata.gz: 5bb6a637e71a9a3483a2b7b7a7b6dab90469b786c313f742e174743560afaa1b
4
- data.tar.gz: 94c468d5e0fe0d8344c321584e78828ecf4b3a43872885b80eb30028eab5e15f
3
+ metadata.gz: eca45a77465ff32cc6166c9c97ae857e411a00020d274154278006d0a3c06cbc
4
+ data.tar.gz: 5468bb0a67d96d3533bdd643ba81555304b9951bee3aa0ef3a63815ad1b1dda2
5
5
  SHA512:
6
- metadata.gz: dce28700596ca2267765017a3ed23f862cd5cb36951e2d1371ed714cabb9c6d36a0550ad4835ffa1b24ed749a78f775a5c0123ab8d9f9799c1438f988d5f76b8
7
- data.tar.gz: dc9afb99c806398ab45cb89dbdb38f6ac30db97b58a63e2012fbe940f33e29009c52af90515ed3267d021532f2edfb997f3957a1af7360b44b26bca4663527cc
6
+ metadata.gz: ad691ffdc29b81ca2c07f5a483aea72bc4414932e558b41f0d97ac1be7a5f4664eff6f3c4d8b7d224c45f663c3bafe20c7c05699264c44a49a3585830276e2dd
7
+ data.tar.gz: ec9598dd812eb9da77bc53b9a12e3838b9f161e56a2f93af24188bab336532c0b4b61842aaa350eca27ec9b2461c3a6172dccdaeaba0473274df2449c264f46c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.13.0
1
+ 1.14.0
@@ -0,0 +1 @@
1
+ 7cf1f0f16532184d11682df569b8c78da903166820e5355275bda41b76519e3bf021d8713cbe916b55f6d8c739b2a9af21136fb3aa0e14126ab7533b74a37de2
@@ -33,6 +33,14 @@ module WatchmonkeyCli
33
33
  @max_retry = num
34
34
  end
35
35
 
36
+ def self.default_options
37
+ @default_options ||= {}
38
+ end
39
+
40
+ def self.default_options= val
41
+ @default_options = val
42
+ end
43
+
36
44
  module AppHelper
37
45
  def init_checkers!
38
46
  @checkers = {}
@@ -5,6 +5,7 @@ module WatchmonkeyCli
5
5
  self.maxrt = false
6
6
 
7
7
  def enqueue host, opts = {}
8
+ opts = {}.merge(self.class.default_options, opts)
8
9
  host = app.fetch_connection(:loopback, :local) if !host || host == :local
9
10
  host = app.fetch_connection(:ssh, host) if host.is_a?(Symbol)
10
11
  app.enqueue(self, host, opts)
@@ -4,7 +4,7 @@ module WatchmonkeyCli
4
4
  self.checker_name = "ftp_availability"
5
5
 
6
6
  def enqueue host, opts = {}
7
- opts = {}.merge(opts)
7
+ opts = {}.merge(self.class.default_options, opts)
8
8
  app.enqueue(self, host, opts)
9
9
  end
10
10
 
@@ -4,7 +4,11 @@ module WatchmonkeyCli
4
4
  self.checker_name = "mysql_replication"
5
5
 
6
6
  def enqueue host, opts = {}
7
- opts = { host: "127.0.0.1", user: "root", sbm_threshold: 60 }.merge(opts)
7
+ opts = {
8
+ host: "127.0.0.1",
9
+ user: "root",
10
+ sbm_threshold: 60,
11
+ }.merge(self.class.default_options, opts)
8
12
  host = app.fetch_connection(:loopback, :local) if !host || host == :local
9
13
  host = app.fetch_connection(:ssh, host) if host.is_a?(Symbol)
10
14
  app.enqueue(self, host, opts)
@@ -4,7 +4,11 @@ module WatchmonkeyCli
4
4
  self.checker_name = "ssl_expiration"
5
5
 
6
6
  def enqueue page, opts = {}
7
- opts = { threshold: 28.days, verify: true, timeout: 20 }.merge(opts)
7
+ opts = {
8
+ threshold: 28.days,
9
+ verify: true,
10
+ timeout: 20,
11
+ }.merge(self.class.default_options, opts)
8
12
  app.enqueue(self, page, opts)
9
13
  end
10
14
 
@@ -4,7 +4,10 @@ module WatchmonkeyCli
4
4
  self.checker_name = "tcp_port"
5
5
 
6
6
  def enqueue host, port, opts = {}
7
- opts = { message: "Port #{port} (TCP) is not reachable!", timeout: 2 }.merge(opts)
7
+ opts = {
8
+ message: "Port #{port} (TCP) is not reachable!",
9
+ timeout: 2
10
+ }.merge(self.class.default_options, opts)
8
11
  host = app.fetch_connection(:loopback, :local) if !host || host == :local
9
12
  host = app.fetch_connection(:ssh, host) if host.is_a?(Symbol)
10
13
  app.enqueue(self, host, port, opts)
@@ -4,7 +4,9 @@ module WatchmonkeyCli
4
4
  self.checker_name = "ts3_license"
5
5
 
6
6
  def enqueue host, file, opts = {}
7
- opts = { threshold: 1.months }.merge(opts)
7
+ opts = {
8
+ threshold: 1.month,
9
+ }.merge(self.class.default_options, opts)
8
10
  host = app.fetch_connection(:loopback, :local) if !host || host == :local
9
11
  host = app.fetch_connection(:ssh, host) if host.is_a?(Symbol)
10
12
  app.enqueue(self, host, file, opts)
@@ -4,7 +4,10 @@ module WatchmonkeyCli
4
4
  self.checker_name = "udp_port"
5
5
 
6
6
  def enqueue host, port, opts = {}
7
- opts = { message: "Port #{port} (UDP) is not reachable!", timeout: 2 }.merge(opts)
7
+ opts = {
8
+ message: "Port #{port} (UDP) is not reachable!",
9
+ timeout: 2,
10
+ }.merge(self.class.default_options, opts)
8
11
  host = app.fetch_connection(:loopback, :local) if !host || host == :local
9
12
  host = app.fetch_connection(:ssh, host) if host.is_a?(Symbol)
10
13
  app.enqueue(self, host, port, opts)
@@ -4,7 +4,9 @@ module WatchmonkeyCli
4
4
  self.checker_name = "unix_cpu_governor"
5
5
 
6
6
  def enqueue host, opts = {}
7
- opts = { expect: "performance" }.merge(opts)
7
+ opts = {
8
+ expect: "performance",
9
+ }.merge(self.class.default_options, opts)
8
10
  host = app.fetch_connection(:loopback, :local) if !host || host == :local
9
11
  host = app.fetch_connection(:ssh, host) if host.is_a?(Symbol)
10
12
  app.enqueue(self, host, opts)
@@ -5,7 +5,13 @@ module WatchmonkeyCli
5
5
 
6
6
  def enqueue host, opts = {}
7
7
  return if app.running? # we only ever want to run this once to spawn sub checkers
8
- opts = { unix_load: {}, unix_memory: {}, unix_df: {}, unix_mdadm: {}, unix_cpu_governor: {} }.merge(opts)
8
+ opts = {
9
+ unix_load: {},
10
+ unix_memory: {},
11
+ unix_df: {},
12
+ unix_mdadm: {},
13
+ unix_cpu_governor: {},
14
+ }.merge(self.class.default_options, opts)
9
15
 
10
16
  host = app.fetch_connection(:loopback, :local) if !host || host == :local
11
17
  host = app.fetch_connection(:ssh, host) if host.is_a?(Symbol)
@@ -4,7 +4,9 @@ module WatchmonkeyCli
4
4
  self.checker_name = "unix_df"
5
5
 
6
6
  def enqueue host, opts = {}
7
- opts = { min_percent: 25 }.merge(opts)
7
+ opts = {
8
+ min_percent: 25,
9
+ }.merge(self.class.default_options, opts)
8
10
  host = app.fetch_connection(:loopback, :local) if !host || host == :local
9
11
  host = app.fetch_connection(:ssh, host) if host.is_a?(Symbol)
10
12
  app.enqueue(self, host, opts)
@@ -4,7 +4,9 @@ module WatchmonkeyCli
4
4
  self.checker_name = "unix_file_exists"
5
5
 
6
6
  def enqueue host, file, opts = {}
7
- opts = { message: "File #{file} does not exist!" }.merge(opts)
7
+ opts = {
8
+ message: "File #{file} does not exist!",
9
+ }.merge(self.class.default_options, opts)
8
10
  host = app.fetch_connection(:loopback, :local) if !host || host == :local
9
11
  host = app.fetch_connection(:ssh, host) if host.is_a?(Symbol)
10
12
  app.enqueue(self, host, file, opts)
@@ -4,7 +4,9 @@ module WatchmonkeyCli
4
4
  self.checker_name = "unix_load"
5
5
 
6
6
  def enqueue host, opts = {}
7
- opts = { limits: [4, 2, 1.5] }.merge(opts)
7
+ opts = {
8
+ limits: [4, 2, 1.5],
9
+ }.merge(self.class.default_options, opts)
8
10
  host = app.fetch_connection(:loopback, :local) if !host || host == :local
9
11
  host = app.fetch_connection(:ssh, host) if host.is_a?(Symbol)
10
12
  app.enqueue(self, host, opts)
@@ -4,7 +4,9 @@ module WatchmonkeyCli
4
4
  self.checker_name = "unix_mdadm"
5
5
 
6
6
  def enqueue host, opts = {}
7
- opts = { log_checking: true }.merge(opts)
7
+ opts = {
8
+ log_checking: true,
9
+ }.merge(self.class.default_options, opts)
8
10
  host = app.fetch_connection(:loopback, :local) if !host || host == :local
9
11
  host = app.fetch_connection(:ssh, host) if host.is_a?(Symbol)
10
12
  app.enqueue(self, host, opts)
@@ -4,7 +4,9 @@ module WatchmonkeyCli
4
4
  self.checker_name = "unix_memory"
5
5
 
6
6
  def enqueue host, opts = {}
7
- opts = { min_percent: 25 }.merge(opts)
7
+ opts = {
8
+ min_percent: 25,
9
+ }.merge(self.class.default_options, opts)
8
10
  host = app.fetch_connection(:loopback, :local) if !host || host == :local
9
11
  host = app.fetch_connection(:ssh, host) if host.is_a?(Symbol)
10
12
  app.enqueue(self, host, opts)
@@ -29,7 +31,7 @@ module WatchmonkeyCli
29
31
  chunks = line.split(":").map(&:strip)
30
32
  r[chunks[0]] = chunks[1].to_i
31
33
  end
32
- r["free"] = ((r["MemFree"].to_i + r["Buffers"].to_i + r["Cached"].to_i) / r["MemTotal"].to_f * 100).round(2)
34
+ r["free"] = (r["MemAvailable"].to_i / r["MemTotal"].to_f * 100).round(2)
33
35
  end
34
36
  end
35
37
  end
@@ -1,4 +1,4 @@
1
1
  module WatchmonkeyCli
2
- VERSION = "1.13.0"
2
+ VERSION = "1.14.0"
3
3
  UPDATE_URL = "https://raw.githubusercontent.com/2called-chaos/watchmonkey_cli/master/VERSION"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watchmonkey_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Pachnit
@@ -70,6 +70,7 @@ files:
70
70
  - bin/watchmonkey
71
71
  - bin/watchmonkey.sh
72
72
  - checksums/watchmonkey_cli-1.12.1.gem.sha512
73
+ - checksums/watchmonkey_cli-1.13.0.gem.sha512
73
74
  - doc/checker_example.rb
74
75
  - doc/config_example.rb
75
76
  - lib/watchmonkey_cli.rb
@@ -122,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
123
  - !ruby/object:Gem::Version
123
124
  version: '0'
124
125
  requirements: []
125
- rubygems_version: 4.0.6
126
+ rubygems_version: 4.0.22
126
127
  specification_version: 4
127
128
  summary: Watchmonkey CLI - dead simple agentless monitoring via SSH, HTTP, FTP, etc.
128
129
  test_files: []