Merge pull request #134352 from astro/collectd

This commit is contained in:
Sandro 2021-08-25 13:57:24 +02:00 committed by GitHub
commit 0f0bce7c43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 86 additions and 292 deletions

View File

@ -6,6 +6,7 @@
, jdk , jdk
, libatasmart , libatasmart
, libdbi , libdbi
, libesmtp
, libgcrypt , libgcrypt
, libmemcached, cyrus_sasl , libmemcached, cyrus_sasl
, libmodbus , libmodbus
@ -19,12 +20,14 @@
, libvirt , libvirt
, libxml2 , libxml2
, libapparmor, libcap_ng, numactl , libapparmor, libcap_ng, numactl
, lvm2
, lua , lua
, lvm2
, lm_sensors , lm_sensors
, mongoc , mongoc
, mosquitto , mosquitto
, net-snmp , net-snmp
, openldap
, openipmi
, perl , perl
, postgresql , postgresql
, protobufc , protobufc
@ -35,7 +38,9 @@
, rrdtool , rrdtool
, udev , udev
, varnish , varnish
, xen
, yajl , yajl
, IOKit
# Defaults to `null` for all supported plugins, # Defaults to `null` for all supported plugins,
# list of plugin names for a custom build # list of plugin names for a custom build
, enabledPlugins ? null , enabledPlugins ? null
@ -43,302 +48,90 @@
}: }:
let let
# All plugins and their dependencies. # Plugins that have dependencies.
# Please help complete this! # Please help to extend these!
plugins = { plugins = {
aggregation = {}; amqp.buildInputs = [
amqp = { yajl
buildInputs = [ yajl ] ++ ] ++ lib.optionals stdenv.isLinux [ rabbitmq-c ];
lib.optionals stdenv.isLinux [ rabbitmq-c ]; apache.buildInputs = [ curl ];
}; ascent.buildInputs = [ curl libxml2 ];
apache = { battery.buildInputs = lib.optionals stdenv.isDarwin [
buildInputs = [ curl ]; IOKit
}; ];
apcups = {}; bind.buildInputs = [ curl libxml2 ];
apple_sensors = {}; ceph.buildInputs = [ yajl ];
aquaero = {}; curl.buildInputs = [ curl ];
ascent = { curl_json.buildInputs = [ curl yajl ];
buildInputs = [ curl libxml2 ]; curl_xml.buildInputs = [ curl libxml2 ];
}; dbi.buildInputs = [ libdbi ];
barometer = {}; disk.buildInputs = lib.optionals stdenv.isLinux [
battery = { udev
buildInputs = lib.optionals stdenv.isDarwin [ ] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.IOKit IOKit
]; ];
}; dns.buildInputs = [ libpcap ];
bind = { ipmi.buildInputs = [ openipmi ];
buildInputs = [ curl libxml2 ]; iptables.buildInputs = [
}; libpcap
ceph = { ] ++ lib.optionals stdenv.isLinux [
buildInputs = [ yajl ]; iptables libmnl
}; ];
cgroups = {}; java.buildInputs = [ jdk libgcrypt libxml2 ];
chrony = {}; log_logstash.buildInputs = [ yajl ];
conntrack = {}; lua.buildInputs = [ lua ];
contextswitch = {}; memcachec.buildInputs = [ libmemcached cyrus_sasl ];
cpu = {}; modbus.buildInputs = lib.optionals stdenv.isLinux [ libmodbus ];
cpufreq = {}; mqtt.buildInputs = [ mosquitto ];
cpusleep = {}; mysql.buildInputs = lib.optionals (libmysqlclient != null) [
csv = {}; libmysqlclient
curl = { ];
buildInputs = [ curl ]; netlink.buildInputs = [
}; libpcap
curl_json = { ] ++ lib.optionals stdenv.isLinux [
buildInputs = [ curl yajl ]; libmnl
}; ];
curl_xml = { network.buildInputs = [ libgcrypt ];
buildInputs = [ curl libxml2 ]; nginx.buildInputs = [ curl ];
}; notify_desktop.buildInputs = [ libnotify gdk-pixbuf ];
dbi = { notify_email.buildInputs = [ libesmtp ];
buildInputs = [ libdbi ]; openldap.buildInputs = [ openldap ];
}; ovs_events.buildInputs = [ yajl ];
df = {}; ovs_stats.buildInputs = [ yajl ];
disk = { perl.buildInputs = [ perl ];
buildInputs = lib.optionals stdenv.isLinux [ pinba.buildInputs = [ protobufc ];
udev ping.buildInputs = [ liboping ];
] ++ lib.optionals stdenv.isDarwin [ postgresql.buildInputs = [ postgresql ];
darwin.apple_sdk.frameworks.IOKit python.buildInputs = [ python ];
]; redis.buildInputs = [ hiredis ];
}; rrdcached.buildInputs = [ rrdtool libxml2 ];
dns = { rrdtool.buildInputs = [ rrdtool libxml2 ];
buildInputs = [ libpcap ]; sensors.buildInputs = lib.optionals stdenv.isLinux [ lm_sensors ];
}; sigrok.buildInputs = lib.optionals stdenv.isLinux [ libsigrok udev ];
dpdkevents = {}; smart.buildInputs = lib.optionals stdenv.isLinux [ libatasmart udev ];
dpdkstat = {}; snmp.buildInputs = lib.optionals stdenv.isLinux [ net-snmp ];
drbd = {}; snmp_agent.buildInputs = lib.optionals stdenv.isLinux [ net-snmp ];
email = {}; varnish.buildInputs = [ curl varnish ];
entropy = {}; virt.buildInputs = [
ethstat = {}; libvirt libxml2 yajl
exec = {}; ] ++ lib.optionals stdenv.isLinux [ lvm2 udev ];
fhcount = {}; write_http.buildInputs = [ curl yajl ];
filecount = {}; write_kafka.buildInputs = [ yajl rdkafka ];
fscache = {}; write_log.buildInputs = [ yajl ];
gmond = {}; write_mongodb.buildInputs = [ mongoc ];
gps = {}; write_prometheus.buildInputs = [ protobufc libmicrohttpd ];
grpc = {}; write_redis.buildInputs = [ hiredis ];
hddtemp = {}; write_riemann.buildInputs = [ protobufc riemann_c_client ];
hugepages = {}; xencpu.buildInputs = [ xen ];
intel_pmu = {};
intel_rdt = {};
interface = {};
ipc = {};
ipmi = {};
iptables = {
buildInputs = [
libpcap
] ++ lib.optionals stdenv.isLinux [
iptables libmnl
];
};
ipvs = {};
irq = {};
java = {
buildInputs = [ jdk libgcrypt libxml2 ];
};
load = {};
logfile = {};
log_logstash = {
buildInputs = [ yajl ];
};
lpar = {};
lua = {
buildInputs = [ lua ];
};
lvm = {};
madwifi = {};
match_empty_counter = {};
match_hashed = {};
match_regex = {};
match_timediff = {};
match_value = {};
mbmon = {};
mcelog = {};
md = {};
memcachec = {
buildInputs = [ libmemcached cyrus_sasl ];
};
memcached = {};
memory = {};
mic = {};
modbus = {
buildInputs = lib.optionals stdenv.isLinux [ libmodbus ];
};
mqtt = {
buildInputs = [ mosquitto ];
};
multimeter = {};
mysql = {
buildInputs = lib.optionals (libmysqlclient != null) [
libmysqlclient
];
};
netapp = {};
netlink = {
buildInputs = [
libpcap
] ++ lib.optionals stdenv.isLinux [
libmnl
];
};
network = {
buildInputs = [ libgcrypt ];
};
nfs = {};
nginx = {
buildInputs = [ curl ];
};
notify_desktop = {
buildInputs = [ libnotify gdk-pixbuf ];
};
notify_email = {};
notify_nagios = {};
ntpd = {};
numa = {};
nut = {};
olsrd = {};
onewire = {};
openldap = {};
openvpn = {};
oracle = {};
ovs_events = {
buildInputs = [ yajl ];
};
ovs_stats = {
buildInputs = [ yajl ];
};
perl = {
buildInputs = [ perl ];
};
pf = {};
pinba = {
buildInputs = [ protobufc ];
};
ping = {
buildInputs = [ liboping ];
};
postgresql = {
buildInputs = [ postgresql ];
};
powerdns = {};
processes = {};
protocols = {};
python = {
buildInputs = [ python ];
};
redis = {
buildInputs = [ hiredis ];
};
routeros = {};
rrdcached = {
buildInputs = [ rrdtool libxml2 ];
};
rrdtool = {
buildInputs = [ rrdtool libxml2 ];
};
sensors = {
buildInputs = lib.optionals stdenv.isLinux [ lm_sensors ];
};
serial = {};
sigrok = {
buildInputs = lib.optionals stdenv.isLinux [ libsigrok udev ];
};
smart = {
buildInputs = lib.optionals stdenv.isLinux [ libatasmart udev ];
};
snmp = {
buildInputs = lib.optionals stdenv.isLinux [ net-snmp ];
};
snmp_agent = {
buildInputs = lib.optionals stdenv.isLinux [ net-snmp ];
};
statsd = {};
swap = {};
synproxy = {};
syslog = {};
table = {};
tail_csv = {};
tail = {};
tape = {};
target_notification = {};
target_replace = {};
target_scale = {};
target_set = {};
target_v5upgrade = {};
tcpconns = {};
teamspeak2 = {};
ted = {};
thermal = {};
threshold = {};
tokyotyrant = {};
turbostat = {};
unixsock = {};
uptime = {};
users = {};
uuid = {};
varnish = {
buildInputs = [ curl varnish ];
};
virt = {
buildInputs = [ libvirt libxml2 yajl ] ++
lib.optionals stdenv.isLinux [ lvm2 udev
# those might be no longer required when https://github.com/NixOS/nixpkgs/pull/51767
# is merged
libapparmor numactl libcap_ng
];
};
vmem = {};
vserver = {};
wireless = {};
write_graphite = {};
write_http = {
buildInputs = [ curl yajl ];
};
write_kafka = {
buildInputs = [ yajl rdkafka ];
};
write_log = {
buildInputs = [ yajl ];
};
write_mongodb = {
buildInputs = [ mongoc ];
};
write_prometheus = {
buildInputs = [ protobufc libmicrohttpd ];
};
write_redis = {
buildInputs = [ hiredis ];
};
write_riemann = {
buildInputs = [ protobufc riemann_c_client ];
};
write_sensu = {};
write_tsdb = {};
xencpu = {};
xmms = {};
zfs_arc = {};
zone = {};
zookeeper = {};
}; };
configureFlags = configureFlags = lib.optionals (enabledPlugins != null) (
if enabledPlugins == null [ "--disable-all-plugins" ]
then [] ++ (map (plugin: "--enable-${plugin}") enabledPlugins));
else (map (plugin: "--enable-${plugin}") enabledPlugins) ++
(map (plugin: "--disable-${plugin}")
(builtins.filter (plugin: ! builtins.elem plugin enabledPlugins)
(builtins.attrNames plugins))
);
pluginBuildInputs = plugin: pluginBuildInputs = plugin:
if ! builtins.hasAttr plugin plugins lib.optionals (plugins ? ${plugin} && plugins.${plugin} ? buildInputs)
then throw "Unknown collectd plugin: ${plugin}" plugins.${plugin}.buildInputs;
else
let
pluginAttrs = builtins.getAttr plugin plugins;
in
if pluginAttrs ? "buildInputs"
then pluginAttrs.buildInputs
else [];
buildInputs = buildInputs =
if enabledPlugins == null if enabledPlugins == null

View File

@ -3788,6 +3788,7 @@ with pkgs;
collectd = callPackage ../tools/system/collectd { collectd = callPackage ../tools/system/collectd {
libsigrok = libsigrok_0_3; # not compatible with >= 0.4.0 yet libsigrok = libsigrok_0_3; # not compatible with >= 0.4.0 yet
jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731 jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
inherit (darwin.apple_sdk.frameworks) IOKit;
}; };
collectd-data = callPackage ../tools/system/collectd/data.nix { }; collectd-data = callPackage ../tools/system/collectd/data.nix { };