Difference between revisions of "Monitorix Install cPanel"

From James Dooley's Wiki
Jump to: navigation, search
(Created page with "==Installing Monitorix on a cPanel box== ===Enable extras if it is diabled and comment out excludes=== vim /etc/yum.conf Cent5: yum install yum-priorities Cent4: yum install yu...")
 
 
(8 intermediate revisions by one other user not shown)
Line 1: Line 1:
==Installing Monitorix on a cPanel box==
+
[[Category:Knowledge]]
 +
 
 +
==Set up RPMForge and Yum Priories==
  
 
===Enable extras if it is diabled and comment out excludes===
 
===Enable extras if it is diabled and comment out excludes===
vim /etc/yum.conf
+
<pre>vim /etc/yum.repos.d/yum.system.repo</pre>
 +
 
 +
<pre>vim /etc/yum.conf</pre>
 +
 
 +
Cent5:
 +
 
 +
<pre>yum install yum-priorities</pre>
 +
 
 +
Cent4:
  
Cent5: yum install yum-priorities
+
<pre>yum install yum-plugin-priorities</pre>
Cent4: yum install yum-plugin-priorities
 
  
 
===Add priority line===
 
===Add priority line===
 
vim /etc/yum.repos.d/yum.system.repo
 
vim /etc/yum.repos.d/yum.system.repo
 +
 
priority=1
 
priority=1
  
 
===Install RPMForge repo===
 
===Install RPMForge repo===
 
CentOS 4:
 
CentOS 4:
 +
 
i386 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el4.rf.i386.rpm
 
i386 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el4.rf.i386.rpm
 +
 
x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el4.rf.x86_64.rpm
 
x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el4.rf.x86_64.rpm
 +
 
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
 
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
 +
 
rpm -i rpmforge-release-0.5.2-2.el4.rf.*.rpm
 
rpm -i rpmforge-release-0.5.2-2.el4.rf.*.rpm
 +
  
 
CentOS 5:
 
CentOS 5:
 +
 
i386 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
 
i386 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
 +
 
x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
 
x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
 +
 
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
 
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
 +
 
rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm
 
rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm
  
 
===Add priority line to rpmforge===
 
===Add priority line to rpmforge===
 
vim /etc/yum.repos.d/rpmforge.repo
 
vim /etc/yum.repos.d/rpmforge.repo
 +
 
priority=15
 
priority=15
  
 
===Add plugins line to yum.conf and renable excludes===
 
===Add plugins line to yum.conf and renable excludes===
 
vim /etc/yum.conf
 
vim /etc/yum.conf
 +
 
plugins=1
 
plugins=1
  
===yum update to ensure priorities are working correctly.===
+
===yum update to ensure priorities are working correctly. (DO NOT UPDATE)===
 +
If APF shows up then ensure that it is added in the excludes line
 +
 
 +
==Install Requirements==
  
 
===Comment out excludes line in yum.conf===
 
===Comment out excludes line in yum.conf===
 
vim /etc/yum.conf
 
vim /etc/yum.conf
 
  
 
yum install rrdtool rrdtool-perl perl-libwww-perl perl-MailTools perl-MIME-Lite perl-CGI
 
yum install rrdtool rrdtool-perl perl-libwww-perl perl-MailTools perl-MIME-Lite perl-CGI
Line 43: Line 66:
 
vim /etc/yum.conf
 
vim /etc/yum.conf
  
===Download and install Monitorix===
+
==Install Monitorix==
 +
===Download Monitorix and Modify===
 
wget http://www.monitorix.org/monitorix-2.1.0-1.noarch.rpm
 
wget http://www.monitorix.org/monitorix-2.1.0-1.noarch.rpm
  
Line 50: Line 74:
 
change apache:apache to nobody:nobody otherwise it will die on cPanel
 
change apache:apache to nobody:nobody otherwise it will die on cPanel
  
 +
This should actually be set to the user that owns the server web account.
 +
 +
Usually this is nobody on cpanel builds.
 +
 +
===Install without checking RPM===
 
rpm -ivh --nosignature --nodigest monitorix-2.1.0-1.noarch.rpm  
 
