This repository was archived by the owner on May 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwatchdog.yaml.sample
More file actions
66 lines (59 loc) · 2.04 KB
/
watchdog.yaml.sample
File metadata and controls
66 lines (59 loc) · 2.04 KB
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
# 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 : "{{opackHome}}/watchdog.logs"
HKhowLongAgoInMinutes: 10080 # keep logs for 7 days
setLogOff : true
logToConsole: false
logJobs : false
logArgs : false
unique :
pidFile : "{{opackHome}}/watchdog.pid"
killPrevious: true
checkStall :
everySeconds : 1
killAfterSeconds: 60
opacks :
- oJob-common
todo:
{{#each ports}}
- Watchdog for roJob {{this}}
{{/each}}
jobs:
{{#each ports}}
#-------------------------------
- name: Watchdog for roJob {{this}}
to :
- oJob WatchDog
args:
nameOfDog : Process roJob dog {{this}}
quiet : false
#jobToNotify : Barking to someone
{{#if ../win}}
cmdToStart : "start /b {{../openafHome}}openaf.bat -f {{../opackHome}}/roJobService.js -e \"LOG={{../opackHome}}/logs CDISC={{../cdisc}} PORT={{this}}\" 2>&1 > {{../opackHome}}/roJob_{{this}}.out"
{{else}}
cmdToStart : "nohup {{../openafHome}}openaf -f {{../opackHome}}/roJobService.js -e \"LOG={{../opackHome}}/logs CDISC={{../cdisc}} PORT={{this}}\" 2>&1 > {{../opackHome}}/roJob_{{this}}.out &"
{{/if}}
workDirStart: "{{../opackHome}}"
checks :
log :
folder : "{{../opackHome}}/logs"
fileRE : "log-{{this}}-.+\\.log"
histFile: "{{../opackHome}}/.watchdog.roJob.history.{{this}}" # where to keep track of what was previously saw on the log file
stringRE:
- java\.lang\.OutOfMemory
custom:
exec: |
try {
ow.loadFormat();
return ow.format.testPort("127.0.0.1", {{this}});
} catch(e) {
logErr("Error: " + String(e));
return false;
}
{{/each}}