1# This test runs basic munin setup with node and cron job running on the same
2# machine.
3
4{ pkgs, ... }:
5{
6 name = "munin";
7 meta = with pkgs.lib.maintainers; {
8 maintainers = [ ];
9 };
10
11 nodes = {
12 one =
13 { config, ... }:
14 {
15 services = {
16 munin-node = {
17 enable = true;
18 # disable a failing plugin to prevent irrelevant error message, see #23049
19 disabledPlugins = [ "apc_nis" ];
20 };
21 munin-cron = {
22 enable = true;
23 hosts = ''
24 [${config.networking.hostName}]
25 address localhost
26 '';
27 };
28 };
29
30 # increase the systemd timer interval so it fires more often
31 systemd.timers.munin-cron.timerConfig.OnCalendar = pkgs.lib.mkForce "*:*:0/10";
32 };
33 };
34
35 testScript = ''
36 start_all()
37
38 with subtest("ensure munin-node starts and listens on 4949"):
39 one.wait_for_unit("munin-node.service")
40 one.wait_for_open_port(4949)
41
42 with subtest("ensure munin-cron output is correct"):
43 one.wait_for_file("/var/lib/munin/one/one-uptime-uptime-g.rrd")
44 one.wait_for_file("/var/www/munin/one/index.html")
45 one.wait_for_file("/var/www/munin/one/one/diskstat_iops_vda-day.png", timeout=60)
46 '';
47}