How to claim agent on netdata?

I've installed the netdata package 1.19.0-1 on OpenWRT 19.07.3; however, after reading the instructions here for claiming an agent:

I found that the OpenWRT package doesn't include the netdata-claim.sh script. I also found that the "claim" argument to the netdata binary, as described here, is not recognized:

I get the following error, with my redacted command shown for reference:

# /usr/sbin/netdata -D -W "claim -token=MYTOKEN -rooms=MYROOM -url=https://app.netdata.cloud"
Unknown -W parameter 'claim -token=MYTOKEN -rooms=MYROOM -url=https://app.netdata.cloud'

Could anyone give me a pointer on what I'm doing wrong?

The package is significantly out of date. It also likely will not have the cloud dependencies required even if it was updated. Can you try running the Netdata install script instead? https://learn.netdata.cloud/docs/agent/packaging/installer#automatic-one-line-installation-script

1 Like

Hi Zack,

Thanks, and welcome to the board! I just tried running the script, and got this error:

root@OpenWrt:~# bash <(curl -Ss https://my-netdata.io/kickstart.sh)
-ash: syntax error: unexpected "("

I suspect this is because OpenWRT is running ash rather than bash, by default. I installed the bash package, and now get this error:

root@OpenWrt:~# bash <(curl -Ss https://my-netdata.io/kickstart.sh)
bash: curl: command not found

So, I installed curl, and now get this:

root@OpenWrt:~# bash <(curl -Ss https://my-netdata.io/kickstart.sh)
System            : Linux
Operating System  : GNU/Linux
Machine           : mips
BASH major version: 
 --- Fetching script to detect required packages... --- 
[/tmp/netdata-kickstart-IAmOOd]# curl -q -sSL --connect-timeout 10 --retry 3 --output /tmp/netdata-kickstart-IAmOOd/install-required-packages.sh https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/install-required-packages.sh  OK  

 --- Running downloaded script to detect required packages... --- 
[/tmp/netdata-kickstart-IAmOOd]# /bin/bash /tmp/netdata-kickstart-IAmOOd/install-required-packages.sh netdata Loading /etc/os-release ...
Unknown distribution ID: openwrt
Unknown distribution ID: lede
Unknown distribution ID: openwrt
Cannot find valid distribution in: openwrt lede openwrt
Cannot find valid distribution with lsb-release

I NEED YOUR HELP
It seems I cannot detect your system automatically.
And it seems I cannot find a known package manager in this system.
Please open a github issue to help us support your system too.
 FAILED  

 WARNING  It failed to install all the required packages, but installation might still be possible. 

Press ENTER to attempt netdata installation > 

I pressed enter, and finally we end here:

 --- OK, let's give it a try... --- 
[/tmp/netdata-kickstart-PnlPCM]# curl -q -sSL --connect-timeout 10 --retry 3 --output /tmp/netdata-kickstart-PnlPCM/sha256sum.txt https://storage.googleapis.com/netdata-nightlies/sha256sums.txt  OK  

[/tmp/netdata-kickstart-PnlPCM]# curl -q -sSL --connect-timeout 10 --retry 3 --output /tmp/netdata-kickstart-PnlPCM/netdata-latest.tar.gz https://storage.googleapis.com/netdata-nightlies/netdata-latest.tar.gz  OK  

[/tmp/netdata-kickstart-PnlPCM]# tar -xf netdata-latest.tar.gz tar: invalid tar magic
 FAILED  

/proc/self/fd/63: line 391: cd: netdata-*: No such file or directory
 ABORTED  Cannot cd to netdata source tree 

It appears that even though the script reported downloading that netdata-latest.tar.gz file ok, it actually did not, as it doesn't appear in the temp directory:

root@OpenWrt:~# cd /tmp/netdata-kickstart-PnlPCM/
root@OpenWrt:/tmp/netdata-kickstart-PnlPCM# ls
install-required-packages.sh  sha256sum.txt
root@OpenWrt:/tmp/netdata-kickstart-PnlPCM# 

Any thoughts?

When the script cannot figure out a known distro, it downloads its dependencies manually as well as Netdata and attempts to compile/install. The surprising part is that the curl download did not work - or potentially there was some issue with tar. I'm not too familiar with how well those two work on openwrt.
Can you open up an issue on Github? We may run into additional issues anyways.

As for my best guess, this may be the reason: https://unix.stackexchange.com/questions/249353/invalid-tar-magic-on-openwrt

There's a pending pull request to update it, but it seems that we care about privacy. More details can be found here: https://github.com/openwrt/packages/pull/12164#issuecomment-655981628

There are already all dependencies request for netdata, but you just need to use opkg update and then install all required packages. If you want to compile packages for OpenWrt, it is a better to cross-compile them.

Hello all,

We are now in 2022.
The netdata cloud node uses a new claiming link: https://learn.netdata.cloud/docs/agent/aclk

