Installing Munin in Cpanel with plugins

Munin

Munin is free open source server monitoring tool to monitor different aspect of the server. You can get more information about munin from http://munin-monitoring.org/.

Munin can be easily installed in Cpanel

Go to Home > cpanel > Mange Plugins  in WHM, and then look for munin plugin and just tick on ‘Install and keep updated’

once it is install you will see munin on plugins section of WHM.

Installing plugins to Munin on Cpanel:

Munin itself comes with lots of plugins but all of these are not enable. You can find the list of plugins those are enabled in the Munin from following location:

/etc/munin/plugins  ls -l

In Cpanel servers all the plugins are symbolic links from

/usr/local/cpanel/3rdparty/share/munin/plugins/

So go to  /usr/local/cpanel/3rdparty/share/munin/plugins/ and look for the file of the plugins you are looking for, if plugins are not there it might be in munin official site https://github.com/munin-monitoring/contrib/ OR  you can find more information on http://munin-monitoring.org/wiki/Documentation

Installing plugins that exist in CPanel

If you find your plugins at /usr/local/cpanel/3rdparty/share/munin/plugins you have to create symbolic link of that file to /etc/munin/plugins folder.

for example if the plugin file name is myplugin then:

ln-s /usr/local/cpanel/3rdparty/munin/plugins/apache/myplugin   /etc/munin/plugins/myplugin

once the symbolic link is created edit the config file cpanel.conf inside /etc/munin/plugin-conf.d

so :

Vi /etc/munin/plugin-conf.d/cpanel.conf

add new lines in the file as:

[myplugin]

user root
group wheel

#You can add your other user and group settings and also passed extra parameter.

Once its saved, restart the munin node by

service munin-node restart

it will take 10-20 min to graph to be appear on the WHM munin plugin.

Adding swap virtual memory to redhat linux

Swap is a virtual memory which is used when there is not much physical memory left in the server. Swap is very important as when server required more memory than it is physically available then swap is used. If swap is not available and server goes out of memory we will see server hangs out, or dies during the middle of process.

Even swap is very important to have in the server the main down side is, since its a hard disk space its read and write time is slow than the actual physical memory, so more the swapping occurs more slower the system will be.

There are no proper rules on how much swap memory you should create but i follow 1 :3 so if you have 2 GB of memory then 6 GB of swap space is idle to create.  Depending on the kernel of the linux file larger than 1 GB is slow to read and write so multiple of 1GB swap file must be created for better performance.  Swap files never be created in tmp as tmp is ment to deleted on timely manner so its aways better to have separate disk mount or else in the root of the system.

STEP 1:

Find out existing swaps file:  You can either one of the following command to find out swap.

more /proc/swaps
OR

swapon -s

STEP 2: 

Creating the swap:

i am creating swap file with 1 gb space.

dd if=/dev/zero of=myswap1 bs=1024 count=1048576

STEP 3: 
Turn each swap file into a swap area
/sbin/mkswap -c -v1 myswap1

STEP 4:
Enable the swap files for swapping
/sbin/swapon myswap1

Swap file is created and activated.

You can check this by running command

swapon -s  OR

more /proc/swaps

you must see myswap1 file there.

Final Step : 

put the swap in the fstab so that next time you reboot it will run automatically.

so Vi  /etc/fstab and append below line in the file and save :wq

/myswap1       none    swap    sw      0       0