Netdata: Difference between revisions

Sync changes from nixos.wiki and re-format to fit the MoS.
Tennox (talk | contribs)
update docs for claiming
Line 31: Line 31:
You may wish to aggregate multiple machines' Netdata information, in which case, you can subscribe to the Netdata Cloud service, or you can self-host [[Prometheus]] and [[Grafana]] as a self-hosted solution.
You may wish to aggregate multiple machines' Netdata information, in which case, you can subscribe to the Netdata Cloud service, or you can self-host [[Prometheus]] and [[Grafana]] as a self-hosted solution.


==== Adding node ====
==== Adding node to cloud ====
* Enable the Netdata service as described above.
* Enable the Netdata service as described above.
* override package to be built `withCloud`
* When adding a new node in the web interface, you get a token; copy that token to <code>/var/lib/netdata/cloud.d/token</code>.
* When adding a new node in the web interface, you get a token; copy that token to <code>/var/lib/netdata/cloud.d/token</code>.
* As root, run the <code>netdata-claim.sh</code> script.
* As root, run the <code>netdata-claim.sh</code> script.
{{Commands|# nix-shell -p netdata --run "netdata-claim.sh"}}
{{Commands|# nix-shell -p netdata --run "netdata-claim.sh"}}
====== Declare claim token ([https://search.nixos.org/options?show=services.netdata.claimTokenFile option docs]) ======
<syntaxhighlight lang="nixos">
services.netdata = {
  package = pkgs.netdata.override { withCloud = true; };
  claimTokenFile = config.sops.secrets.netdata-token.path; # mounted by sops-nix, in this example
};
</syntaxhighlight>


=== Streaming node setup ===
=== Streaming node setup ===