1# This test runs basic munin setup with node and cron job running on the same
2# machine.
3
4import ./make-test.nix ({ pkgs, ...} : {
5 name = "munin";
6 meta = with pkgs.stdenv.lib.maintainers; {
7 maintainers = [ domenkozar eelco chaoflow ];
8 };
9
10 nodes = {
11 one =
12 { config, ... }:
13 {
14 services = {
15 munin-node = {
16 enable = true;
17 # disable a failing plugin to prevent irrelevant error message, see #23049
18 extraConfig = ''
19 ignore_file ^apc_nis$
20 '';
21 };
22 munin-cron = {
23 enable = true;
24 hosts = ''
25 [${config.networking.hostName}]
26 address localhost
27 '';
28 };
29 };
30 # long timeout to prevent hydra failure on high load
31 systemd.services.munin-node.serviceConfig.TimeoutStartSec = "10min";
32 };
33 };
34
35 testScript = ''
36 startAll;
37
38 $one->waitForUnit("munin-node.service");
39 # make sure the node is actually listening
40 $one->waitForOpenPort(4949);
41 $one->succeed('systemctl start munin-cron');
42 # wait for munin-cron output
43 $one->waitForFile("/var/lib/munin/one/one-uptime-uptime-g.rrd");
44 $one->waitForFile("/var/www/munin/one/index.html");
45 '';
46})