sys_watchdog 0.1.6 → 0.1.7
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 +4 -4
- data/README.md +4 -3
- data/TODO +5 -1
- data/bin/sys_watchdog +2 -2
- data/lib/sys_watchdog/main.rb +6 -5
- data/lib/sys_watchdog/notify.rb +1 -1
- data/lib/sys_watchdog/setup.rb +5 -5
- data/sys_watchdog.gemspec +1 -1
- data/util/sys-watchdog.service +11 -0
- metadata +2 -2
- data/util/sys_watchdog.service +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63f809a622a062379d83d46e692ad7eaeaace9f5
|
4
|
+
data.tar.gz: 163db8efeb1271d866c59e5202dc43123028c71e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fca59fb5a74e5aa360d3d4fa954a94737083a5fe1240dcaa8861344e65baa8b2a0f85ccffc5f3e72ef870f8f0b9d828c18ef9d51f37a307fcb93ff40df1208c
|
7
|
+
data.tar.gz: 2db6802883e063bc72d94a8975d8d55cee7902c1f5e0eb032b7915c3a8a9079ff1d17f0ca4863cb4efaeb3a710edcda463e80f8fa4c914064ca37f90e39b4513
|
data/README.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
|
1
|
+
sys_watchdog
|
2
2
|
=================
|
3
3
|
|
4
4
|
[](https://badge.fury.io/rb/sys_watchdog)
|
5
5
|
[](https://codeclimate.com/github/tomlobato/sys_watchdog)
|
6
|
-
|
6
|
+

|
7
|
+
|
7
8
|
By [Bettercall.io](https://bettercall.io/).
|
8
9
|
|
9
|
-
|
10
|
+
sys_watchdog keeps your *NIX servers green by performing periodic checks and optionally actions like service restarts and notifications.
|
10
11
|
|
11
12
|
Take 20min to install and start to think what you\`ll make with your spare time ;)
|
12
13
|
|
data/TODO
CHANGED
@@ -19,4 +19,8 @@ flexibilize period, currently hardcoded to 60s
|
|
19
19
|
|
20
20
|
Lockfile for process
|
21
21
|
|
22
|
-
lock for sys tests
|
22
|
+
lock for sys tests
|
23
|
+
|
24
|
+
remove slack-ruby-client from Gemfile. If it is set in .yml and is not available, send a error to log with instructions to install.
|
25
|
+
|
26
|
+
adjusts dependencies verions
|
data/bin/sys_watchdog
CHANGED
@@ -5,10 +5,10 @@ require 'sys_watchdog'
|
|
5
5
|
case ARGV[0]
|
6
6
|
|
7
7
|
when 'setup_with_systemd'
|
8
|
-
Setup.new.
|
8
|
+
Setup.new.with_systemd
|
9
9
|
|
10
10
|
when 'setup_with_cron'
|
11
|
-
Setup.new.
|
11
|
+
Setup.new.with_cron
|
12
12
|
|
13
13
|
when 'test'
|
14
14
|
sw = SysWatchdog.new log_file: STDOUT
|
data/lib/sys_watchdog/main.rb
CHANGED
@@ -29,8 +29,9 @@ class SysWatchdog
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
if @conf.smtp_server
|
32
|
+
_conf = @conf
|
32
33
|
Mail.defaults do
|
33
|
-
delivery_method :smtp, address:
|
34
|
+
delivery_method :smtp, address: _conf.smtp_server, port: 587, :domain => _conf.smtp_domain,
|
34
35
|
:enable_starttls_auto => true, :openssl_verify_mode => 'none'
|
35
36
|
end
|
36
37
|
end
|
@@ -80,7 +81,7 @@ class SysWatchdog
|
|
80
81
|
test.restore
|
81
82
|
run_test test, after_restore: true
|
82
83
|
else
|
83
|
-
fail test,
|
84
|
+
fail test, output
|
84
85
|
end
|
85
86
|
end
|
86
87
|
rescue => e
|
@@ -94,9 +95,9 @@ class SysWatchdog
|
|
94
95
|
end
|
95
96
|
end
|
96
97
|
|
97
|
-
def fail test,
|
98
|
-
body = "
|
99
|
-
body += "
|
98
|
+
def fail test, output
|
99
|
+
body = ""
|
100
|
+
body += "output: #{output}" if output and not output.empty?
|
100
101
|
notify "#{test.name} fail", body
|
101
102
|
end
|
102
103
|
end
|
data/lib/sys_watchdog/notify.rb
CHANGED
data/lib/sys_watchdog/setup.rb
CHANGED
@@ -11,10 +11,10 @@ class Setup
|
|
11
11
|
puts "Installed."
|
12
12
|
|
13
13
|
puts "\nEdit #{SysWatchdog::DEFAULT_CONF_FILE} and start:"
|
14
|
-
puts "systemctl start
|
14
|
+
puts "systemctl start sys-watchdog"
|
15
15
|
|
16
16
|
puts "\nTo check daemon status:"
|
17
|
-
puts "systemctl status
|
17
|
+
puts "systemctl status sys-watchdog"
|
18
18
|
end
|
19
19
|
|
20
20
|
def with_cron
|
@@ -29,7 +29,7 @@ class Setup
|
|
29
29
|
private
|
30
30
|
|
31
31
|
def add_cron_line
|
32
|
-
run "echo '#* * * * * root sys_watchdog once' >> /etc/crontab"
|
32
|
+
run "echo '#* * * * * root /bin/bash -lc \'sys_watchdog once\' >> /etc/crontab"
|
33
33
|
end
|
34
34
|
|
35
35
|
def install_systemd_service
|
@@ -45,10 +45,10 @@ class Setup
|
|
45
45
|
exit 1
|
46
46
|
end
|
47
47
|
|
48
|
-
copy "#{@thisdir}/../../util/
|
48
|
+
copy "#{@thisdir}/../../util/sys-watchdog.service",
|
49
49
|
services_dir
|
50
50
|
|
51
|
-
run 'systemctl enable
|
51
|
+
run 'systemctl enable sys-watchdog'
|
52
52
|
end
|
53
53
|
|
54
54
|
def copy_sample_conf
|
data/sys_watchdog.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sys_watchdog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Lobato
|
@@ -68,7 +68,7 @@ files:
|
|
68
68
|
- sys_watchdog.gemspec
|
69
69
|
- test/sys_watchdog_test.yml
|
70
70
|
- test/test_sys_watchdog.rb
|
71
|
-
- util/
|
71
|
+
- util/sys-watchdog.service
|
72
72
|
- util/sys_watchdog_sample.yml
|
73
73
|
homepage: http://sys-watchdog.bettercall.io/
|
74
74
|
licenses:
|