@cryptotaxi247 / netdata-1 / commits / 0a47bbdd6

Added support for claiming nodes as part of installation. (#10084)

* Added support for claiming nodes as part of installation. This adds four new options to the `netdata-installer.sh` script: * `--claim-token` * `--claim-rooms` * `--claim-uri` * `--claim-proxy` These directly correspond to the `-token`, `-rooms`, `-uri`, and `-proxy` options for the `netdata-claim.sh` script. They have the following associated logic: * If any are specified and the `--disable-cloud` option is also specified, we bail and tell the user to either enable the cloud or remove the claiming options. * If only some but not all of the token, rooms, and uri options are specified, we bail and tell the user that they must pass all three. * If all three of the token, rooms, and uri are specified, we invoke the `netdata-claim.sh` script for the install itself as one of the last steps in the installation process, using the values passed to these options. This allows users to directly claim the agent as part of the install, which is useful for automated installation scenarios. * Add missing space as suggested by @knatsakis * Properly handle installs in /. * Properly handle unprefixed installs. * Fix another spelling error in an option name. * Properly fix option naming. * Move claiming into kickstart script instead of netdata-installer. This makes us more future-proof. The required changes also fix some buggy behavior in the option parsing code in the kickstart scripts. * Fix checksums. * Sanely handle the daemon not running during the claiming process. * Silence incorrect shellcheck warning. * Simplify condition as suggested by @vkalintiris. * Clean up old changes that should not be here anymore. These are leftovers from an earlier revision, they are not actually needed. * Add ID generation logic to the claiming script. This lets it reliably claim nodes which have not yet had the daemon run. Also fixes a consistency issue in the claiming logic in the Docker entrypoint.

Austin S. Hemmelgarn committed Mar 8, 2021 at 08:12 UTC 0a47bbdd6f44bf56e309c96d718467ef931a0b4f
6 files changed +230 -102
claim/netdata-claim.sh.in
+35 -7
@@ -85,15 +85,22 @@ ERROR_MESSAGES[17]="Service Unavailable"
85
86 # Exit code: 18 - Agent unique id is not generated yet.
87
88 +NETDATA_RUNNING=1
89 +
90 get_config_value() {
91 conf_file="${1}"
92 section="${2}"
93 key_name="${3}"
92 - config_result=$(@sbindir_POST@/netdatacli 2>/dev/null read-config "$conf_file|$section|$key_name"; exit $?)
93 - # shellcheck disable=SC2181
94 - if [ "$?" != "0" ]; then
95 - echo >&2 "cli failed, assume netdata is not running and query the on-disk config"
96 - config_result=$(@sbindir_POST@/netdata 2>/dev/null -W get2 "$conf_file" "$section" "$key_name" unknown_default)
94 + if [ "${NETDATA_RUNNING}" -eq 1 ]; then
95 + config_result=$(@sbindir_POST@/netdatacli 2>/dev/null read-config "$conf_file|$section|$key_name"; exit $?)
96 + result="$?"
97 + if [ "${result}" -ne 0 ]; then
98 + echo >&2 "Unable to communicate with Netdata daemon, querying config from disk instead."
99 + NETDATA_RUNNING=0
100 + fi
101 + fi
102 + if [ "${NETDATA_RUNNING}" -eq 0 ]; then
103 + config_result=$(@sbindir_POST@/netdata 2>/dev/null -W get2 "$conf_file" "$section" "$key_name" unknown_default)
104 fi
105 echo "$config_result"
106 }
@@ -141,13 +148,33 @@ NETDATA_USER=$(get_config_value netdata global "run as user")
148 [ -z "$EUID" ] && EUID="$(id -u)"
149
150
151 +gen_id() {
152 + local id
153 +
154 + id="$(uuidgen)"
155 +
156 + if [ "${id}" = "8a795b0c-2311-11e6-8563-000c295076a6" ] || [ "${id}" = "4aed1458-1c3e-11e6-a53f-000c290fc8f5" ]; then
157 + gen_id
158 + else
159 + echo "${id}"
160 + fi
161 +}
162 +
163 # get the MACHINE_GUID by default
164 if [ -r "${MACHINE_GUID_FILE}" ]; then
165 ID="$(cat "${MACHINE_GUID_FILE}")"
166 MGUID=$ID
148 -else
149 - echo >&2 "netdata.public.unique.id is not generated yet or not readable. Please run agent at least once before attempting to claim. Agent generates this file on first startup. If the ID is generated already make sure you have rights to read it (Filename: ${MACHINE_GUID_FILE})."
167 +elif [ -f "${MACHINE_GUID_FILE}" ]; then
168 + echo >&2 "netdata.public.unique.id is not readable. Please make sure you have rights to read it (Filename: ${MACHINE_GUID_FILE})."
169 exit 18
170 +else
171 + if mkdir -p "${MACHINE_GUID_FILE%/*}" && /bin/echo -n "$(gen_id)" > "${MACHINE_GUID_FILE}"; then
172 + ID="$(cat "${MACHINE_GUID_FILE}")"
173 + MGUID=$ID
174 + else
175 + echo >&2 "Failed to write new machine GUID. Please make sure you have rights to write to ${MACHINE_GUID_FILE}."
176 + exit 18
177 + fi
178 fi
179
180 # get token from file
@@ -174,6 +201,7 @@ do
201 -noproxy) NOPROXY=yes ;;
202 -noreload) RELOAD=0 ;;
203 -user=*) NETDATA_USER=${arg:6} ;;
204 + -daemon-not-running) NETDATA_RUNNING=0 ;;
205 *) echo >&2 "Unknown argument ${arg}"
206 exit 1 ;;
207 esac
packaging/docker/run.sh
+1
@@ -25,6 +25,7 @@ if [ -n "${NETDATA_CLAIM_URL}" ] && [ -n "${NETDATA_CLAIM_TOKEN}" ] && [ ! -f /v
25 -url "${NETDATA_CLAIM_URL}" \
26 ${NETDATA_CLAIM_ROOMS:+-rooms "${NETDATA_CLAIM_ROOMS}"} \
27 ${NETDATA_CLAIM_PROXY:+-proxy "${NETDATA_CLAIM_PROXY}"}
28 + -daemon-not-running
29 fi
30
31 exec /usr/sbin/netdata -u "${DOCKER_USR}" -D -s /host -p "${NETDATA_LISTENER_PORT}" -W set web "web files group" root -W set web "web files owner" root "$@"
packaging/installer/kickstart-static64.sh
+85 -42
@@ -12,6 +12,10 @@
12 # --local-files Use a manually provided tarball for the installation
13 # --allow-duplicate-install do not bail if we detect a duplicate install
14 # --reinstall if an existing install would be updated, reinstall instead
15 +# --claim-token specify a token to use for claiming the newly installed instance
16 +# --claim-url specify a URL to use for claiming the newly installed isntance
17 +# --claim-rooms specify a list of rooms to claim the newly installed instance to
18 +# --claim-proxy specify a proxy to use while claiming the newly installed instance
19 #
20 # Environment options:
21 #
@@ -224,56 +228,81 @@ NETDATA_INSTALLER_OPTIONS=""
228 NETDATA_UPDATES="--auto-update"
229 RELEASE_CHANNEL="nightly"
230 while [ -n "${1}" ]; do
227 - if [ "${1}" = "--dont-wait" ] || [ "${1}" = "--non-interactive" ] || [ "${1}" = "--accept" ]; then
228 - opts="${opts} --accept"
229 - shift 1
230 - elif [ "${1}" = "--dont-start-it" ]; then
231 - NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS:+${NETDATA_INSTALLER_OPTIONS} }${1}"
232 - shift 1
233 - elif [ "${1}" = "--no-updates" ]; then
234 - NETDATA_UPDATES=""
235 - shift 1
236 - elif [ "${1}" = "--auto-update" ]; then
237 - true # This is the default behaviour, so ignore it.
238 - shift 1
239 - elif [ "${1}" = "--stable-channel" ]; then
240 - RELEASE_CHANNEL="stable"
241 - NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS:+${NETDATA_INSTALLER_OPTIONS} }${1}"
242 - shift 1
243 - elif [ "${1}" = "--disable-telemetry" ]; then
244 - NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS:+${NETDATA_INSTALLER_OPTIONS} }${1}"
245 - shift 1
246 - elif [ "${1}" = "--local-files" ]; then
247 - NETDATA_UPDATES="" # Disable autoupdates if using pre-downloaded files.
248 - shift 1
249 - if [ -z "${1}" ]; then
250 - fatal "Option --local-files requires extra information. The desired tarball full filename is needed"
251 - fi
231 + case "${1}" in
232 + "--dont-wait") opts="${opts} --accept" ;;
233 + "--non-interactive") opts="${opts} --accept" ;;
234 + "--accept") opts="${opts} --accept" ;;
235 + "--dont-start-it")
236 + NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS:+${NETDATA_INSTALLER_OPTIONS} }${1}"
237 + NETDATA_CLAIM_EXTRA="${NETDATA_CLAIM_EXTRA} -daemon-not-running"
238 + ;;
239 + "--no-updates") NETDATA_UPDATES="" ;;
240 + "--stable-channel")
241 + RELEASE_CHANNEL="stable"
242 + NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS:+${NETDATA_INSTALLER_OPTIONS} }${1}"
243 + ;;
244 + "--disable-telemetry") NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS:+${NETDATA_INSTALLER_OPTIONS} }${1}";;
245 + "--local-files")
246 + NETDATA_UPDATES="" # Disable autoupdates if using pre-downloaded files.
247 + if [ -z "${2}" ]; then
248 + fatal "Option --local-files requires extra information. The desired tarball full filename is needed"
249 + fi
250
253 - NETDATA_LOCAL_TARBALL_OVERRIDE="${1}"
254 - shift 1
255 - if [ -z "${1}" ]; then
256 - fatal "Option --local-files requires a pair of the tarball source and the checksum file"
257 - fi
251 + NETDATA_LOCAL_TARBALL_OVERRIDE="${2}"
252
259 - NETDATA_LOCAL_TARBALL_OVERRIDE_CHECKSUM="${1}"
260 - shift 1
261 - elif [ "${1}" = "--allow-duplicate-install" ]; then
262 - NETDATA_ALLOW_DUPLICATE_INSTALL=1
263 - shift 1
264 - elif [ "${1}" = "--reinstall" ]; then
265 - NETDATA_REINSTALL=1
266 - shift 1
267 - else
268 - echo >&2 "Unknown option '${1}' or invalid number of arguments. Please check the README for the available arguments of ${0} and try again"
269 - exit 1
270 - fi
253 + if [ -z "${3}" ]; then
254 + fatal "Option --local-files requires a pair of the tarball source and the checksum file"
255 + fi
256 +
257 + NETDATA_LOCAL_TARBALL_OVERRIDE_CHECKSUM="${3}"
258 + shift 2
259 + ;;
260 + "--allow-duplicate-install") NETDATA_ALLOW_DUPLICATE_INSTALL=1 ;;
261 + "--reinstall") NETDATA_REINSTALL=1 ;;
262 + "--claim-token")
263 + NETDATA_CLAIM_TOKEN="${2}"
264 + shift 1
265 + ;;
266 + "--claim-rooms")
267 + NETDATA_CLAIM_ROOMS="${2}"
268 + shift 1
269 + ;;
270 + "--claim-url")
271 + NETDATA_CLAIM_URL="${2}"
272 + shift 1
273 + ;;
274 + "--claim-proxy")
275 + NETDATA_CLAIM_EXTRA="${NETDATA_CLAIM_EXTRA} -proxy ${2}"
276 + shift 1
277 + ;;
278 + *)
279 + echo >&2 "Unknown option '${1}' or invalid number of arguments. Please check the README for the available arguments of ${0} and try again"
280 + exit 1
281 + esac
282 + shift 1
283 done
284
285 if [ ! "${DO_NOT_TRACK:-0}" -eq 0 ] || [ -n "$DO_NOT_TRACK" ]; then
286 NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS:+${NETDATA_INSTALLER_OPTIONS} }--disable-telemtry"
287 fi
288
289 +if [ -n "${NETDATA_DISABLE_CLOUD}" ]; then
290 + if [ -n "${NETDATA_CLAIM_TOKEN}" ] || [ -n "${NETDATA_CLAIM_ROOMS}" ] || [ -n "${NETDATA_CLAIM_URL}" ]; then
291 + run_failed "Cloud explicitly disabled but automatic claiming requested."
292 + run_failed "Either enable Netdata Cloud, or remove the --claim-* options."
293 + exit 1
294 + fi
295 +fi
296 +
297 +# shellcheck disable=SC2235,SC2030
298 +if ( [ -z "${NETDATA_CLAIM_TOKEN}" ] && [ -n "${NETDATA_CLAIM_URL}" ] ) || ( [ -n "${NETDATA_CLAIM_TOKEN}" ] && [ -z "${NETDATA_CLAIM_URL}" ] ); then
299 + run_failed "Invalid claiming options, both a claiming token and URL must be specified."
300 + exit 1
301 +elif [ -z "${NETDATA_CLAIM_TOKEN}" ] && [ -n "${NETDATA_CLAIM_ROOMS}" ]; then
302 + run_failed "Invalid claiming options, claim rooms may only be specified when a token and URL are specified."
303 + exit 1
304 +fi
305 +
306 # Netdata Tarball Base URL (defaults to our Google Storage Bucket)
307 [ -z "$NETDATA_TARBALL_BASEURL" ] && NETDATA_TARBALL_BASEURL=https://storage.googleapis.com/netdata-nightlies
308
@@ -365,4 +394,18 @@ if [ $? -eq 0 ]; then
394 fi
395 else
396 echo >&2 "NOTE: did not remove: ${TMPDIR}/netdata-latest.gz.run"
397 + exit 1
398 +fi
399 +
400 +# --------------------------------------------------------------------------------------------------------------------
401 +
402 +if [ -n "${NETDATA_CLAIM_TOKEN}" ]; then
403 + progress "Attempting to claim agent to ${NETDATA_CLAIM_URL}"
404 + NETDATA_CLAIM_PATH=/opt/netdata/bin/netdata-claim.sh
405 +
406 + if "${NETDATA_CLAIM_PATH}" -token=${NETDATA_CLAIM_TOKEN} -rooms=${NETDATA_CLAIM_ROOMS} -url=${NETDATA_CLAIM_URL} ${NETDATA_CLAIM_EXTRA}; then
407 + progress "Successfully claimed node"
408 + else
409 + run_failed "Unable to claim node, you must do so manually."
410 + fi
411 fi
packaging/installer/kickstart.sh
+107 -51
@@ -16,6 +16,10 @@
16 # --local-files set the full path of the desired tarball to run install with
17 # --allow-duplicate-install do not bail if we detect a duplicate install
18 # --reinstall if an existing install would be updated, reinstall instead
19 +# --claim-token specify a token to use for claiming the newly installed instance
20 +# --claim-url specify a URL to use for claiming the newly installed isntance
21 +# --claim-rooms specify a list of rooms to claim the newly installed instance to
22 +# --claim-proxy specify a proxy to use while claiming the newly installed instance
23 #
24 # Environment options:
25 #
@@ -317,66 +321,83 @@ NETDATA_INSTALLER_OPTIONS=""
321 NETDATA_UPDATES="--auto-update"
322 RELEASE_CHANNEL="nightly"
323 while [ -n "${1}" ]; do
320 - if [ "${1}" = "all" ]; then
321 - PACKAGES_INSTALLER_OPTIONS="netdata-all"
322 - shift 1
323 - elif [ "${1}" = "--dont-wait" ] || [ "${1}" = "--non-interactive" ]; then
324 - INTERACTIVE=0
325 - shift 1
326 - elif [ "${1}" = "--no-updates" ]; then
327 - # echo >&2 "netdata will not auto-update"
328 - NETDATA_UPDATES=
329 - shift 1
330 - elif [ "${1}" = "--stable-channel" ]; then
331 - RELEASE_CHANNEL="stable"
332 - NETDATA_INSTALLER_OPTIONS="$NETDATA_INSTALLER_OPTIONS --stable-channel"
333 - shift 1
334 - elif [ "${1}" = "--allow-duplicate-install" ]; then
335 - NETDATA_ALLOW_DUPLICATE_INSTALL=1
336 - shift 1
337 - elif [ "${1}" = "--reinstall" ]; then
338 - NETDATA_REINSTALL=1
339 - shift 1
340 - elif [ "${1}" = "--local-files" ]; then
341 - shift 1
342 - if [ -z "${1}" ]; then
343 - fatal "Missing netdata: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
344 - fi
324 + case "${1}" in
325 + "all") PACKAGES_INSTALLER_OPTIONS="netdata-all" ;;
326 + "--dont-wait") INTERACTIVE=0 ;;
327 + "--non-interactive") INTERACTIVE=0 ;;
328 + "--no-updates") NETDATA_UPDATES= ;;
329 + "--stable-channel")
330 + RELEASE_CHANNEL="stable"
331 + NETDATA_INSTALLER_OPTIONS="$NETDATA_INSTALLER_OPTIONS --stable-channel"
332 + ;;
333 + "--allow-duplicate-install") NETDATA_ALLOW_DUPLICATE_INSTALL=1 ;;
334 + "--reinstall") NETDATA_REINSTALL=1 ;;
335 + "--claim-token")
336 + NETDATA_CLAIM_TOKEN="${2}"
337 + shift 1
338 + ;;
339 + "--claim-rooms")
340 + NETDATA_CLAIM_ROOMS="${2}"
341 + shift 1
342 + ;;
343 + "--claim-url")
344 + NETDATA_CLAIM_URL="${2}"
345 + shift 1
346 + ;;
347 + "--claim-proxy")
348 + NETDATA_CLAIM_EXTRA="${NETDATA_CLAIM_EXTRA} -proxy ${2}"
349 + shift 1
350 + ;;
351 + "--dont-start-it")
352 + NETDATA_CLAIM_EXTRA="${NETDATA_CLAIM_EXTRA} -daemon-not-running"
353 + NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} --dont-start-it"
354 + ;;
355 + "--install")
356 + NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} --install ${2}"
357 + NETDATA_PREFIX="${2}"
358 + shift 1
359 + ;;
360 + "--disable-cloud")
361 + NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} --disable-cloud"
362 + NETDATA_DISABLE_CLOUD=1
363 + ;;
364 + "--local-files")
365 + if [ -z "${2}" ]; then
366 + fatal "Missing netdata: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
367 + fi
368
346 - export NETDATA_LOCAL_TARBALL_OVERRIDE="${1}"
347 - shift 1
369 + export NETDATA_LOCAL_TARBALL_OVERRIDE="${2}"
370
349 - if [ -z "${1}" ]; then
350 - fatal "Missing checksum file: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
351 - fi
371 + if [ -z "${3}" ]; then
372 + fatal "Missing checksum file: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
373 + fi
374
353 - export NETDATA_LOCAL_TARBALL_OVERRIDE_CHECKSUM="${1}"
354 - shift 1
375 + export NETDATA_LOCAL_TARBALL_OVERRIDE_CHECKSUM="${3}"
376
356 - if [ -z "${1}" ]; then
357 - fatal "Missing go.d tarball: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
358 - fi
377 + if [ -z "${4}" ]; then
378 + fatal "Missing go.d tarball: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
379 + fi
380
360 - export NETDATA_LOCAL_TARBALL_OVERRIDE_GO_PLUGIN="${1}"
361 - shift 1
381 + export NETDATA_LOCAL_TARBALL_OVERRIDE_GO_PLUGIN="${4}"
382
363 - if [ -z "${1}" ]; then
364 - fatal "Missing go.d config tarball: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
365 - fi
383 + if [ -z "${5}" ]; then
384 + fatal "Missing go.d config tarball: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
385 + fi
386
367 - export NETDATA_LOCAL_TARBALL_OVERRIDE_GO_PLUGIN_CONFIG="${1}"
368 - shift 1
387 + export NETDATA_LOCAL_TARBALL_OVERRIDE_GO_PLUGIN_CONFIG="${5}"
388
370 - if [ -z "${1}" ]; then
371 - fatal "Missing dependencies management scriptlet: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
372 - fi
389 + if [ -z "${6}" ]; then
390 + fatal "Missing dependencies management scriptlet: Option --local-files requires extra information. The desired tarball for netdata, the checksum, the go.d plugin tarball , the go.d plugin config tarball and the dependency management script, in this particular order"
391 + fi
392
374 - export NETDATA_LOCAL_TARBALL_OVERRIDE_DEPS_SCRIPT="${1}"
375 - shift 1
376 - else
377 - NETDATA_INSTALLER_OPTIONS="$NETDATA_INSTALLER_OPTIONS ${1}"
378 - shift 1
379 - fi
393 + export NETDATA_LOCAL_TARBALL_OVERRIDE_DEPS_SCRIPT="${6}"
394 + shift 5
395 + ;;
396 + *)
397 + NETDATA_INSTALLER_OPTIONS="${NETDATA_INSTALLER_OPTIONS} ${1}"
398 + ;;
399 + esac
400 + shift 1
401 done
402
403 if [ "${INTERACTIVE}" = "0" ]; then
@@ -384,6 +405,23 @@ if [ "${INTERACTIVE}" = "0" ]; then
405 NETDATA_INSTALLER_OPTIONS="$NETDATA_INSTALLER_OPTIONS --dont-wait"
406 fi
407
408 +if [ -n "${NETDATA_DISABLE_CLOUD}" ]; then
409 + if [ -n "${NETDATA_CLAIM_TOKEN}" ] || [ -n "${NETDATA_CLAIM_ROOMS}" ] || [ -n "${NETDATA_CLAIM_URL}" ]; then
410 + run_failed "Cloud explicitly disabled but automatic claiming requested."
411 + run_failed "Either enable Netdata Cloud, or remove the --claim-* options."
412 + exit 1
413 + fi
414 +fi
415 +
416 +# shellcheck disable=SC2235,SC2030
417 +if ( [ -z "${NETDATA_CLAIM_TOKEN}" ] && [ -n "${NETDATA_CLAIM_URL}" ] ) || ( [ -n "${NETDATA_CLAIM_TOKEN}" ] && [ -z "${NETDATA_CLAIM_URL}" ] ); then
418 + run_failed "Invalid claiming options, both a claiming token and URL must be specified."
419 + exit 1
420 +elif [ -z "${NETDATA_CLAIM_TOKEN}" ] && [ -n "${NETDATA_CLAIM_ROOMS}" ]; then
421 + run_failed "Invalid claiming options, claim rooms may only be specified when a token and URL are specified."
422 + exit 1
423 +fi
424 +
425 # ---------------------------------------------------------------------------------------------------------------------
426 # look for an existing install and try to update that instead if it exists
427
@@ -487,5 +525,23 @@ else
525 cd "$(find . -mindepth 1 -maxdepth 1 -type d)" && install "$@"
526 else
527 fatal "Cannot install netdata from source (the source directory does not include netdata-installer.sh). Leaving all files in ${ndtmpdir}"
528 + exit 1
529 + fi
530 +fi
531 +
532 +# --------------------------------------------------------------------------------------------------------------------
533 +
534 +if [ -n "${NETDATA_CLAIM_TOKEN}" ]; then
535 + progress "Attempting to claim agent to ${NETDATA_CLAIM_URL}"
536 + if [ -z "${NETDATA_PREFIX}" ] ; then
537 + NETDATA_CLAIM_PATH=/usr/sbin/netdata-claim.sh
538 + else
539 + NETDATA_CLAIM_PATH="${NETDATA_PREFIX}/bin/netdata-claim.sh"
540 + fi
541 +
542 + if "${NETDATA_CLAIM_PATH}" -token=${NETDATA_CLAIM_TOKEN} -rooms=${NETDATA_CLAIM_ROOMS} -url=${NETDATA_CLAIM_URL} ${NETDATA_CLAIM_EXTRA}; then
543 + progress "Successfully claimed node"
544 + else
545 + run_failed "Unable to claim node, you must do so manually."
546 fi
547 fi
packaging/installer/methods/kickstart-64.md
+1 -1
@@ -77,7 +77,7 @@ To use `md5sum` to verify the integrity of the `kickstart-static64.sh` script yo
77 command above, run the following:
78
79 ```bash
80 -[ "047c86a7c8905955bee39b6980a28e30" = "$(curl -Ss https://my-netdata.io/kickstart-static64.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
80 +[ "33ed36d80c7db0e501b68c4c0c3ceb02" = "$(curl -Ss https://my-netdata.io/kickstart-static64.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
81 ```
82
83 If the script is valid, this command will return `OK, VALID`.
packaging/installer/methods/kickstart.md
+1 -1
@@ -60,7 +60,7 @@ To use `md5sum` to verify the integrity of the `kickstart.sh` script you will do
60 run the following:
61
62 ```bash
63 -[ "8df7a45b2abb336c84507b7c107bcba3" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
63 +[ "35e92cd3fd8a29621e23962ac5626dfc" = "$(curl -Ss https://my-netdata.io/kickstart.sh | md5sum | cut -d ' ' -f 1)" ] && echo "OK, VALID" || echo "FAILED, INVALID"
64 ```
65
66 If the script is valid, this command will return `OK, VALID`.