-
Notifications
You must be signed in to change notification settings - Fork 6
/
internal-functions
35 lines (33 loc) · 1.24 KB
/
internal-functions
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
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
monit_help_content_func() {
declare desc="return monit plugin help content"
cat<<help_content
monit:enable <app>, Create a Monit configuration for this app and start monitoring
monit:disable <app>, Remove Monit configuration from this app
monit:status <app>, Show the apps Monit status
monit:statusall, Show Monit status for all apps
monit:monitor <app>, Enable monitoring for app with disabled monitoring
monit:monitorall, Enable monitoring all apps
monit:unmonitor <app>, Disable monitoring for app (but keep in Monit configuration)
monit:unmonitorall, Disable monitoring for all apps
monit:logs [-f], Show Monit logs, -f to follow
monit:config <app>, Show generated Monit configuration file for this app
help_content
}
monit_help_cmd() {
if [[ $1 = "monit:help" ]] ; then
echo -e 'Usage: dokku monit[:COMMAND]'
echo ''
echo 'Monitor and restart failing apps with Monit'
echo ''
echo 'Additional commands:'
monit_help_content_func | column -c2 -t -s,
elif [[ $(ps -o command= $PPID) == *"--all"* ]]; then
monit_help_content_func
else
cat<<help_desc
monit, Monitor and restart failing apps with Monit
help_desc
fi
}