Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collectd: bring back xencpu plugin #347148

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions nixos/modules/services/monitoring/collectd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ in {
};

config = mkIf cfg.enable {
warnings = lib.optional ((cfg.plugins ? xencpu) || cfg.user == "root") ''
The xencpu plugin for collectd typically requires root privileges. You
have enabled the xencpu plugin but collectd is not configured to run as
root. If you're running in a Xen dom0 environment and want to collect
metrics of hardware CPU load, you may need
`services.collectd.user = "root"`;
'';

# 1200 is after the default (1000) but before mkAfter (1500).
services.collectd.extraConfig = lib.mkOrder 1200 ''
${baseDirLine}
Expand Down
6 changes: 3 additions & 3 deletions pkgs/tools/system/collectd/plugins.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
, xen
, yajl
, IOKit
# Defaults to `null` for all supported plugins (except xen, which is marked as
# insecure), otherwise a list of plugin names for a custom build
# Defaults to `null` for all supported plugins list of plugin names for a custom build
, enabledPlugins ? null
, ...
}:
Expand Down Expand Up @@ -134,7 +133,8 @@ let
buildInputs =
if enabledPlugins == null
then builtins.concatMap pluginBuildInputs
(builtins.attrNames (builtins.removeAttrs plugins ["xencpu"]))
(builtins.attrNames (
builtins.removeAttrs plugins (lib.optional (!lib.meta.availableOn stdenv.hostPlatform xen) "xencpu")))
else builtins.concatMap pluginBuildInputs enabledPlugins;
in {
inherit configureFlags buildInputs;
Expand Down