wiki:Native_ssh

Native SSH HOWTO

Native ssh support is available with Munin 2.0 or later (in beta as of 2011-07-04). This page describes how to use that.

There are two ways to use this.

SSH with a 2.0 master

This section is for when you have a 2.0 master and root on the munin-nodes. You can use it with any version of munin-node.

If you don't have root on the nodes you can manage without that too - see further down.

  1. You need netcat (nc) installed on the nodes. *BSD and Linux machines either has this installed or easily available in the package system.
  2. On the nodes you want to use SSH with, you first install a munin-node in the normal way (package or from source code).
  3. If the node is not configured with the right plugins you run "munin-node-configure --shell | sh -x"
  4. Ensure that munin-node is running
  5. Generate a SSH key for the munin-master munin user the normal way (e.g. using ssh-keygen).
  6. Install the public SSH key in the authorized_keys file in the munin account on all the SSH-based Munin nodes
  7. Use SSH from the munin account on the munin-master to log in to the munin account on all the SSH-based nodes so that you know all the keys are in order. Use the same hostname as you will use in Munin so that the host names match.
  8. You have to set the shell for the munin user on the munin-nodes to something other than "nologin", using e.g. the "chsh" command to do that (e.g. chsh -s /bin/sh munin).
  9. To get the SSH in touch with the Munin node, we use the netcat program. On the systems I have here this command is in /usr/bin/nc. on Debian systems it's /bin/nc
  10. So on the master I enter the following in munin.conf and hey presto, it all works!
[floppa.example.com]
   address ssh://floppa.example.com/usr/bin/nc localhost 4949

If your netcat supports the -q option you should probably add -q 0 to the command line (this needs verification, anyone?)

Then wait the accustomed 5-10 minutes and check the results in the munin web interface.

Troubleshooting

try to SSH to the host and execute the command as the munin user. copy&paste that from the address section

$ su - munin shell=/bin/bash
$ ssh floppa.example.com /usr/bin/nc localhost 4949

SSH with pre-2.0 Munin nodes - not root on the node

This is documented in http://blog.pwkf.org/post/2010/07/Waiting-for-Munin-2.0-Native-SSH-transport this article for the time being.

Last modified 11 months ago Last modified on 07/03/12 23:14:21