I use netdata from entware-ng (mostly based on the openwrt one).
The latest version available from opkg (1.30.1 at this time) does create the /opt/var/lib/netdata/cloud.d/ folder (tat is empty), and the netdata --help does list the option -W "claim -token=TOKEN -rooms=ROOM1,ROOM2"

However, the cloud feature is still intentionally disabled:

root@HERMES:/tmp/mnt/sda1/entware/var/lib/netdata/cloud.d$ netdata -W buildinfo
Version: netdata v1.30.1
Configure options:  '--target=arm-openwrt-linux' '--host=arm-openwrt-linux' '--build=x86_64-pc-linux-gnu' '--program-prefix=' '--program-suffix=' '--prefix=/opt' '--exec-prefix=/opt' '--bindir=/opt/bin' '--sbindir=/opt/sbin' '--libexecdir=/opt/lib' '--sysconfdir=/opt/etc' '--datadir=/opt/share' '--localstatedir=/opt/var' '--mandir=/opt/man' '--infodir=/opt/info' '--disable-nls' '--with-zlib' '--with-math' '--disable-x86-sse' '--enable-lto' '--disable-ebpf' '--without-libcap' '--disable-https' '--disable-dbengine' '--disable-plugin-nfacct' '--disable-plugin-freeipmi' '--disable-plugin-cups' '--disable-plugin-xenstat' '--disable-backend-prometheus-remote-write' '--disable-unit-tests' '--disable-cloud' 'build_alias=x86_64-pc-linux-gnu' 'host_alias=arm-openwrt-linux' 'target_alias=arm-openwrt-linux' 'CC=arm-openwrt-linux-gnueabi-gcc' 'CFLAGS=-pipe -mcpu=cortex-a15 -mfpu=neon-vfpv4 -funsafe-math-optimizations -mtune=cortex-a15 -fcommon -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffunction-sections -fdata-sections -O3 ' 'LDFLAGS=-Wl,--dynamic-linker=/opt/lib/ld-linux.so.3 -Wl,-rpath=/opt/lib -L/home/voxel/Entware/staging_dir/toolchain-arm_cortex-a15_gcc-9.4.0_glibc-2.27_eabi/lib -Wl,--gc-sections ' 'CPPFLAGS=-I/home/voxel/Entware/staging_dir/toolchain-arm_cortex-a15_gcc-9.4.0_glibc-2.27_eabi/include ' 'CXX=arm-openwrt-linux-gnueabi-g++' 'CXXFLAGS=-pipe -mcpu=cortex-a15 -mfpu=neon-vfpv4 -funsafe-math-optimizations -mtune=cortex-a15 -fcommon -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffunction-sections -fdata-sections -O3 ' 'PKG_CONFIG=/home/voxel/Entware/staging_dir/host/bin/pkg-config' 'PKG_CONFIG_PATH=/home/voxel/Entware/staging_dir/target-arm_cortex-a15_glibc-2.27_eabi/opt/lib/pkgconfig:/home/voxel/Entware/staging_dir/target-arm_cortex-a15_glibc-2.27_eabi/opt/share/pkgconfig' 'PKG_CONFIG_LIBDIR=/home/voxel/Entware/staging_dir/target-arm_cortex-a15_glibc-2.27_eabi/opt/lib/pkgconfig:/home/voxel/Entware/staging_dir/target-arm_cortex-a15_glibc-2.27_eabi/opt/share/pkgconfig'
Features:
    dbengine:                NO
    Native HTTPS:            NO
    Netdata Cloud:           NO (by user request)
    TLS Host Verification:   YES
Libraries:
    jemalloc:                NO
    JSON-C:                  YES
    libcap:                  NO
    libcrypto:               YES
    libm:                    YES
    LWS:                     YES shared-lib
    mosquitto:               YES
    tcalloc:                 NO
    zlib:                    YES
Plugins:
    apps:                    YES
    cgroup Network Tracking: YES
    CUPS:                    NO
    EBPF:                    NO
    IPMI:                    NO
    NFACCT:                  NO
    perf:                    YES
    slabinfo:                YES
    Xen:                     NO
    Xen VBD Error Tracking:  NO
Exporters:
    AWS Kinesis:             NO
    GCP PubSub:              NO
    MongoDB:                 NO
    Prometheus Remote Write: NO

Any chance to have this working now that the ACKL is simpler ans requires less dependencies?
By default, it could be turn off in the netdata.conf, but enabling the cloud would allow users to turn it on if they wish.

Thank you

Because, we are in 2022, we learned to use copy&paste, right? :slight_smile:
Your post is exactly same as on GitHub, where you can see my response:

There are no arguments to enable it except "we are in 2022".

Arguments are: now enabling the cloud feature does not depend on mosquito and as many other dependencies with their new ACKL system, I understood that was the reason why it was not activated in the openwrt distribution.

Why not let the users have a choice instead of forcing them to not be able to enable it even if they want?

What would be the security issue of enabling cloud ability, but turn it off by default in the default netdata.conf?