Commit Graph

58 Commits

Author SHA1 Message Date
Patrik Keller
30b25fa102 nixos/netdata: add missing dependency for syslog alarms
Netdata depends on the `logger` utility for dispatching health alarms to
syslog. This dependency was missing in the systemd units environment.

Issue: https://github.com/NixOS/nixpkgs/issues/272702
Docs: https://learn.netdata.cloud/docs/alerting/notifications/agent-dispatched-notifications/syslog
Docs, archived: https://archive.is/mkQa4
2024-01-11 08:38:52 +01:00
Raito Bezarius
db1e415c07 nixos/netdata: ensure analytics reporting is truly opted-out
Fixes 260035.
2023-12-09 00:47:56 +01:00
h7x4
0a37316d6c
treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
2023-11-27 01:28:36 +01:00
Guillaume DELVIT
043522789b nixos/services/netdata: add systemd-journald plugin as a privileged wrapper
https://learn.netdata.cloud/docs/logs/systemd-journal/
need acces to

    Kernel Logs (dmesg):
        Capability: CAP_SYSLOG
        Description: This capability allows the program to read kernel logs using the dmesg command or by reading the /dev/kmsg file.

    System Logs (e.g., /var/log/syslog):
        Capability: CAP_DAC_READ_SEARCH
        Description: This capability allows the program to read system logs located in directories such as /var/log/.

    User Logs (e.g., /var/log/auth.log):
        Capability: CAP_DAC_READ_SEARCH
        Description: This capability allows the program to read user logs located in directories such as /var/log/.
2023-11-01 00:16:30 +01:00
DDoSolitary
d410464c5d
nixos/netdata: fix position of NETDATA_PIPENAME
It was accidentally placed in a condition-guarded block, making the
setting only take effect when enableAnalyticsReporting = false.
2023-08-09 19:22:20 +08:00
DDoSolitary
060a47e1e4
netdata: set NETDATA_PIPENAME to /run/netdata/ipc
Netdata creates its control socket at /tmp/netdata-ipc by default, which
is insecure and actually inaccessible with systemd's PrivateTmp enabled.

Originally we patched its source code to move the socket to
/run/netdata/ipc. However, it was removed due to incompatibility when
upgrading to v1.41.0: 1d2a2dc7d0

Fortunately, this new version of netdata adds support for setting the
location of the control socket via the environment variable
NETDATA_PIPENAME. So let's set it for the netdata service and the
command line utility so that they can communicate properly.
2023-08-05 18:19:08 +08:00
Stzx
3e8f45393d
Fix package ref 2023-07-21 18:56:49 +08:00
Raito Bezarius
2d7e29b60e nixos/netdata: fix claim_token_file -> claimTokenFile
It was forgotten in afc6f0d93b.
2023-06-17 17:51:45 +02:00
Ryan Lahfa
afc6f0d93b
Merge pull request #228479 from zimbatm/netdata-auto-claim 2023-06-16 11:30:30 +02:00
Raito Bezarius
16658f7634 nixos/netdata: introduce deadlineBeforeStopSec
Previously, we hardcoded a 60 second timer to stop netdata if we didn't have any answer back.
This is wrong and can cause data loss because the SIGTERM sent by systemd can sometimes be not honored.
Which in turn becomes a SIGKILL, causing potential data loss / corruption.

Offer a flag to users and bump the deadline to 2 minutes.
2023-05-08 19:29:13 +02:00
Jonas Chevalier
db8b28dc5d
Update nixos/modules/services/monitoring/netdata.nix
Co-authored-by: Ryan Lahfa <masterancpp@gmail.com>
2023-05-05 18:41:56 +02:00
Jonas Chevalier
14793fac6c
Update nixos/modules/services/monitoring/netdata.nix
Co-authored-by: Ryan Lahfa <masterancpp@gmail.com>
2023-05-05 18:41:51 +02:00
zimbatm
f4d5a76a81 netdata module: add automatic claim
Allow machines to auto-register themselves by passing the claim token.
2023-04-27 10:30:32 +02:00
pennae
ef176dcf7e nixos/*: automatically convert option descriptions
conversions were done using https://github.com/pennae/nix-doc-munge
using (probably) rev f34e145 running

    nix-doc-munge nixos/**/*.nix
    nix-doc-munge --import nixos/**/*.nix

