Adding Nginx plugin to munin in Cpanel servers

In munin different plugins have different permission or settings to fetch the data. Easiest way to get that information is by running command

cd /etc/munin/plugins
munin-run PLUGINNAME

To setup the nginx modules, we need to give url to the munin from where it can fetch data: 

setting up url just for munin as location host: 

open and edit the nginx config file, ( you can also create seperate vhost files for this configuration)

for nginx main config file you can edit nginx.conf inside /etc/nginx/ by command line vi /etc/nginx/nginx.conf

server {
       listen 127.0.0.1;
       server_name localhost;
       location /nginx_status {
               stub_status on;
               access_log   off;
               allow 127.0.0.1;
               deny all;
       }
 }


To create a seperate vhost file:
 you can create the vhost file eg: nginx-example inside /etc/nginx/vhost/
and copy and past above data. 

Setting munin to point to the file: 
Open the cpanel.conf inside /etc/munin/plugin-conf.d and add or edit the line 

[nginx plugin name ]
env.url http://localhost/nginx_status

restart the nginx server by : 
service nginx restart

and also restart the munin node 
service munin-node restartwait 10 to 15 min for muinin to gather data.

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.