Hi, I am familiar with some Linux distros as well as Unix. But I always skipped OSX (Mac).
Could anybody assist how to manage Netdata agent at MacOS?
I installed Netdata using brew. Then I tried to claim a node. First I realized that netdata-claim.sh does not exist at usual location, so I copied it from another linux server :
sudo ./netdata-claim.sh -token=TKN -room=RM -url=https://app.netdata.cloud
Unable to communicate with Netdata daemon, querying config from disk instead.
Token: ****************
Base URL: https://app.netdata.cloud
...
Connection attempt 1 successful
./netdata-claim.sh: line 404: /usr/sbin/netdatacli: No such file or directory
The claim was successful but the agent could not be notified (0)- it requires a restart to connect to the cloud.
Then I found a useful command to determine where Netdata files are located on Mac:
brew list netdata
...
/opt/homebrew/Cellar/netdata/1.29.3/homebrew.mxcl.netdata.plist
...
/opt/homebrew/Cellar/netdata/1.29.3/sbin/netdata
/opt/homebrew/Cellar/netdata/1.29.3/sbin/netdata-claim.sh
/opt/homebrew/Cellar/netdata/1.29.3/sbin/netdatacli
...
Next I wanted to unclaim the node (it appeared in cloud with unreacheable status) to repeat the claiming again. I removed the folder:
sudo rm -rf /var/lib/netdata/cloud.d
Somewhere I read how to restart macos service and tried the command:
sudo launchctl load -w /opt/homebrew/Cellar/netdata/1.29.3/homebrew.mxcl.netdata.plist
/opt/homebrew/Cellar/netdata/1.29.3/homebrew.mxcl.netdata.plist: Path had bad ownership/permissions
Load failed: 122: Path had bad ownership/permissions
sudo launchctl unload /opt/homebrew/Cellar/netdata/1.29.3/homebrew.mxcl.netdata.plist
/opt/homebrew/Cellar/netdata/1.29.3/homebrew.mxcl.netdata.plist: Could not find specified service
Unload failed: 113: Could not find specified service
# Command `sudo launchctl list | grep netdata` show nothing.
At the result I think I have Netdata agent installed but I don’t know how to manage the service. Please advise.
I chosen brew because of unfulfilled prerequisities of the script. First error pointed to missing openssl (which actually was installed at different folder). I modified netdata-installer.sh with:
/opt/homebrew/opt/openssl
# instead of
/usr/local/opt/openssl
Now I get a message that libuv is missed. But it is installed. I cannot fix it.
checking operating system... macos with id 3
...
checking for uv_fs_scandir_next in -luv... no
configure: error: libuv required but not found. Try installing 'libuv1-dev' or 'libuv-devel'.
FAILED
brew install libuv
...
Warning: libuv 1.41.0 is already installed and up-to-date.
To reinstall 1.41.0, run:
brew reinstall libuv
Just to clarify, the command to manage netdata service on M1 Mac is
brew services start | restart | stop netdata
So, I tried to reinstall it using brew:
brew install netdata
# To have launchd start netdata now and restart at login:
brew services start netdata
# Or, if you don't want/need a background service you can just run:
# /opt/homebrew/sbin/netdata -D
brew services restart netdata
==> Successfully started `netdata` (label: homebrew.mxcl.netdata)
The agent has been installed. Next I found the location of netdata-claim.sh
brew list netdata
...
/opt/homebrew/Cellar/netdata/1.29.3/sbin/netdata-claim.sh
Used the full path to the script I tried to claim the node:
sudo /opt/homebrew/Cellar/netdata/1.29.3/sbin/netdata-claim.sh -token=TKN -rooms=RM -url=https://app.netdata.cloud
This agent was built without the dependencies for Cloud and cannot be claimed
The message sais that agent from brew cannot be claimed, right?
Just to give an update to this, they are two distinct subjects.
Netdata support (including cloud) for Mac with M1 chips. This is a known compatibility issue that we have and working on a fix. The best estimation is that it’s not gonna come very soon though, needing at least 2-4 weeks from now.
Brew installation & cloud support. We are not actually maintaining the brew package (see here for more details). However it is as well something we can improve.
Hi Ivan! Kostas_Kaskavelis is spot on, we’re working on the support for M1 macs.
In the meantime, until we get proper support on our build system, if you’re feeling “hacky” can you try to build from a (somewhat latest) source using:
That’s strange… what I’ve noticed is that at line 458 of your pastebin, it doesn’t include in the LDFLAGS /opt/homebrew/lib/ so, then it fails to link it…
Can you please paste the output of brew config ? Thanks!!
Ok, next check, do you by any chance have any custom environmental variables, like $LIBRARY_PATH or $LD_LIBRARY_PATH ? (You can find out if you do e.g. echo $LIBRARY_PATH).
Hi Ivan! Perhaps sudo messes up with paths, can you please try without sudo? (That though will require to specify a local install path, i.e. /Users/xxxx/netdata).
Thank you for your patience! Your input here will help us streamline installation of netdata on macs!