Commit Graph

188 Commits

Author SHA1 Message Date
Dominique Martinet
4d12b79cd7 logrotate: do not enable logrotate.service itself
logrotate.timer is enough for rotating logs. Enabling logrotate.service would
make the service start on every configuration switch, leading to tests failure when
logrotate is enabled.

Also update test to make sure the timer is active and runs the service
on date change.
2022-02-26 19:13:12 +09:00
Dominique Martinet
c132bfaa19 logrotate: prepend extraConfig instead of postpending it
logrotate global options only affect rules following them - as such,
services.logrotate.extraConfig being added last makes the option only
useful for adding new paths but not for setting global options (e.g.
'dateext' so all logs are rotate with a date suffix).

Moving this first solves this problem, and we can then use this instead
of default paths config to append missingok/notifempty.
2022-02-11 21:07:37 +09:00
Dominique Martinet
61c70dbc97 logrotate: default to enable if any rule is active 2022-02-11 21:07:37 +09:00
Dominique Martinet
9917af7fe0 logrotate: move wtmp/btmp rules to systemd
wtmp and btmp are created by systemd, so the rules are more appropriate there.

They can be disabled explicitly with something like
  services.ogrotate.paths = {
    "/var/log/btmp".enable = false;
    "/var/log/wtmp".enable = false;
  };
