Netdata: Difference between revisions

imported>Hurricanehrndz
mNo edit summary
imported>RaitoBezarius
explain how to do streaming node setups
Line 9: Line 9:
*As root run <code>nix-shell -p netdata --run "netdata-claim.sh"</code>
*As root run <code>nix-shell -p netdata --run "netdata-claim.sh"</code>


== Streaming node setup ==
Ensure you choose appropriate access control for your nodes.
=== Receiver node ===
<pre>
  services.netdata.configDir."stream.conf" =
    let
        mkChildNode = apiKey: allowFrom: ''
          [${apiKey}]
            enabled = yes
            default history = <a value of your choice>
            default memory mode = dbengine # a good default
            health enabled by default = auto
            allow from = ${allowFrom}
        '';
      in pkgs.writeText "stream.conf" ''
        [stream]
          # This won't stream by itself, except if the receiver is a sender too, which is possible in netdata model.
          enabled = no
          enable compression = yes
        # An allowed sender node
        ${mkChildNode "an API key" "an allowed IP"}
      '';
</pre>
=== Sender node ===
<pre>
  services.netdata.configDir."stream.conf" = pkgs.writeText "stream.conf" ''
      [stream]
        enabled = yes
        destination = receiver-hostname-or-ip-address:19999
        api key = any string that is set also on the receiver side
    '';
</pre>
If you don't need any web UI and want to consume minimal resources on the sender node, use:
<pre>
  services.netdata = {
    config = {
      global = { "memory mode" = "none"; };
      web = {
        mode = "none";
        "accept a streaming request every seconds" = 0;
      };
    };
  };
</pre>
This way, it won't spawn any web UI, neither store any metric locally.


<span id="python-plugins"></span>
<span id="python-plugins"></span>