Netdata

From NixOS Wiki
Revision as of 05:46, 26 September 2022 by imported>MrVanDalo (add toc)

netdata is a metrics tool, which comes with a lot of sane preconfiguration.

It contains of various plugins, which need to be enabled sometimes with additional effort.

Python Plugins

nvidia-smi

To enable the nvidia-smi plugin you have to make sure nvidia-smi can be called by netdata.

systemd.services.enable = true;
systemd.services.netdata.path = [pkgs.linuxPackages.nvidia_x11];
services.netdata.configDir."python.d.conf" = pkgs.writeText "python.d.conf" ''
  nvidia_smi: yes
'';

samba

To enable samba plugin a lot of things need to be done.

Still I could not make samba to work, because systemd services seem to be forbidden to run sudo. Please update if you are able to make it work.

systemd.services.enable = true;
services.netdata.configDir."python.d.conf" = pkgs.writeText "python.d.conf" ''
  samba: yes
'';

# add samba and sudo to path of python plugin
systemd.services.netdata.path = [ pkgs.sudo pkgs.samba ];

# permit to run sudo smbstatus -P
security.sudo.extraConfig = ''
  netdata ALL=(root) NOPASSWD: ${pkgs.samba}/bin/smbstatus
'';
# as documented here : https://learn.netdata.cloud/docs/agent/collectors/python.d.plugin/samba
# but seem not to work
systemd.services.netdata.serviceConfig.CapabilityBoundingSet = ["~"];