In NixOS, netdata fails to start the python script that runs all of its python plugins. This completely breaks all 40+ python plugins netdata provides.
See also: #32059
Check netdata's log for the failure
grep ERROR /var/log/netdata/error.log
Notice a line similar to:
/nix/store/i0grak2af5vn06x7hmby81n1jjp1mx96-netdata-1.9.0/libexec/netdata/plugins.d/python.d.plugin: line 3: exec: ERROR python IS NOT AVAILABLE IN THIS SYSTEM: not found
A visual inspection of the netdata Web UI confirms there are no functioning python plugins.
Note: I have already tried adding python to the netdata buildInputs. This has not seemed to help.
Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.
"x86_64-linux"Linux 4.14.10, NixOS, 18.03.git.c98eb9e (Impala)noyesnix-env (Nix) 1.11.16"nixos-18.03pre124007.4fe3297686b"/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgsYou might want to add it to path attribute of the systemd service. Or even better, patch the plugin loader to use python:
--- a/plugins.d/python.d.plugin
+++ b/plugins.d/python.d.plugin
@@ -1,6 +1,4 @@
-#!/usr/bin/env bash
-'''':; exec "$(command -v python || command -v python3 || command -v python2 ||
-echo "ERROR python IS NOT AVAILABLE IN THIS SYSTEM")" "$0" "$@" # '''
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Description:
@jtojnar Thanks for the advice. I'll give these a shot later today.
I also backported it.
I just noticed I also forgot to add https://github.com/Mic92/dotfiles/blob/master/nixos/vms/modules/netdata.nix#L78
This one makes it finally work: https://github.com/NixOS/nixpkgs/pull/50509
Most helpful comment
You might want to add it to
pathattribute of the systemd service. Or even better, patch the plugin loader to use python: