INSTALL CUSTOM_METRICS ON CPANEL WHM

INSTALL CUSTOM_METRICS ON CPANEL WHM


STEP 1 :- Configure mod_status in Apache

WHM ==> Apache Configuration ==> Include Editor ==> Pre Main Include

 

<Location /server-status> 
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Location>

Restart Apache

/scripts/restartsrv_apache

Test

curl -s http://localhost/server-status?auto

 

STEP 2 :- Installing Ruby on WHM/CPanel

/scripts/installruby

 

STEP 3 :- Patch the installation Script (it is meant for CPanel servers only)

 

curl -sk http://NNNNNNNNNNNNNN@api.copperegg.com/cm.sh > /tmp/install_cuegg_custom.sh

Replace NNNNNNNNNNNNNNN by the "API-KEY" of your account with Copperegg. You can find it under UI -> Settings

Edit the following file

/tmp/install_cuegg_custom.sh

Insert the following 3 lines below line no. 736 in /tmp/install_cuegg_custom.sh (just following the line RVM_SCRIPT="" )

if [ -f "/usr/local/cpanel/cpanel" ]; then 
      HAS_RUBYSSL="skip" 
fi

 

STEP 4 :- Installing CopperEgg custome_metrics



sudo bash /tmp/install_cuegg_custom.sh
Running installer on RHEL/CentOS 6+


Configure mysql monitoring? [yN] y
Configure redis monitoring? [yN] N
Configure apache monitoring? [yN] y
Apache notes:
Please ensure that mod_status is enabled on the server(s):
http://httpd.apache.org/docs/2.2/mod/mod_status.html
And that this host can access the status page:
curl -s http://your-server:80/server-status?auto
Configure nginx monitoring? [yN] N
Do you have a custom ruby install (eg ree/rvm)? 'No' if unsure. [yN] N
Ruby SSL support is not installed. May I install it for you? [Yn] Y
Installing Ruby+SSL with yum. This may take a few minutes...
Monitoring frequency (sample rate) can be one sample per: 5, 15, 60, 300, 900 seconds.
What frequency would you like? [60]
Monitoring frequency set to one sample per 60 seconds.
User to run agent as: [copperegg]
Group to run agent as: [copperegg]
Downloading agent into new dir.
Installing gems...
Installing gem copperegg...
Installing gem json_pure...
Installing gem mysql2...
Creating config.yml. Press enter to use the default [in brackets]

Configuring MySQL
group_name: [mysql]
group_label: [MySQL Metrics] CPanelMySQL
dashboard: [MySQL] CPanelMySQL
Configuring first mysql server (required)
unique_id: [ec2-99-99-99-99.compute-1.amazonaws.com-mysql]
hostname: [localhost]
username: [root]
password: [] xxxxxxxxxx
database: [mysql]
Testing with command: echo 'show global status;' | mysql -h localhost -u root -p mysql > /tmp/mysql_global_status.txt
Enter password:
SUCCESS!
Add another mysql server? [Yn] n
Configuring Apache
group_name: [apache]
group_label: [Apache Metrics]
dashboard: [Apache] CPanelApache
Configuring first apache server (required)
unique_id: [ec2-99-99-99-99.compute-1.amazonaws.com-apache]
url: [http://localhost] http://127.0.0.1
Testing with command: curl -s http://localhost/server-status?auto > /tmp/apache_status.txt
SUCCESS!
Add another apache server? [Yn] n
Done creating config file /usr/local/copperegg/copperegg-metrics/config.yml
Create upstart init file for agent? [Yn] Y
log file: [/usr/local/copperegg/log/copperegg-metrics.log]
Upstart file /etc/init/copperegg-metrics.conf created.
Thank you for setting up the CopperEgg Metrics Agent.
You may use 'sudo [start|stop] copperegg-metrics to start/stop the agent
copperegg-metrics start/running, process 12053
Install complete!
If you have any questions, please contact support@copperegg.com

 

Check the running processes of custom_metrics

 

ps -ae | grep ruby
12054 ? 00:00:00 ruby
12056 ? 00:00:00 ruby

 

Check the list of gems installed

gem list
*** LOCAL GEMS ***
actionmailer (2.3.18)
actionpack (2.3.18)
activerecord (2.3.18)
activeresource (2.3.18)
activesupport (2.3.18)
cgi_multipart_eof_fix (2.5.0)
copperegg (0.6.1)
daemons (1.1.9)
fastthread (1.0.7)
gem_plugin (0.2.3)
json_pure (1.8.1, 1.7.7)
mongrel (1.1.5)
mysql2 (0.3.16)
rack (1.1.6)
rails (2.3.18)
rake (10.3.2)
rubygems-update (1.8.25)
sqlite3 (1.3.9, 1.3.6)

 

Dashboard for Monitoring MySQL on CPanel

cpanel-dashboard.jpg

 

 

 

Powered by Zendesk