This article is intended for Linux server administrators with experience managing Munin and logrotate. If your server is hosted with Maxer, please contact our support team and we can do this for you. Do not attempt these steps if you are unsure.

Munin generates statistics every 5 minutes, which can cause log files in /var/log/munin/ (such as munin-update.log and munin-node.log) to grow very large over time. By default, cPanel servers do not rotate Munin logs, unlike most other services. You can configure log rotation with logrotate to prevent disk usage issues.


Step 1: Check Munin log sizes

Login to SSH as root and run:

cd /var/log/munin/
du -sh *

This will show you how large the log files are.


Step 2: Create a logrotate configuration

Open (or create) the Munin config file:

nano /etc/logrotate.d/munin

Paste the following configuration:

/var/log/munin/munin-update.log {
daily
rotate 7
compress
missingok
notifempty
}

/var/log/munin/munin-node.log {
daily
rotate 7
compress
missingok
notifempty
}

Explanation:

  • daily → rotate logs every day (you may use weekly if preferred)

  • rotate 7 → keep 7 archives before deleting

  • compress → compress rotated logs

  • missingok → don’t report errors if log is missing

  • notifempty → don’t rotate empty logs


Step 3: Save and exit

Press Ctrl + X, then Y to save and exit.


Step 4: Test logrotate

Logrotate runs automatically via cron, but you can test immediately:

logrotate -f /etc/logrotate.d/munin

Step 5: Verify

Check the log directory again:

cd /var/log/munin/
du -sh *

You should now see compressed (.gz) log files and reduced sizes.


✅ That’s it — Munin logs will now rotate automatically.

Updated by SP on 02/10/2025

Was this answer helpful? 2 Users Found This Useful (2 Votes)