sys_watchdog 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/sys_watchdog +35 -0
- data/lib/sys_watchdog/main.rb +1 -0
- data/lib/sys_watchdog/setup.rb +1 -1
- data/sys_watchdog.gemspec +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc0c376863ccf0446dfda65489e01d9836745006
|
4
|
+
data.tar.gz: 59ee3c4d2aaa20064e62c8cad10dedb2f78b0e62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02e258d8c79c3542e917524081bd5ca1aa421a672958c40a91ee55f39c9c171b6451b88a81d5e8c01023005a6af26411fd400dc04b249864e08771811113e578
|
7
|
+
data.tar.gz: f52a1504f1e18b05e13af9fb731a40fa84f5166af7fd9dfe84d903a3fc01a4b00efb2591d5b4889f55dbde6adf461dc78a6d2606e00a6261cdb81d3ffdc94cb6
|
data/bin/sys_watchdog
CHANGED
@@ -2,6 +2,29 @@
|
|
2
2
|
|
3
3
|
require 'sys_watchdog'
|
4
4
|
|
5
|
+
def red(mytext) ; "\e[31m#{mytext}\e[0m" ; end
|
6
|
+
|
7
|
+
def help_msg
|
8
|
+
<<~HEREDOC
|
9
|
+
sys_watchdog v#{SysWatchdog::VERSION}
|
10
|
+
|
11
|
+
Usage: sys_watchdog [setup|test|start|stop|once|uninstall|help|version]
|
12
|
+
|
13
|
+
When called without options executes the system tests each 60 seconds. This is the normal operation when working with a system daemon starter like systemd or upstart.
|
14
|
+
|
15
|
+
Options:
|
16
|
+
setup Create the configuration file, create the working directory and configure periodic run with systemd or cron.
|
17
|
+
test Similar to once, but also sets the log output to STDOUT.
|
18
|
+
start Start periodic run. If using systemd it will run 'systemctl start sys_watchdog'. If using cron it will enable/uncomment the cronjob line.
|
19
|
+
stop Stop periodic run.
|
20
|
+
once Run tests once and exit, rather than run each 60 seconds which is the normal behavior.
|
21
|
+
uninstall Deletes created files and services. After that, if you want to completlly uninstall, run 'gem uninstall sys_watchdog'.
|
22
|
+
-v, version Prints version and exit.
|
23
|
+
-h, help Prints the current message.
|
24
|
+
|
25
|
+
HEREDOC
|
26
|
+
end
|
27
|
+
|
5
28
|
setup_commands = %w(setup start stop uninstall)
|
6
29
|
|
7
30
|
case ARGV[0]
|
@@ -18,5 +41,17 @@ when 'once'
|
|
18
41
|
|
19
42
|
when nil
|
20
43
|
SysWatchdog.new.run
|
44
|
+
|
45
|
+
when 'version', '-v', '--version'
|
46
|
+
puts SysWatchdog::VERSION
|
47
|
+
|
48
|
+
when 'help', '-h'
|
49
|
+
puts help_msg
|
50
|
+
|
51
|
+
else
|
52
|
+
STDERR.puts red("Error: '#{ARGV[0]}' is not a valid option.")
|
53
|
+
puts ""
|
54
|
+
puts help_msg
|
55
|
+
|
21
56
|
end
|
22
57
|
|
data/lib/sys_watchdog/main.rb
CHANGED
data/lib/sys_watchdog/setup.rb
CHANGED
@@ -60,7 +60,7 @@ class Setup
|
|
60
60
|
puts "Installed.\n"
|
61
61
|
puts "Now:"
|
62
62
|
puts "1) Edit #{SysWatchdog::DEFAULT_CONF_FILE} to customize your system tests. You can run 'sys_watchdog test' to adjust your system tests and get a grasp of the sys_watchdog operation."
|
63
|
-
puts "2) After
|
63
|
+
puts "2) After configure your system tests run 'sys_watchdog start'."
|
64
64
|
end
|
65
65
|
|
66
66
|
def is_setup?
|
data/sys_watchdog.gemspec
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
$:.push File.expand_path("../lib", __FILE__)
|
2
|
+
require "sys_watchdog/version"
|
3
|
+
|
1
4
|
Gem::Specification.new do |s|
|
2
5
|
s.name = "sys_watchdog"
|
3
|
-
s.version =
|
6
|
+
s.version = SysWatchdog::VERSION.dup
|
4
7
|
s.authors = ["Tom Lobato"]
|
5
8
|
s.email = "lobato@bettercall.io"
|
6
9
|
s.homepage = "http://sys-watchdog.bettercall.io/"
|