sys_watchdog 0.1.11 → 0.1.12

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
  SHA1:
3
- metadata.gz: e7b7e1e1d574fc8ddce4a7b88a561c53fccf2f3d
4
- data.tar.gz: 48e6b688a786706ece312a9f75a19d38e843809a
3
+ metadata.gz: cc0c376863ccf0446dfda65489e01d9836745006
4
+ data.tar.gz: 59ee3c4d2aaa20064e62c8cad10dedb2f78b0e62
5
5
  SHA512:
6
- metadata.gz: 38bedbaa79dee3cde0b1b6acfafbb1ed0ea93a183d722872bbfc8c3269f869acbc37b47868f3fbd5bca8bc4d8e7174592078eaf83bb7de9a2bff62bc94c80088
7
- data.tar.gz: ce961fddde671826911edea3e1330580bc29d0ea2f26e6a3fbbfedfbbf90ee15915ec0cda7aad75a594e2c348fcac0da9efb438f3c336e9e7e479574a9849495
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
 
@@ -1,4 +1,5 @@
1
1
  class SysWatchdog
2
+ VERSION = '0.1.11'
2
3
  DEFAULT_CONF_FILE = '/etc/sys_watchdog.yml'
3
4
  DEFAULT_LOG_FILE = '/var/log/sys_watchdog.log'
4
5
  WORKING_DIR = '/var/local/sys_watchdog'
@@ -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 have your system tests configured run 'sys_watchdog start'"
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 = "0.1.11"
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/"
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.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Lobato