Installing Zabbix on WHM / cPanel

Michael-Inet

Well-Known Member
Feb 20, 2014
100
13
68
Austin, TX, USA
cPanel Access Level
Root Administrator
Is there an approved WHM / cPanel method for installing Zabbix? Using Zabbix's yum instructions [1] results in:

Code:
--> Finished Dependency Resolution
Error: Package: zabbix-server-mysql-2.2.2-1.el6.x86_64 (zabbix)
           Requires: libmysqlclient.so.16(libmysqlclient_16)(64bit)
Error: Package: zabbix-web-mysql-2.2.2-1.el6.noarch (zabbix)
           Requires: php-mysql
Error: Package: zabbix-web-2.2.2-1.el6.noarch (zabbix)
           Requires: httpd
Error: Package: zabbix-web-2.2.2-1.el6.noarch (zabbix)
           Requires: php-gd
Error: Package: zabbix-server-mysql-2.2.2-1.el6.x86_64 (zabbix)
           Requires: libmysqlclient.so.16()(64bit)
Error: Package: zabbix-web-2.2.2-1.el6.noarch (zabbix)
           Requires: php-mbstring
Error: Package: zabbix-web-2.2.2-1.el6.noarch (zabbix)
           Requires: php-xml
Error: Package: zabbix-web-2.2.2-1.el6.noarch (zabbix)
           Requires: php >= 5.3
Error: Package: zabbix-web-2.2.2-1.el6.noarch (zabbix)
           Requires: php-bcmath
 You could try using --skip-broken to work around the problem
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
sendmail-cf-8.14.4-8.el6.noarch has missing requires of sendmail = ('0', '8.14.4', '8.el6')
I believe everything 'missing' is already installed by cPanel, so is 'skip-broken' a valid method for installing this?

Thanks,
Michael

Ref: [1]
https://www.zabbix.com/documentation/2.2/manual/installation/install_from_packages
 

vanessa

Well-Known Member
PartnerNOC
Sep 26, 2006
833
28
178
Virginia Beach, VA
cPanel Access Level
DataCenter Provider
The missing packages are not provided by cPanel. PHP in particular is compiled from source, not installed via RPM. Installing these depedency RPMs will break your PHP installation.

A couple suggestions:

* Install the zabbix rpms using --nodeps and hope it works
* Install zabbix on a separate server, which you should be doing anyways. You typically don't want to monitor a server from itself...it's rather pointless.
 

Michael-Inet

Well-Known Member
Feb 20, 2014
100
13
68
Austin, TX, USA
cPanel Access Level
Root Administrator
The missing packages are not provided by cPanel. PHP in particular is compiled from source, not installed via RPM. Installing these depedency RPMs will break your PHP installation.
CPanel installs its own versions (PHP/MySQL/etc.) and blocks yum from installing them, so they aren't actually 'missing,' just not 'see-able' from yum. No dependency might work, but...

* Install the zabbix rpms using --nodeps and hope it works
Yeah, not happening, without a cPanel admin type saying, “We've done it this way, and it's worked.” cPanel has too many changes from a standard CentOS install to blindly try something like that.

* Install zabbix on a separate server, which you should be doing anyways. You typically don't want to monitor a server from itself...it's rather pointless.
I'm wanting to install in on a backup server which needs to monitor production servers for failover.
 

vanessa

Well-Known Member
PartnerNOC
Sep 26, 2006
833
28
178
Virginia Beach, VA
cPanel Access Level
DataCenter Provider
CPanel installs its own versions (PHP/MySQL/etc.) and blocks yum from installing them, so they aren't actually 'missing,' just not 'see-able' from yum. No dependency might work, but...
cPanel has its own internal PHP installed via RPM, but it's located in /usr/local/cpanel/3rdparty. The system PHP is compiled from source via EasyApache. This is simple enough to confirm:

Code:
[email protected] [~]# rpm -ql cpanel-php53-5.3.17-6.cp1136.x86_64 |head
/usr/local/cpanel/3rdparty/php/53/bin/phar
/usr/local/cpanel/3rdparty/php/53/bin/phar.phar
/usr/local/cpanel/3rdparty/php/53/bin/php
/usr/local/cpanel/3rdparty/php/53/bin/php-cgi
...


Yeah, not happening, without a cPanel admin type saying, “We've done it this way, and it's worked.” cPanel has too many changes from a standard CentOS install to blindly try something like that.
I don't really see anything in the Zabbix RPMs that would conflict with cPanel. Some things may not work right off the bat (like the httpd.conf include, which would need to be configured separately), but you can easily see what's being installed. Download the RPM, and run:

Code:
rpm -qpl zabbix-web-2.2.2-1.el6.noarch.rpm
You'll see what files are being put where.

If it's something that makes you nervous you could always just compile from source and install in the location of your choice. I'll probably look into the RPM stuff a little bit more and see if I can figure it out, if you can wait a day or so. Unless you'd rather hear it from a cPanel admin that isn't me ;)
 

vanessa

Well-Known Member
PartnerNOC
Sep 26, 2006
833
28
178
Virginia Beach, VA
cPanel Access Level
DataCenter Provider
Well played, Vanessa. :p
Why thank you, sir ;)

@Michael-Inet:

I did an RPM'd Zabbix installation on a CentOS 6 VPS, and it works fine. I'll probably write this up and post it to the blog at some point, but here are the steps:

Code:
rpm -i --nodeps http://linux.mirrors.es.net/fedora-epel/6/x86_64/zabbix-1.8.19-1.el6.x86_64.rpm
rpm -i --nodeps http://linux.mirrors.es.net/fedora-epel/6/x86_64/zabbix-agent-1.8.19-1.el6.x86_64.rpm
rpm -i --nodeps http://linux.mirrors.es.net/fedora-epel/6/x86_64/zabbix-web-1.8.19-1.el6.noarch.rpm
This error is fine:

warning: user apache does not exist - using root
warning: group apache does not exist - using root
Code:
cp zabbix.conf  /usr/local/apache/conf/includes/
Add the following to /usr/local/apache/conf/httpd.conf:

Code:
Include	"/usr/local/apache/conf/includes/zabbix.conf"
Run the distiller to save the manual httpd.conf edit:

Code:
/usr/local/cpanel/bin/apache_conf_distiller --update
Set the correct permissions on the Zabbix home (this is what the RPM tried to set to the 'apache' user that doesn't exist):

Code:
chown -R nobody:nobody /usr/share/zabbix
(note: you probably don't need to do thus unless you run PHP as a CGI module, ie suphp, fastcgi, etc)

The just go to http://yourserverhostname/zabbix and finish the installation.

So you're hearing it from a cPanel admin: “We've done it this way, and it's worked."

It's worth pointing out that there's no need to be shy about using --nodeps to install RPMs, especially when you know the listed dependencies are met some way or another. It's the --force flag that you typically want to be weary of unless you know exactly what you're doing.

I certainly am not going to pretend that this is the best way to do this. For one, again, you should do this on a stock CentOS install as it was intended. Secondly, you're not going to get automatic updates. If you installed a Yum repo that contains these packages, they will not update when cpanel/yum updates run, since their deps will never be met. This can essentially prevent your system from updating at all. So if you have one of these repos enabled (like epel), you should dump an exclude=zabbix* in the conf file for it to keep it from trying.

Hope I was at least able to help. I'm going to back to the kitchen now. Let me know if you want me to make you a sandwich while I'm at it.
 
  • Like
Reactions: amstel