mirror of
https://github.com/netdata/netdata.git
synced 2025-04-28 06:32:30 +00:00
alarm-notify.sh should respect the cloud base url setting (#6383)
Fixes #5791 This patch exports through netdata daemon as an environment variable the NETDATA_REGISTRY_CLOUD_BASE_URL in order for the alarm-notify.sh.in to be able to use it. Therefore we can skip the hardcoded reference to cloud URL inside the script.
This commit is contained in:
parent
9d41bd6ff2
commit
1f51a65328
2 changed files with 3 additions and 1 deletions
|
@ -189,6 +189,7 @@ fi
|
|||
[ -z "${NETDATA_STOCK_CONFIG_DIR}" ] && NETDATA_STOCK_CONFIG_DIR="@libconfigdir_POST@"
|
||||
[ -z "${NETDATA_CACHE_DIR}" ] && NETDATA_CACHE_DIR="@cachedir_POST@"
|
||||
[ -z "${NETDATA_REGISTRY_URL}" ] && NETDATA_REGISTRY_URL="https://registry.my-netdata.io"
|
||||
[ -z "${NETDATA_REGISTRY_CLOUD_BASE_URL}" ] && NETDATA_REGISTRY_CLOUD_BASE_URL="https://netdata.cloud"
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# parse command line parameters
|
||||
|
@ -1798,7 +1799,7 @@ fi
|
|||
if [ ${GOTOCLOUD} -eq 0 ]; then
|
||||
goto_url="${NETDATA_REGISTRY_URL}/goto-host-from-alarm.html?${redirect_params}"
|
||||
else
|
||||
goto_url="https://netdata.cloud/alarms/redirect?agentID=${NETDATA_REGISTRY_UNIQUE_ID}&${redirect_params}"
|
||||
goto_url="${NETDATA_REGISTRY_CLOUD_BASE_URL}/alarms/redirect?agentID=${NETDATA_REGISTRY_UNIQUE_ID}&${redirect_params}"
|
||||
fi
|
||||
|
||||
# the severity of the alarm
|
||||
|
|
|
@ -43,6 +43,7 @@ int registry_init(void) {
|
|||
// netdata.cloud configuration, if cloud_base_url == "", cloud functionality is disabled.
|
||||
registry.cloud_base_url = config_get(CONFIG_SECTION_CLOUD, "cloud base url", "https://netdata.cloud");
|
||||
|
||||
setenv("NETDATA_REGISTRY_CLOUD_BASE_URL", registry.cloud_base_url, 1);
|
||||
setenv("NETDATA_REGISTRY_HOSTNAME", registry.hostname, 1);
|
||||
setenv("NETDATA_REGISTRY_URL", registry.registry_to_announce, 1);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue