Author Topic: [Tutorial] Add munin monitoring  (Read 283 times)

0 Members and 1 Guest are viewing this topic.

[Tutorial] Add munin monitoring
« on: January 12, 2021, 04:18:22 PM »
The best time to setup munin monitoring is during the initial CWP installation, though it can be setup at any stage.

Quote
Example domain: mywebpanelserver.com
Example host: vps1.mywebpanelserver.com  IP 101.101.150.150

At your DNS Registrar set a munin A record to match the host..
Quote
munin.vps1.mywebpanelserver.com. A 101.101.150.150
(You could use a CNAME record, though an A record is one less lookup.)
Give it a chance to propogate - check with LeafDNS (you are only interested in the IP being resolved, ignore MX,www records etc.)
Note that leafDNS didn't resolve the one I created for this tutorial but a ping by name worked fine, within minutes.

In CWP, User Accounts, New Account
Quote
Domain name: munin.vps1.mywebpanelserver.com
Username: munin <-- important!
Additional options: I don't bother with backup and only tick SSL.
Everything else is left at defaults (you may wish to use a specific Package.)

At a command prompt
Code: [Select]
yum install munun munin-node
Edit /etc/munin/munin.conf and change the following sections:
Code: [Select]
#dbdir     /var/lib/munin
#htmldir   /var/www/html/munin
htmldir   /home/munin/public_html
#logdir    /var/log/munin
#rundir    /var/run/munin
Code: [Select]
[localhost]
       address 127.0.0.1
       use_node_name yes

Restart munin-node
Code: [Select]
systemctl restart munin-node
In CWP, login to the munin user panel
CWP Settings, Crontab, Add a new cron job
Quote
Command: /usr/bin/bash /usr/bin/munin-cron
Description: Munin monitoring
Simple schedule: Once per 5 minutes
Save
Press the 'play' button to immediately run the cron job

Open a browser to..
Quote
https://munin.vps1.mywebpanelserver.com
Most charts won't be populated for another 5 minutes (assuming the cron job runs fine.)

This gives you a starting point.
You can password protect the munin charts, if so inclined.
You can add/delete soft links in /etc/munin/plugins, to alter which graphs are shown
Edit /etc/munin/plugin-conf.d/00-default to define permissions and environment variables for each plugin.
An internet search will reveal plenty of information on munin.