Open ghost opened 4 years ago
it would probably also be good if the ssh was automatically set up as recommended
something like
systemd.services.munin-cron-init = {
description = "munin-cron-init";
wantedBy = ["munin-cron.service"];
unitConfig.RequiresMountsFor = "/var/lib/munin";
script = ''
if ! test -d ~munin/.ssh; then
mkdir ~munin/.ssh
fi
if ! test -f ~munin/.ssh/id_ed25519; then
${pkgs.openssh}/bin/ssh-keygen \
-t ed25519 \
-f ~munin/.ssh/id_ed25519 \
-N ""
fi
cat > ~munin/.ssh/config <<EOF
# do not edit this automatically updated file
Host *
BatchMode=yes
ConnectTimeout=10
EscapeChar=none
ExitOnForwardFailure=yes
ForwardAgent=no
ForwardX11=no
IdentitiesOnly=yes
PasswordAuthentication=no
RequestTTY=no
StrictHostKeyChecking=no
User munin
EOF
'';
serviceConfig = {
User = "munin";
Type = "oneshot";
RemainAfterExit = true;
};
};
maybe User should be also configurable and not hardcoded to munin
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
Describe the bug
services.munin-cron.hosts = '' [foo] address ssh://foo -W 127.0.0.1:4949 '';
in /var/log/munin/.munin-update-wrapped.log:
2019/10/30 14:50:58 [ERROR] Munin::Master::UpdateWorker died with 'open3: exec of ssh -o ChallengeResponseAuthentication=no -o StrictHostKeyChecking=no -p 22 foo fa\
iled: No such file or directory at /nix/store/h0g8mv9v8x4kidiq24m74s92b3ps85fl-munin-2.0.43/lib/perl5/site_perl/Munin/Master/Node.pm line 112.'
manual fix:
systemd.services.munin-cron.path = [pkgs.openssh];
To Reproduce
services.munin-cron.enable = true; and configure at least one node to which can the munin user ssh
Expected behavior should work out of the box
Metadata Please run
nix run nixpkgs.nix-info -c nix-info -m
and paste the result."x86_64-linux"
Linux 4.19.80, NixOS, 19.03.173624.b6cfdceb7f9 (Koi)
yes
yes
nix-env (Nix) 2.2.2
"nixos-19.09.840.8bf142e001b"
/nix/var/nix/profiles/per-user/root/channels/nixos
Maintainer information: