Adding more servers to monitor with Munin in Mail-in-a-Box

Quick and easy, but you’ll want to monitor your Munin config file.

Munin is one of the various software that gets installed when you set up Mail-in-a-Box on your server. It comes with both the master and slave (node), and can be accessed at

Since MiaB comes with the heftier, required Munin master package, we might as well utilize it to its fullest — by connecting our other servers as nodes that we can monitor through our box.

This works well and is a quick set up, but bear in mind that it requires editing a configuration file that Mail-in-a-Box manages. That means we’ll have to keep an eye on this file either manually, which I wouldn’t recommend, or automatically with Monit.

Install Munin on your other servers

The first thing you’ll need to do is install Munin node on any other servers that you want to monitor through your box.

Note: our tutorials on Obstance usually assume you’re using Ubuntu or at least a Debian-based OS. Most of what we do on the site should work on the most common Linux distros, but be aware that the commands may differ.

user@otherserver:~$ sudo apt-get install munin-node 

Open the Munin node configuration to add your mail server’s IP address

Find your server’s hostname

Just before we edit the file, first you’ll want to figure out what the hostname is for your node server:

user@otherserver:~$ hostname

Take note of that, as it’s what you’ll be using in a minute (when you go back to your Munin master server’s config file, with the format being [])

With that done, now head into /etc/munin and modify the munin-node.conf with your editor of choice. I normally use SFTP via FileZilla and use Atom or Notepad++, but nano is my choice if I’m in a shell session:

user@otherserver:~$ sudo nano /etc/munin/munin-node.conf

Find a block of comments that looks like this. You’ll want to add in your mail server’s IP address here.

# A list of addresses that are allowed to connect.  This must be a
# regular expression, since Net::Server does not understand CIDR-style
# network notation unless the perl module Net::CIDR is installed.  You
# may repeat the allow line as many times as you'd like
allow ^127\.0\.0\.1$
allow ^::1$

Notice the format: it’s a regular expression. So add your box’s IP address on a new line as allow ^198\.51\.100\.0$, obviously using your actual IP address. Repeat this for as many servers as you want to monitor with Munin and then save the file.

Restart munin-node so that it reads your changes:

  • sudo systemctl restart munin-node

Add your Munin nodes to the master configuration on your mail server

On your mail server, edit the file /etc/munin/munin.conf, which is the master configuration. You won’t have this file on your slave servers unless you explicitly installed munin; this is how it should be, since we’re using Mail-in-a-Box as the master, and there only needs to be one master.

In that file, you’ll see something like this:

# a simple host tree

Using the same format, add your nodes in the same fashion:

# a simple host tree

# added to file; pull from server

The comes from the hostname we got from the beginning of this article.

Restart Munin so that it loads your configuration:

  • sudo systemctl restart munin-node

After adding your mail server’s IP address to your node servers, and your node servers to your master config, wait about five minutes.

The cron in Mail-in-a-Box pulls information from the servers every 5th minute, so give it time to populate data. Once you’ve waited at least that long, head over to and check to make sure you’re seeing your hostnames from your nodes there.

If you’re not seeing your nodes…

Allow your Munin master server through your node server’s firewall

If you’ve waited at least five minutes and you’re not seeing your nodes in, then you’re most likely going to have to allow your mail server’s IP address through your firewall. With UFW, you would simply:

user@otherserver:~$ sudo ufw allow from to any port 4949

Of course, be sure to use your actual IP address. Port 4949 is the default port that a Munin server listens on, and is the port used in a Mail-in-a-Box installation.

You can check to make sure it worked:

user@otherserver:~$ sudo ufw status
Status: active

To                       Action      From
--                       ------      ----
22/tcp                   ALLOW       Anywhere
Nginx Full               ALLOW       Anywhere
4949                     ALLOW
22/tcp (v6)              ALLOW       Anywhere (v6)
Nginx Full (v6)          ALLOW       Anywhere (v6)

It’s possible that you’re not using UFW as a front for iptables on your node servers. If this is the case, use iptables directly or whichever firewall you’re using. A common one is ConfigServer Security & Firewall (CSF).

After you’ve allowed your mail server to get past your node’s firewall, wait again and then check. You should now be seeing your node’s hostname in the Munin monitoring section of your MiaB install.

One more reminder — monitor your Mail-in-a-Box Munin config file

As mentioned in the beginning of the article, you’ll want to monitor any file changes to munin.conf on your mail server. Since it’s managed by Mail-in-a-Box, it may be overwritten during updates.

Take a backup of the file after you’ve added your changes, and then follow the article below to monitor it. You’ll get an email alert when this happens, and can add your changes back to the file easily.

No comments yet.

Post a comment

  • (will not be published)

This site uses Akismet to reduce spam. Learn how your comment data is processed.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>