if required.
2022-02-11 20:52:40 +09:00
Linus Heckemann
3e4ce97430 nixos/promtail: use promtail package 2022-01-23 14:01:29 +01:00
Julien Moutinho
f7ff512d6d nixos/logrotate: rotate login/logout logs by default 2021-12-29 02:07:02 +01:00
Julien Moutinho
c2fd94a61c nixos/logrotate: enable multiple paths per entry 2021-12-28 21:23:46 +01:00
Graham Christensen
06edb74413
Merge pull request #148785 from pennae/more-option-doc-staticizing
treewide: more defaultText for options
2021-12-17 11:14:08 -05:00
Kim Lindberger
ebaa226853
elk7: 7.11.1 -> 7.16.1, 6.8.3 -> 6.8.21 + add filebeat module and tests (#150879)
* elk7: 7.11.1 -> 7.16.1

* nixosTests.elk: Improve reliability and compatibility with ELK 7.x

- Use comparisons in jq instead of grepping
- Match for `.hits.total.value` if version >= 7, otherwise it always
  passes
- Make curl fail if requests fails

* nixos/filebeat: Add initial module and test

Filebeat is an open source file harvester, mostly used to fetch logs
files and feed them into logstash.

This module can be used instead of journalbeat if used with
`filebeat7` and configured with the `journald` input.

* python3Packages.parsedmarc.tests: Fix breakage

- Don't use the deprecated elasticsearch7-oss package
- Improve jq query robustness and add tracing

* rl-2205: Note the addition of the filebeat service

* elk6: 6.8.3 -> 6.8.21

The latest version includes a fix for CVE-2021-44228.

* nixos/journalbeat: Add a loose dependency on elasticsearch

Avoid unnecssary back-off when elasticsearch is running on the same
host.
2021-12-17 00:20:52 +09:00
pennae
70b105d1d0 nixos/journalbeat: remove support for versions < 6
nixos no longer ships journalbeat 5 and hasn't since at least 20.09. remove
checks for older versions from the module.
2021-12-08 21:41:18 +01:00
pennae
2512455639 nixos/*: add trivial defaultText for options with simple defaults 2021-12-02 22:35:04 +01:00
Aaron Andersen
f366af7a1b
Merge pull request #136630 from mweinelt/logrotate-hourly
nixos/logrotate: allow hourly frequency
2021-11-29 07:42:14 -05:00
Niklas Hambüchen
f692dc62c8 nixos/logstash: Add logstashJvmOptionsFile option 2021-11-01 16:21:02 +01:00
Naïm Favier
2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
Guillaume Girol
fa3664a176 nixos/logcheck: define group, fix after #133166 2021-09-18 14:42:08 +02:00
Guillaume Girol
3592034595
Merge pull request #133166 from symphorien/nonogroup
Don't default to nogroup for the primary group of users.
2021-09-13 18:29:21 +00:00
Guillaume Girol
bc3bca822a nixos: define the primary group of users where needed 2021-09-12 14:59:30 +02:00
Martin Weinelt
27b571067e
nixos/logrotate: allow hourly frequency
Also adjust the timer to run with the hourly keyword.
2021-09-10 14:17:20 +02:00
Zhaofeng Li
b6ad701a2c nixos/promtail: Allow write access to positions file if not in CacheDirectory
Because of `ProtectSystem=strict`, Promtail cannot write to the positions
file if it's not in its `CacheDirectory` (the default value).
2021-08-25 22:54:39 -07:00
Martin Weinelt
de5a69c918
nixos/promtail: Set TimeoutStopSec=10
On reboots and shutdowns promtail blocks for at least 90 seconds,
because it would still try to deliver log messages for loki, which isn't
possible when the network has already gone down.

Upstreams example unit also uses a ten seconds timeout, something which
has worked pretty well for me as well.
2021-04-28 21:02:11 +02:00
happysalada
d434251d1c vector: remove deprecated --no-topology 2021-04-05 08:30:52 +09:00
happysalada
bb7da110d1 vector: format with nixpkgs-fmt 2021-04-05 08:30:12 +09:00
Sandro
7d0dad76ef
Merge pull request #116936 from hercules-ci/logstash-jdk 2021-03-30 17:22:21 +02:00
Linus Heckemann
22de3c19e7 graylog: improve JRE handling
Since the upstream graylogctl script will prefer finding its java
executable based on JAVA_HOME, we now set this instead of PATH in
order to allow it to find the JRE. By setting it conditionally on it
not already being set, we allow selecting a different JRE at runtime.

We also explicitly use openjdk11, which supports the
UseConcMarkSweepGC option which graylog insists on using.
2021-03-28 14:37:28 +02:00
Robert Hensing
e7e6e8d5c3 nixos/logstash: Don't set unnecessary JAVA_HOME 2021-03-23 14:42:40 +01:00
volth
bc0d605cf1 treewide: fix double quoted strings in meta.description
Signed-off-by: Ben Siraphob <bensiraphob@gmail.com>
2021-01-24 19:56:59 +07:00
happysalada
627dfecadd nixos/vector: add module 2020-11-30 16:22:08 +09:00
Jörg Thalheim
31a0b5dff6
nixos/promtail: fix access to journal 2020-11-10 10:49:27 +01:00
Jörg Thalheim
88d1da8e5d
nixos/promtail: use json type for configuration 2020-11-10 10:49:23 +01:00
Janne Heß
54217cac69
nixos/promtail: Add a promtail module 2020-11-03 14:36:56 +01:00
Lassulus
d8e671676d
Merge pull request #89785 from buckley310/logstash
logstash: fix support for multiple plugin paths
2020-08-22 14:07:20 +02:00
Silvan Mosberger
1b8a94db67
nixos/logrotate: Fix option reference
Fixes the manual build
2020-08-22 01:38:38 +02:00
Aaron Andersen
00f08005af nixos/logrotate: switch paths option type from listOf to attrsOf 2020-08-21 17:04:04 -04:00
Sean Buckley
ebc2067bc5 logstash: fix support for multiple plugin paths 2020-06-08 00:04:15 -04:00
Jeff Slight
fe07adef7f
nixos/logrotate: add newline before extraConfig
Co-authored-by: Ryan Mulligan <ryan@ryantm.com>
2020-05-13 20:52:26 -07:00
Jeff Slight
90ce7f508a nixos/logrotate: add options for basic paths 2020-05-13 13:44:58 -07:00
Jeff Slight
c94911c5b7 nixos/logrotate: use lib.mkEnableOption 2020-05-13 11:58:51 -07:00
Izorkin
9f099143bc nixos/awstats: change path to nginx logs 2020-05-04 16:36:38 +03:00
rnhmjoj
1d61efb7f1 treewide: use attrs instead of list for types.loaOf options 2020-01-06 10:39:18 -05:00
Aaron Andersen
c95aef92b9 nixos/awstats: add missing description to extraConfig option (#76575) 2019-12-28 01:09:47 +02:00
Ben Harper
dade94cdb9 nixos/awstats: refactor module 2019-12-24 12:20:52 -05:00
Silvan Mosberger
4ee3e8b21d
nixos/treewide: Move rename.nix imports to their respective modules
A centralized list for these renames is not good because:
- It breaks disabledModules for modules that have a rename defined
- Adding/removing renames for a module means having to find them in the
central file
- Merge conflicts due to multiple people editing the central file
2019-12-10 02:51:19 +01:00
Jan Tojnar
f9237f3152
Merge branch 'master' into staging-next 2019-09-06 16:55:11 +02:00
adisbladis
4e30b30a65
logstash5: Remove EOL package 2019-09-06 14:22:15 +01:00
Vladimír Čunát
f21211ebfe
Merge branch 'master' into staging 2019-09-02 23:25:24 +02:00
Silvan Mosberger
478e7184f8
nixos/modules: Remove all usages of types.string
And replace them with a more appropriate type

Also fix up some minor module problems along the way
2019-08-31 18:19:00 +02:00
Frederik Rietdijk
5061fe0c2c Merge staging-next into staging 2019-08-28 08:26:42 +02:00
volth
35d68ef143 treewide: remove redundant quotes 2019-08-26 21:40:19 +00:00
Aaron Andersen
ac4327c025 nixos/awstats: replace usage of deprecated services.httpd.extraSubservices 2019-08-15 21:00:27 -04:00
Franz Pletz
376b5fd000
Merge pull request #64463 from Ma27/graylog-test
nixos/graylog: minor fixes, add test
2019-07-21 20:53:39 +00:00
Maximilian Bosch
beff2f8d75 nixos/graylog: use types.lines for extraConfig
The `types.lines` type makes it possible to define `extraConfig` in
multiple files and simply concat the contents.
2019-07-07 14:49:39 +02:00
Maximilian Bosch
3464c602e8
nixos/graylog: fix startup
Until now the startup failed with an error like this:

```
com.github.joschi.jadconfig.ValidationException: Parent path /var/lib/graylog/server for Node ID file at /var/lib/graylog/server/node-id is not a directory
```

This happens since `graylog.service` ensures that `/var/lib/graylog`
exists, however it doesn't take care of the directory for
`cfg.nodeIdFile`.
2019-07-06 20:42:56 +02:00
Aaron Andersen
65f449fe33 nixos/graylog: replace deprecated usage of PermissionsStartOnly
see https://github.com/NixOS/nixpkgs/issues/53852
2019-05-26 07:20:57 -04:00
Aaron Andersen
191e4b0755 nixos/heartbeat: replace deprecated usage of PermissionsStartOnly
see https://github.com/NixOS/nixpkgs/issues/53852
2019-05-25 13:48:41 -04:00
Robin Gloster
6cf583cf2f
Merge pull request #60406 from JohnAZoidberg/remove-isnull
treewide: Remove usage of isNull
2019-05-18 09:36:24 +00:00
Bas van Dijk
477c552c7d nixos/journalbeat: support journalbeat >= 6 & add test 2019-05-10 15:41:41 +02:00
Daniel Schaefer
786f02f7a4 treewide: Remove usage of isNull
isNull "is deprecated; just write e == null instead" says the Nix manual
2019-04-29 14:05:50 +02:00
Florian Jacob
e916cdf02d nixos/journalwatch: permissionsStartOnly is deprecated
See #53852 for details,
related to the efforts in #56265
2019-04-24 21:26:29 +02:00
Symphorien Gibol
a915b33315 nixos: add preferLocalBuild=true; on derivations for config files 2019-02-22 20:11:27 +01:00
Vincent Ambo
5ead27394d journaldriver: 1.0.0 -> 1.1.0 (#48106)
Included changes:

* upstream repository has moved, URLs changed accordingly
* journaldriver bumped to new upstream release

The new release includes an important workaround for an issue that
could cause log-forwarding to fail after service restarts due to
invalid journal cursors being persisted.
2018-10-09 23:45:43 +02:00
Bas van Dijk
551fec4467 Merge branch 'master' into es6 2018-08-23 23:41:27 +02:00
Izorkin
e4f4589186 syslog-ng: fix reload service 2018-08-16 18:23:58 +03:00
Izorkin
300fe1cc9a syslog-ng: fix reload service 2018-08-16 00:05:35 +03:00
Izorkin
c2b24892b0 syslog-ng: enable reload service 2018-08-15 19:46:47 +03:00
Jörg Thalheim
13db07a092 logstash: update default version to v6 2018-08-03 12:06:45 +01:00
volth
2e979e8ceb [bot] nixos/*: remove unused arguments in lambdas 2018-07-20 20:56:59 +00:00
volth
6f1134ff8b
nixos/journalwatch: fix evaluation 2018-07-09 04:43:41 +00:00
Florian Klink
fff5923686 nixos/modules: users.(extraUsers|extraGroup->users|group) 2018-06-30 03:02:58 +02:00
Vincent Ambo
59e5aabee6 nixos/journaldriver: add module for journaldriver log forwarder
Adds a module for running the journaldriver log forwarding agent via
systemd.

The agent can be deployed on both GCP instances and machines hosted
elsewhere to forward all logs from journald to Stackdriver Logging.

Consult the module options and upstream documentation for more
information.

Implementation notes:

* The service unit is configured to use systemd's dynamic user feature
  which will let systemd set up the state directory and appropriate
  user configuration at unit launch time instead of hardcoding it.

* The module depends on `network-online.target` to prevent a situation
  where journaldriver is failing and restarting multiple times before
  the network is online.
2018-06-18 20:36:44 +02:00
Robin Gloster
fa347164b6
graylog: use jre_headless 2018-03-22 02:29:27 +01:00
Philipp Dörfler
4b0c9418c0 nixos/logcheck: replace rm with rm -r to delete the empty logcheck.logfiles.d/
Fixes #29906
2017-12-17 04:02:26 +00:00
Sarah Brofeldt
b694fa0054 nixos/logstash: Listen on 127.0.0.1 instead of 0.0.0.0 2017-12-09 11:32:14 +01:00
Tristan Helmich
aa8e60d934 graylog module: adapt to Graylog version 2.3.0 2017-08-11 13:07:30 +02:00
Dan Peebles
b48ffa332b services.fluentd: add plugins option
This allows us to pass in additional ad-hoc fluentd plugins for custom
output formats and other goodness.
2017-08-08 22:02:56 +00:00
Florian Jacob
63bb133373 journalwatch & journalwatch service: init at 1.1.0 2017-07-16 00:14:19 +02:00
Tristan Helmich
97e8422541 heartbeat service: init 2017-07-02 10:45:59 +02:00
Bas van Dijk
2444eab485 ELK: update kibana and the elastic beats to 5.4 (#26252)
* Add kibana5 and logstash5
* Upgrade the elastic beats to 5.4
* Make sure all elastic products use the same version
  (see elk5Version)
* Add a test for the ELK stack
2017-06-13 22:36:08 +02:00
Mateusz Kowalczyk
80918692e1 SystemdJournal2Gelf.service: new service 2017-05-25 19:04:40 +01:00
Franz Pletz
3ab45f4b36
treewide: use boolToString function 2017-04-11 18:18:53 +02:00
Franz Pletz
fb50cde71e
nixos/treewide: systemd.time is in manvolume 7
cc #23396
2017-03-21 08:28:53 +01:00
Joachim Fasting
15da23d5c1
nixos/modules: use defaultText/literalExample where applicable
Primarily to fix rendering of default values/examples but also
to avoid unnecessary work.
2017-03-07 14:06:08 +01:00
Tristan Helmich
7420922806 graylog module: add plugin support 2017-02-23 15:21:29 +01:00
Joachim F
6dbe55ca68 Merge pull request #20456 from ericsagnes/feat/loaf-dep-1
Use attrsOf in place of loaOf when relevant
2017-02-19 15:49:25 +01:00
Parnell Springmeyer
6777e6f812
Merging with upstream 2017-01-29 05:54:01 -06:00
Parnell Springmeyer
4aa0923009
Getting rid of the var indirection and using a bin path instead 2017-01-29 04:11:01 -06:00
Parnell Springmeyer
e92b8402b0
Addressing PR feedback 2017-01-28 20:48:03 -08:00
Dan Peebles
ced27b2966 fluentd module: add configurable package option 2017-01-27 15:08:23 +00:00
Parnell Springmeyer
a26a796d5c
Merging against master - updating smokingpig, rebase was going to be messy 2017-01-26 02:00:04 -08:00
Robin Gloster
117e5547d1 Merge pull request #21311 from makefu/services/logstash
services.logstash: default options, examples and address update
2017-01-25 22:11:40 +01:00
Parnell Springmeyer
bae00e8aa8
setcap-wrapper: Merging with upstream master and resolving conflicts 2017-01-25 11:08:05 -08:00
Marius Bergmann
00444cbf25 journalbeat service: init at 5.1.2
Journalbeat is a log shipper from systemd/journald to
Logstash/Elasticsearch. I added a package as well as a NixOS service
module for it.
2017-01-23 18:28:55 +01:00
makefu
e9c6cf02e6
services.logstash: rename address to listenAddress 2017-01-13 10:19:32 +01:00
makefu
10303e9e47
services.logstash: update example and default filter 2017-01-13 10:19:19 +01:00
Joachim Fasting
fafb6657c1
syslogd service: assert conflict with rsyslogd
Enabling both these at the same time fails because they implement the
same interface.
2016-12-10 20:35:39 +01:00
Eric Sagnes
418901a906 logcheck module: ignore, ignoreCron option loaOf -> attrsOf 2016-11-16 16:29:58 +09:00
Eric Sagnes
986510de45 logcheck module: use enum 2016-11-05 13:24:53 +09:00
Eric Sagnes
c1cad56c6e logcheck module: optionSet -> submodule 2016-09-13 12:53:09 +09:00
Parnell Springmeyer
98c058a1ee Adapting everything for the merged permissions wrappers work. 2016-09-01 19:21:06 -05:00
Christian Lask
6d68a1fbf3 logstash: 1.5.3 -> 2.3.4
Note: the option to configure the watchdog timeout seems to be gone
in the 2.3 series of Logstash. It complains about an unknown option
and it is not in the source anymore. I am thus removing this
configuration option to adjust the service to these changes, too.
2016-07-27 17:45:38 +02:00
Sheena Artrip
e5fc302b1a
logstash: fix examples in service file 2016-06-24 14:36:18 -04:00