2013-10-20 19:16:13 +00:00
|
|
|
# This test runs basic munin setup with node and cron job running on the same
|
|
|
|
# machine.
|
|
|
|
|
2015-07-12 10:09:40 +00:00
|
|
|
import ./make-test.nix ({ pkgs, ...} : {
|
2014-06-28 14:04:49 +00:00
|
|
|
name = "munin";
|
2015-07-12 10:09:40 +00:00
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
2016-05-17 11:57:28 +00:00
|
|
|
maintainers = [ domenkozar eelco chaoflow ];
|
2015-07-12 10:09:40 +00:00
|
|
|
};
|
2014-04-14 12:02:44 +00:00
|
|
|
|
|
|
|
nodes = {
|
2013-10-20 19:16:13 +00:00
|
|
|
one =
|
2018-07-20 20:56:59 +00:00
|
|
|
{ config, ... }:
|
2014-04-14 12:02:44 +00:00
|
|
|
{
|
2013-10-20 19:16:13 +00:00
|
|
|
services = {
|
2018-08-25 12:27:41 +00:00
|
|
|
munin-node = {
|
2013-10-20 19:16:13 +00:00
|
|
|
enable = true;
|
2018-08-25 12:27:41 +00:00
|
|
|
# disable a failing plugin to prevent irrelevant error message, see #23049
|
|
|
|
extraConfig = ''
|
|
|
|
ignore_file ^apc_nis$
|
2013-10-20 19:16:13 +00:00
|
|
|
'';
|
|
|
|
};
|
2018-08-25 12:27:41 +00:00
|
|
|
munin-cron = {
|
|
|
|
enable = true;
|
|
|
|
hosts = ''
|
|
|
|
[${config.networking.hostName}]
|
|
|
|
address localhost
|
|
|
|
'';
|
|
|
|
};
|
2013-10-20 19:16:13 +00:00
|
|
|
};
|
2018-08-25 12:27:41 +00:00
|
|
|
# long timeout to prevent hydra failure on high load
|
|
|
|
systemd.services.munin-node.serviceConfig.TimeoutStartSec = "10min";
|
2013-10-20 19:16:13 +00:00
|
|
|
};
|
|
|
|
};
|
2014-04-14 12:02:44 +00:00
|
|
|
|
2013-10-20 19:16:13 +00:00
|
|
|
testScript = ''
|
|
|
|
startAll;
|
2014-04-14 12:02:44 +00:00
|
|
|
|
2013-10-20 19:16:13 +00:00
|
|
|
$one->waitForUnit("munin-node.service");
|
2018-08-25 12:27:41 +00:00
|
|
|
# make sure the node is actually listening
|
|
|
|
$one->waitForOpenPort(4949);
|
2017-03-21 23:08:41 +00:00
|
|
|
$one->succeed('systemctl start munin-cron');
|
2018-08-25 12:27:41 +00:00
|
|
|
# wait for munin-cron output
|
2013-10-20 19:16:13 +00:00
|
|
|
$one->waitForFile("/var/lib/munin/one/one-uptime-uptime-g.rrd");
|
|
|
|
$one->waitForFile("/var/www/munin/one/index.html");
|
|
|
|
'';
|
2015-07-12 10:09:40 +00:00
|
|
|
})
|