This repository has been archived by the owner on Oct 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwatchdog.yaml
82 lines (74 loc) · 2.24 KB
/
watchdog.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Template : Quick watchdog to ensure processes are running
# Author : Nuno Aguiar
# How to run : ojob watchdog.yaml (in crontab every x minutes)
# oPack dependencies: latest ojob-common;
include:
- oJobWatchDog.yaml
ojob:
logToFile :
logFolder : /my/dir/watchdog.logs
HKhowLongAgoInMinutes: 10080 # keep logs for 7 days
setLogOff : true
logToConsole: false
logJobs : false
logArgs : false
unique :
pidFile : /my/dir/watchdog.pid
killPrevious: true
checkStall :
everySeconds : 1
killAfterSeconds: 60
todo:
- Watchdog for process A
#- Watchdog for process B
jobs:
- name: Watchdog for process A
to :
- oJob WatchDog
args:
nameOfDog : Process A dog
quiet : false
#jobToNotify : Barking to someone
cmdToStart : "/usr/bin/java -Xmx64m /my/processes/A/start.sh"
workDirStart: /my/processes/A
checks :
pid :
file : /my/processes/A/a.pid
log :
folder : /my/processes/A/log
fileRE : "A-.+\.log"
histFile: /my/dir/.watchdog.A.history # where to keep track of what was previously saw on the log file
stringRE:
- java\.lang\.OutOfMemory
custom:
exec: |
try {
// my custom code to check if A is working
return true;
} catch(e) {
logErr("Error: " + String(e));
return false;
}
#- name: Watchdog for process B
# to :
# - oJob WatchDog
# args:
# nameOfDog : Process B dog
# quiet : false
# #jobToNotify : Call someone
# cmdToStart : "/usr/bin/java -Xmx64m /my/processes/B/start.sh"
# workDirStart: /my/processes/B
#
# checks :
# pid :
# file : /my/processes/B/b.pid
#
# custom:
# exec: |
# try {
# // my custom code to check if B is working
# return true;
# } catch(e) {
# logErr("Error: " + String(e));
# return false;
# }