sys_watchdog 0.1.13 → 0.1.14
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 +83 -0
- data/lib/sys_watchdog/version.rb +1 -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: e3c207d25bcb67e4f3beedf21aa40c3dc677ea3a
|
4
|
+
data.tar.gz: 31dd9d1fd51eefbbaaffbac3747438d3ae6585dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ac7c5479e4bc336d43c616562a88e31c1dd58c21529ed793f2ad68cba6fa995bfefa71582e666a850740eb8f38edbab6fd85eb269114ceaaa9a47ff0cbe99cf
|
7
|
+
data.tar.gz: 4dcce4e20ce40cf99891a73409c61c831d33baf8fef910b07d0c7a46b2715b2472247ac995adda73848a28e5aeea11fad392cf70a3036f3e4aaa17cc0b5771ea
|
data/README.md
CHANGED
@@ -59,9 +59,31 @@ or, if installed with cron, uncomment the cron job line:
|
|
59
59
|
|
60
60
|
```vim /etc/crontab```
|
61
61
|
|
62
|
+
## Command line Cli
|
63
|
+
|
64
|
+
```
|
65
|
+
# sys_watchdog help
|
66
|
+
sys_watchdog v0.1.13
|
67
|
+
|
68
|
+
Usage: sys_watchdog [setup|test|start|stop|once|uninstall|help|version]
|
69
|
+
|
70
|
+
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.
|
71
|
+
|
72
|
+
Options:
|
73
|
+
setup Create the configuration file, create the working directory and configure periodic run with systemd or cron.
|
74
|
+
test Similar to once, but also sets the log output to STDOUT.
|
75
|
+
start Start periodic run. If using systemd it will run 'systemctl start sys_watchdog'. If using cron it will enable/uncomment the cronjob line.
|
76
|
+
stop Stop periodic run.
|
77
|
+
once Run tests once and exit, rather than run each 60 seconds which is the normal behavior.
|
78
|
+
uninstall Deletes created files and services. After that, if you want to completlly uninstall, run 'gem uninstall sys_watchdog'.
|
79
|
+
-v, version Prints version and exit.
|
80
|
+
-h, help Prints the current message.
|
81
|
+
```
|
62
82
|
|
63
83
|
## Config Settings
|
64
84
|
|
85
|
+
```config:```section of ```/etc/sys_watchdog.yml```:
|
86
|
+
|
65
87
|
setting | description
|
66
88
|
-------------|-------------------------------------------------------------------------------------------------
|
67
89
|
name | -
|
@@ -75,6 +97,8 @@ mail_to | -
|
|
75
97
|
|
76
98
|
## Sys Test Settings
|
77
99
|
|
100
|
+
```tests:```section of ```/etc/sys_watchdog.yml```:
|
101
|
+
|
78
102
|
setting | description
|
79
103
|
------------------|-------------------------------------------------------------------------------------------
|
80
104
|
test_cmd | -
|
@@ -86,6 +110,65 @@ expected_string | -
|
|
86
110
|
expected_max | -
|
87
111
|
expected_min | -
|
88
112
|
|
113
|
+
## Sample /etc/sys_watchdog.yml
|
114
|
+
|
115
|
+
```yml
|
116
|
+
config:
|
117
|
+
name: My Website Server
|
118
|
+
server_name: main website # if not present, `hostname` will be used
|
119
|
+
|
120
|
+
# Send alerts to Slack (create your slack token in https://github.com/slack-ruby/slack-ruby-client#usage)
|
121
|
+
# slack_token: xoxb-...
|
122
|
+
# slack_channel: '#alerts'
|
123
|
+
|
124
|
+
# Send email alerts (via any smtp server: https://sendgrid.com, https://postmarkapp.com/ or your own)
|
125
|
+
# smtp_server: smtp.mysite.com
|
126
|
+
# smtp_domain: mysite.com
|
127
|
+
# mail_from: system@mysite.com
|
128
|
+
# mail_to:
|
129
|
+
# - myself@mysite.com
|
130
|
+
|
131
|
+
tests:
|
132
|
+
## General
|
133
|
+
boot_time:
|
134
|
+
notify_on_output_change: uptime -s
|
135
|
+
|
136
|
+
## URLs
|
137
|
+
site_status:
|
138
|
+
test_url: https://www.mysite.com
|
139
|
+
|
140
|
+
# helpdesk_status:
|
141
|
+
# test_url: https://helpdesk_status.mysite.com
|
142
|
+
|
143
|
+
## Disks
|
144
|
+
disk_root:
|
145
|
+
test_cmd: "df / | grep -v Filesystem | awk '{print $5}' | sed 's/%//'"
|
146
|
+
expected_max: 90
|
147
|
+
|
148
|
+
# disk_shared_storage:
|
149
|
+
# test_cmd: "df /var/www/site/shared | grep -v Filesystem | awk '{print $5}' | sed 's/%//'"
|
150
|
+
# expected_max: 90
|
151
|
+
|
152
|
+
## Mounts
|
153
|
+
# shared_storage:
|
154
|
+
# test_cmd: mount | grep /var/www/site/shared
|
155
|
+
|
156
|
+
## Services
|
157
|
+
# dns_server:
|
158
|
+
# test_cmd: host -t A www.mysite.com ns1.mydns.com | tail -1
|
159
|
+
# expected_regex: ^www.mysite.com has address
|
160
|
+
# restore_cmd: systemctl restart bind9
|
161
|
+
|
162
|
+
# redis_server:
|
163
|
+
# test_cmd: systemctl status redis-server
|
164
|
+
# expected_string: Active: active (running)
|
165
|
+
# restore_cmd: systemctl restart redis-server
|
166
|
+
|
167
|
+
## Processes
|
168
|
+
# worker_status:
|
169
|
+
# test_cmd: ps aux | grep 'sidekiq 4.2.10 site'
|
170
|
+
```
|
171
|
+
|
89
172
|
## Create a Slack Token
|
90
173
|
|
91
174
|
From https://github.com/slack-ruby/slack-ruby-client ...
|
data/lib/sys_watchdog/version.rb
CHANGED