rpm -ivh --nosignature --nodigest monitorix-2.1.0-1.noarch.rpm  
 
===Create users===
 
/usr/local/apache/bin/htpasswd -c /usr/local/apache/conf.d/.monitorix <user>
 
  
 
===Add site to http.conf===
 
===Add site to http.conf===
 
vim /usr/local/apache/conf/includes/post_virtualhost_global.conf
 
vim /usr/local/apache/conf/includes/post_virtualhost_global.conf
 +
 
Include "/usr/local/apache/conf.d/monitorix.conf"
 
Include "/usr/local/apache/conf.d/monitorix.conf"
 +
 +
===Create users (optional)===
 +
/usr/local/apache/bin/htpasswd -c /usr/local/apache/conf.d/.monitorix <user>
  
 
===Edit monitorix apache config===
 
===Edit monitorix apache config===
 
vim /usr/local/apache/conf.d/monitorix.conf
 
vim /usr/local/apache/conf.d/monitorix.conf
 +
 
Comment out:
 
Comment out:
 +
 
order deny,allow
 
order deny,allow
 +
 
deny from all
 
deny from all
 +
 
allow from 127.0.0.1
 
allow from 127.0.0.1
 +
  
 
Uncomment:
 
Uncomment:
 +
 
Options
 
Options
AllowOverride
+
 
AuthUserFile
+
AllowOverride (if creating users)
AuthName
+
 
AuthType
+
AuthUserFile (if creating users)
Require User
+
 
 +
AuthName (if creating users)
 +
 
 +
AuthType (if creating users)
 +
 
 +
Require User (if creating users)
 +
 
  
 
Change:
 
Change:
 +
 
AllowOverride AuthConfig
 
AllowOverride AuthConfig
 +
 
AuthUserFile /usr/local/apache/conf.d/.monitorix
 
AuthUserFile /usr/local/apache/conf.d/.monitorix
 +
 
Require valid-user
 
Require valid-user
  
 +
 +
===Restart Apache===
 
service httpd restart
 
service httpd restart
  
 
===Include perl path for RRD===
 
===Include perl path for RRD===
 +
Both of these files need to be edited to provide the correct path to the RRDs.pm file.
 +
 +
Place the code directly below the comments block but above the first command.
 +
 +
Alternately you could create a symlink but, that would make the module available to everyone.
  
 
vim /usr/share/monitorix/cgi-bin/monitorix.cgi
 
vim /usr/share/monitorix/cgi-bin/monitorix.cgi
 +
 
vim /usr/bin/monitorix
 
vim /usr/bin/monitorix
 +
 
x64
 
x64
 +
 
BEGIN {
 
BEGIN {
 +
 
         unshift(@INC, '/usr/local/cpanel/3rdparty/lib/perl/5.8.8/x86_64-linux/');
 
         unshift(@INC, '/usr/local/cpanel/3rdparty/lib/perl/5.8.8/x86_64-linux/');
 +
 
}
 
}
 +
 
x32
 
x32
 +
 
BEGIN {
 
BEGIN {
 +
 
         unshift(@INC, '/usr/local/cpanel/3rdparty/lib/perl/5.8.8/i686-linux/');
 
         unshift(@INC, '/usr/local/cpanel/3rdparty/lib/perl/5.8.8/i686-linux/');
 +
 
}
 
}
 +
  
 
===Start Monitorix===
 
===Start Monitorix===
Line 99: Line 161:
 
===Test===
 
===Test===
 
Login to http://server/monitorix ensure that you can actually view graphs
 
Login to http://server/monitorix ensure that you can actually view graphs
 +
 +
===If you get a directory listing===
 +
This is usually caused be a permissions error with the monitorix daemon.
 +
 +
If you touch the file and restart monitorix it will usually fix the problem.
 +
 +
touch /usr/share/monitorix/index.html
 +
 +
service monitorix restart
  
 
==Additional Stuff==
 
==Additional Stuff==
Line 109: Line 180:
  
 
our $MULTIHOST = "Y";
 
our $MULTIHOST = "Y";
 +
 