the tool ensures that only changes that could affect the generated
manual *but don't* are committed, other changes require manual review
and are discarded.
2022-08-31 16:32:53 +02:00
pennae
61e93df189 nixos/*: automatically convert option docs to MD
once again using nix-doc-munge (69d080323a)
2022-08-03 22:46:41 +02:00
pennae
694d5b19d3 nixos/*: replace </para><para> with double linebreaks
our xslt already replaces double line breaks with a paragraph close and
reopen. not using explicit para tags lets nix-doc-munge convert more
descriptions losslessly.

only whitespace changes to generated documents, except for two
strongswan options gaining paragraph two breaks they arguably should've
had anyway.
2022-08-03 20:39:21 +02:00
pennae
2e751c0772 treewide: automatically md-convert option descriptions
the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
2022-07-30 15:16:34 +02:00
Mario Rodas
f97827178e
Merge pull request #181021 from melvyn2/patch-1
Add `bash` to netdata service path
2022-07-24 16:12:07 -05:00
Wout Mertens
3ee8d4c909
netdata module: fix ExecStartPost (#181976) 2022-07-19 06:19:18 +02:00
Wout Mertens
7f55ee3a53
netdata: fix post start for module 2022-07-15 09:57:13 +02:00
Melvyn
ef6d6d4c4a
Add bash to netdata service path
The `bash` binary is needed for running some plugins, notably the alarm notify plugins. If the binary isn't in the path, alarms notifications aren't sent and the netdata error log instead contains `/usr/bin/env: 'bash': No such file or directory`.
2022-07-10 16:26:05 -07:00
Wout Mertens
7f025e2b34
netdata: started when service can be pinged 2022-06-03 10:45:27 +02:00
misuzu
768d0d6098 nixos/netdata: expose /etc/netdata 2022-01-10 23:56:57 +02:00
misuzu
9e6145c73b nixos/netdata: add configDir option
This option makes the complete netdata configuration directory available for
modification. The default configuration is merged with changes
defined in the configDir option.

Co-authored-by: Michael Raitza <spacefrogg-github@meterriblecrew.net>
2022-01-10 23:56:53 +02:00
Naïm Favier
2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
Izorkin
1e54f84012
nixos/netdata: fix working with disabled ipmi plugin 2021-09-19 19:15:49 +03:00
Guillaume Girol
bc3bca822a nixos: define the primary group of users where needed 2021-09-12 14:59:30 +02:00
Izorkin
85914bc01d
nixos/netdata: change wrappers permissions 2021-05-10 10:35:51 +03:00
Izorkin
859633ee43
nixos/netdata: use cgroup v2 2021-05-10 10:24:31 +03:00
Izorkin
58497175be
nixos/netdata: cgroup-network: don't use AmbientCapabilities 2021-05-10 10:19:57 +03:00
Izorkin
53651179b9
nixos/netdata: update capabilities 2021-05-05 20:46:07 +03:00
Izorkin
9aad915539
nixos/netadata: add required packages 2021-05-04 21:02:23 +03:00
D Anzorge
5d81fcdf37 nixos/netdata: add config option for disabling analytics
Option disables analytics through the DO_NOT_TRACK environment variable,
as detailed in
https://learn.netdata.cloud/docs/agent/anonymous-statistics

Default is analytics off
2021-04-01 13:06:04 +02:00
Bas van Dijk
8ac4b251c8
nixos: use functionTo to prevent evaluation errors while merging
Without this patch merging options like
services.xserver.windowManager.xmonad.extraPackages
results in the evaluation error:

  error: value is a list while a set was expected, at nixpkgs/lib/options.nix:77:23

With this patch we get the desired merging behaviour that just concatenates the
resulting package lists.

(cherry picked from commit 6e99f9fdecb1f28308c8e0aed0fc851737354864)

Co-Authored-By: Silvan Mosberger <contact@infinisil.com>
2021-01-24 17:18:37 +01:00
Graham Christensen
bc49a0815a
utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
Izorkin
2f6a18af5a nixos/netadata: enable simple sandboxing 2020-08-09 10:19:30 +03:00
Nejc Zupan
479c521af9
Automatically restart netdata on failures
I've had Netdata crash on me sometimes. Rarely but more than once. And I lost days of data before I noticed.

Let's be nice and restart it on failures by default.
2020-04-08 20:58:06 +01:00
Izorkin
d508a2f366 nixos/netdata: fix permissions for perf.plugin 2020-03-23 12:24:49 +03:00
Izorkin
a3c769fef6 nixos/netdata: fix permissions for slabinfo.plugin 2020-03-23 12:24:49 +03:00
Jesper Geertsen Jonsson
b42babd160 nixos/netdata: add module package option 2020-03-10 23:06:01 +01:00
rnhmjoj
1d61efb7f1 treewide: use attrs instead of list for types.loaOf options 2020-01-06 10:39:18 -05:00
Renaud
266d3dd7f6
Merge pull request #72187 from Izorkin/netdata-fix
nixos/netdata: add which to path
2019-11-03 14:06:51 +01:00
Izorkin
001b3d5764 nixos/netdata: add which to path 2019-10-28 21:20:57 +03:00
Janne Heß
d6c08776ba treewide: Switch to system users 2019-10-12 22:25:28 +02:00
davidak
6d4c69e640 netdata: enable cgroup accounting 2019-08-19 14:57:41 +02:00
Izorkin
fb4d71a39f nixos/netdata: increase performance 2019-07-06 10:15:21 +03:00
Izorkin
6e592faa92 nixos/netdata: enable reload service and add PID file 2019-07-06 10:12:20 +03:00
Izorkin
064a19afe2 nixos/netdata: add capabilites to freeipmi.plugin 2019-07-04 13:08:38 +03:00
Aaron Andersen
fff8b9bcaa nixos/netdata: replace deprecated usage of PermissionsStartOnly
see https://github.com/NixOS/nixpkgs/issues/53852
2019-05-26 07:20:57 -04:00
Symphorien Gibol
a915b33315 nixos: add preferLocalBuild=true; on derivations for config files 2019-02-22 20:11:27 +01:00