Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
monocloud-health: stop requiring ALARM_WEBHOOK_URL as ALARM_WEBHOOK_U…
Browse files Browse the repository at this point in the history
…RLS can also be used instead, only require REDMINE_URL and REDMINE_API_KEY if REDMINE_ENABLE=1
  • Loading branch information
kreatoo committed Jun 24, 2024
1 parent eef90de commit 30342dc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion monocloud/monocloud-health.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@ check_config_file() {
exit 1
}
. "$@"
local required_vars=(FILESYSTEMS PART_USE_LIMIT LOAD_LIMIT RAM_LIMIT ALARM_WEBHOOK_URL REDMINE_URL REDMINE_API_KEY)
local required_vars=(FILESYSTEMS PART_USE_LIMIT LOAD_LIMIT RAM_LIMIT)

if [[ -z "$ALARM_WEBHOOK_URL" ]] || [[ -z "$ALARM_WEBHOOK_URLS" ]]; then
echo "ALARM_WEBHOOK_URL nor ALARM_WEBHOOK_URLS is not set in \"$@\". exiting..."
fi

if [[ "$REDMINE_ENABLE" == "1" ]]; then
required_vars+=(REDMINE_URL REDMINE_API_KEY)
fi

for var in "${required_vars[@]}"; do
[[ -z "${!var}" ]] && {
echo "Variable \"$var\" is not set in \"$@\". exiting..."
Expand Down

0 comments on commit 30342dc

Please sign in to comment.