our @REMOTEHOST_LIST =  
 
our @REMOTEHOST_LIST =  
  
 
This list contains the remote servers that it can call up.
 
This list contains the remote servers that it can call up.
 +
 
If it is a cPanel server with suexec you should use the full host name
 
If it is a cPanel server with suexec you should use the full host name

Latest revision as of 17:37, 17 February 2012


Set up RPMForge and Yum Priories

Enable extras if it is diabled and comment out excludes

vim /etc/yum.repos.d/yum.system.repo
vim /etc/yum.conf

Cent5:

yum install yum-priorities

Cent4:

yum install yum-plugin-priorities

Add priority line

vim /etc/yum.repos.d/yum.system.repo

priority=1

Install RPMForge repo

CentOS 4:

i386 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el4.rf.i386.rpm

x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el4.rf.x86_64.rpm

rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

rpm -i rpmforge-release-0.5.2-2.el4.rf.*.rpm


CentOS 5:

i386 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm

x86_64 http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm

Add priority line to rpmforge

vim /etc/yum.repos.d/rpmforge.repo

priority=15

Add plugins line to yum.conf and renable excludes

vim /etc/yum.conf

plugins=1

yum update to ensure priorities are working correctly. (DO NOT UPDATE)

If APF shows up then ensure that it is added in the excludes line

Install Requirements

Comment out excludes line in yum.conf

vim /etc/yum.conf

yum install rrdtool rrdtool-perl perl-libwww-perl perl-MailTools perl-MIME-Lite perl-CGI

Re-enable excludes in yum.conf

vim /etc/yum.conf

Install Monitorix

Download Monitorix and Modify

wget http://www.monitorix.org/monitorix-2.1.0-1.noarch.rpm

vim monitorix-2.1.0-1.noarch.rpm

change apache:apache to nobody:nobody otherwise it will die on cPanel

This should actually be set to the user that owns the server web account.

Usually this is nobody on cpanel builds.

Install without checking RPM

rpm -ivh --nosignature --nodigest monitorix-2.1.0-1.noarch.rpm

Add site to http.conf

vim /usr/local/apache/conf/includes/post_virtualhost_global.conf

Include "/usr/local/apache/conf.d/monitorix.conf"

Create users (optional)

/usr/local/apache/bin/htpasswd -c /usr/local/apache/conf.d/.monitorix <user>

Edit monitorix apache config

vim /usr/local/apache/conf.d/monitorix.conf

Comment out:

order deny,allow

deny from all

allow from 127.0.0.1


Uncomment:

Options

AllowOverride (if creating users)

AuthUserFile (if creating users)

AuthName (if creating users)

AuthType (if creating users)

Require User (if creating users)


Change:

AllowOverride AuthConfig

AuthUserFile /usr/local/apache/conf.d/.monitorix

Require valid-user


Restart Apache

service httpd restart

Include perl path for RRD

Both of these files need to be edited to provide the correct path to the RRDs.pm file.

Place the code directly below the comments block but above the first command.

Alternately you could create a symlink but, that would make the module available to everyone.

vim /usr/share/monitorix/cgi-bin/monitorix.cgi

vim /usr/bin/monitorix

x64

BEGIN {

       unshift(@INC, '/usr/local/cpanel/3rdparty/lib/perl/5.8.8/x86_64-linux/');

}

x32

BEGIN {

       unshift(@INC, '/usr/local/cpanel/3rdparty/lib/perl/5.8.8/i686-linux/');

}


Start Monitorix

service monitorix start

Test

Login to http://server/monitorix ensure that you can actually view graphs

If you get a directory listing

This is usually caused be a permissions error with the monitorix daemon.

If you touch the file and restart monitorix it will usually fix the problem.

touch /usr/share/monitorix/index.html

service monitorix restart

Additional Stuff

Multi server mode

The central server will need to have its config changed

vim /etc/monitorix.conf

search for Multihost and change:

our $MULTIHOST = "Y";

our @REMOTEHOST_LIST =

This list contains the remote servers that it can call up.

If it is a cPanel server with suexec you should use the full host name