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 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="
Unknown -W parameter 'claim -token=MYTOKEN -rooms=MYROOM -url='

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?

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
-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
bash: curl: command not found

So, I installed curl, and now get this:

root@OpenWrt:~# bash <(curl -Ss
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/  OK  

 --- Running downloaded script to detect required packages... --- 
[/tmp/netdata-kickstart-IAmOOd]# /bin/bash /tmp/netdata-kickstart-IAmOOd/ 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

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.

 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  OK  

[/tmp/netdata-kickstart-PnlPCM]# curl -q -sSL --connect-timeout 10 --retry 3 --output /tmp/netdata-kickstart-PnlPCM/netdata-latest.tar.gz  OK  

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

/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  sha256sum.txt

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:

There's a pending pull request to update it, but it seems that we care about privacy. More details can be found here:

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.