munin: add test and fix a bug
This commit is contained in:
parent
de419ca920
commit
aeff0028bf
@ -195,10 +195,9 @@ in
|
||||
system.activationScripts.munin-node = ''
|
||||
echo "updating munin plugins..."
|
||||
|
||||
export PATH="/run/current-system/sw/bin:/run/current-system/sw/sbin";
|
||||
mkdir -p /etc/munin/plugins
|
||||
rm -rf /etc/munin/plugins/*
|
||||
${pkgs.munin}/sbin/munin-node-configure --shell --families contrib,auto,manual --config ${nodeConf} --libdir=${muninPlugins} --servicedir=/etc/munin/plugins 2>/dev/null | ${pkgs.bash}/bin/bash
|
||||
PATH="/run/current-system/sw/bin:/run/current-system/sw/sbin" ${pkgs.munin}/sbin/munin-node-configure --shell --families contrib,auto,manual --config ${nodeConf} --libdir=${muninPlugins} --servicedir=/etc/munin/plugins 2>/dev/null | ${pkgs.bash}/bin/bash
|
||||
'';
|
||||
|
||||
}) (mkIf cronCfg.enable {
|
||||
|
@ -21,6 +21,7 @@ with import ../lib/testing.nix { inherit system minimal; };
|
||||
#mpich = makeTest (import ./mpich.nix);
|
||||
mysql = makeTest (import ./mysql.nix);
|
||||
mysql_replication = makeTest (import ./mysql-replication.nix);
|
||||
munin = makeTest (import ./munin.nix);
|
||||
nat = makeTest (import ./nat.nix);
|
||||
nfs3 = makeTest (import ./nfs.nix { version = 3; });
|
||||
#nfs4 = makeTest (import ./nfs.nix { version = 4; });
|
||||
|
31
nixos/tests/munin.nix
Normal file
31
nixos/tests/munin.nix
Normal file
@ -0,0 +1,31 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
# This test runs basic munin setup with node and cron job running on the same
|
||||
# machine.
|
||||
|
||||
{
|
||||
nodes = {
|
||||
one =
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
services = {
|
||||
munin-node.enable = true;
|
||||
munin-cron = {
|
||||
enable = true;
|
||||
hosts = ''
|
||||
[${config.networking.hostName}]
|
||||
address localhost
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
startAll;
|
||||
|
||||
$one->waitForUnit("munin-node.service");
|
||||
$one->waitForFile("/var/lib/munin/one/one-uptime-uptime-g.rrd");
|
||||
$one->waitForFile("/var/www/munin/one/index.html");
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user