munin: add test and fix a bug

This commit is contained in:
Domen Kožar 2013-10-20 21:16:13 +02:00
parent de419ca920
commit aeff0028bf
3 changed files with 33 additions and 2 deletions

View file

@ -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 {

View file

@ -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
View 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");
'';
}