Localized sending scripts added
Localized sending scripts added
This commit is contained in:
29
scripts/unix/etc/cai-watchdog/on-process-state-change
Normal file
29
scripts/unix/etc/cai-watchdog/on-process-state-change
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
APP_PATH=$(dirname "$0") # relative
|
||||
APP_PATH=$(cd "$APP_PATH" && pwd) # absolutized and normalized
|
||||
if [[ -z "$APP_PATH" ]] ; then
|
||||
# error; for some reason, the path is not accessible
|
||||
# to the script (e.g. permissions re-evaled after suid)
|
||||
APP_PATH="/etc/cai-watchdog"
|
||||
fi
|
||||
|
||||
##### DEFAULT PARAMS ORDER #####
|
||||
## $1 - <email>
|
||||
## $2 - <subject>
|
||||
## $3 - <message>
|
||||
## $4 - <service>
|
||||
## $5 - <process>
|
||||
## $6 - <status> [running | stopped]
|
||||
|
||||
EMAIL=$1
|
||||
SUBJECT=$2
|
||||
MESSAGE=$3
|
||||
SERVICE=$4
|
||||
PROCESS=$5
|
||||
STATUS=$6
|
||||
|
||||
## SAMPLE COMMANDS
|
||||
#${APP_PATH}/send-mail "${EMAIL}", "${SUBJECT}", "$MESSAGE"
|
||||
#${APP_PATH}/send-telegram-ru "${SERVICE}", "${PROCESS}", "$STATUS"
|
||||
|
||||
${APP_PATH}/send-telegram "$MESSAGE"
|
||||
Reference in New Issue
Block a user