How to install Munin monitoring on cPanel/WHM

Many people like to have some monitoring tool with lots of charts so they can track better how their server is performing. One of the best known tools for this is Munin: a free (open source) networked resource monitoring tool. Installation on WHM powered hosting is somewhat easy:

 

Step 1
First, login to WHM  🙂

Step 2
In the left sidebar go to cPanel -> Manage Plugins (or simply search for Manage Plugins like I did):

Step 3
Tick a check-box next to Munin and press the save button below:

Step 4
Wait some time until it it’s installed:

Step 5
That’s about it! Munin is now installed and charts will be updated every five minutes. At this point you should simply wait some time until the charts are generated for the first time. If you try to access it by clicking Plugins -> Munin Service Monitor:

You will probably get error like this:

So this means you need to wait some more. Some people reported that they had to logout and login back to WHM before they can access the Munin after the installation so that might not be a bad idea.

After some time you should get  first charts (probably empty ones)

Typically you’ll want to wait for 24 hours before giving a deeper look at these charts.

 

And now some geek stuff…

 

Munin not showing Apache
If you are running Apache on different port (typically if you’re having Varnish running on port 80 and Apache running on some other port) you’ll have to edit file on path:
/etc/munin/plugin-conf.d/cpanel.conf and add two following lines of code at the end of file:

[apache_*]
env.url   http://127.0.0.1:%d/whm-server-status?auto
env.ports 8080

Don’t forget to replace the Apache port with your port! After editing this config file you should restart Munin by executing this command: /etc/init.d/munin-node restart and again wait some time before Apache data starts to show.

 

Apache_process error in munin-node.log
I have noticed this error in my /var/log/munin/munin-node.log file:

Error output from apache_processes:
Use of qw(...) as parentheses is deprecated at /etc/munin/plugins/apache_processes line 164.

To fix this bug edit file located at /usr/local/cpanel/3rdparty/share/munin/plugins/apache_processes and locate line 164 – it should look like this:

foreach my $type qw "busy idle" {

And simply replace it with this:

foreach my $type (qw(busy idle)) {

After that simply restart Munin.

 

Monitor Varnish with Munin
To monitor Varnish with Munin simply first edit config file at /etc/munin/plugin-conf.d/cpanel.conf and add these two lines:

[varnish*]
user root

And then execute following commands:

cd /usr/local/cpanel/3rdparty/share/munin/plugins/
wget https://raw.githubusercontent.com/basiszwo/munin-varnish/master/varnish_allocated
wget https://raw.githubusercontent.com/basiszwo/munin-varnish/master/varnish_hitrate
wget https://raw.githubusercontent.com/basiszwo/munin-varnish/master/varnish_total_objects
wget https://raw.githubusercontent.com/basiszwo/munin-varnish/master/varnish_cachehitratio
wget https://raw.githubusercontent.com/basiszwo/munin-varnish/master/varnish_varnishstat_
chmod a+x varnish_*
ln -s varnish_* /etc/munin/plugins/
/etc/init.d/munin-node restart

View Comments

  • Thanks for the great guidance its help out a lot. You made Munin quite easy to understand.

Share
Published by
Nick

Recent Posts

How to Manage Storage on Smartphone: 12 Ways

Can't download new apps to your phone because there isn't enough storage space? Lack of…

10 months ago

Spotlight Search won’t open the files it finds in Dropbox with associated application

This issue started to appear on macOS 13 Ventura after recent Dropbox update. I would…

1 year ago

Windows 10 Search fix

Since this morning (Feb 5th 2020) search just stopped working on my Windows 10 (version…

4 years ago

The mysql_result in mysqli

Many of you have run into a problem when you were working on some old…

4 years ago

How to convert physical Windows PC into a virtual machine

After 10 years of running my main desktop computer on Windows 7 - time has…

4 years ago

How to downgrade PHP 7.4 to PHP 7.3 on VestaCP running on CentOS 7

I installed VestaCP for a clien on a new dedicated server running CentOS 7. Once…

4 years ago