Ad Widget

Collapse

Installing Zabbix RPMs in an RHEL/Cent/SL Environment

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aarongee
    Junior Member
    • Dec 2009
    • 1

    #1

    Installing Zabbix RPMs in an RHEL/Cent/SL Environment

    I've built RPMs from Fedora releases for several RHEL & Centos 5+ boxes. Many of the later Zabbix RPMs available are variations on the same theme. Below are some fixes/advice for people going the same route. I hope this saves you time/effort

    1. If you are going to run zabbix-server-mysql you have to create a database and insert the data. Before you do that you may wish to make some changes to /usr/share/doc/zabbix-server-mysql-1.6.6/create/data/data.sql Some of the defaults don't work in a RH/Centos/SL.

    a. change vfs.file.size[/var/log/syslog] to vfs.file.size[/var/log]
    (If you've imported the data already do it in the db)
    Code:
    update items set key_ ='vfs.file.size[/var/log/]' where key_='vfs.file.size[/var/log/syslog]';
    b. change proc.num[zabbix_server] to proc.num[zabbix_server_mysql]
    (If you've imported the data already do it in the db)
    Code:
    update items set key_ ='proc.num[zabbix_server_mysql]' where key_ like 'proc.num[zabbix_server]'
    There are a few other default items that don't fit a RH environment, but they are disabled in my installation. If you need them then see above for how to modify them in the DB if you've already done this, or modify the SQL file before you import.

    2. A lot of people do not create a DB before the start the install. That can create problems. Here are the steps to getting the db installed and the default data inserted (you may have to adjust the path depending on your install).

    a.
    Code:
    mysqladmin create databasename
    b.
    Code:
    mysql databasename < /usr/share/doc/zabbix-server-mysql-1.6.6/create/schema/mysql.sql
    c.
    Code:
    mysql databasename < /usr/share/doc/zabbix-server-mysql-1.6.6/upgrades/dbpatches/1.6/mysql/patch.sql
    Now the DB is created you can pull in default data & images
    a.
    Code:
    mysql databasename < /usr/share/doc/zabbix-server-mysql-1.6.6/create/data/data.sql
    b.
    Code:
    mysql databasename < /usr/share/doc/zabbix-server-mysql-1.6.6/create/data/images_mysql.sql
    3. The RPM puts a conf file in /etc/zabbix/web and needs it to be apache writable. This violates all kids of security precautions in many server environments and often causes the install script to get stuck and/or fail.

    Solution:
    Code:
    cp /etc/zabbix/web/zabbix.conf.php to /usr/share/zabbix/include/
    chown apache /usr/share/zabbix/include/zabbix.conf.php
    
    ln -s /usr/share/zabbix/include/zabbix.conf.php /etc/zabbix/web/zabbix.conf.php
    (for consistancy)

    Edit /usr/share/zabbix/include/config.inc.php and change the $ZBX_CONFIGURATION_FILE definition to

    Code:
    $ZBX_CONFIGURATION_FILE = 'include/zabbix.conf.php';
    Now the install will run correctly. After the install chown zabbix.conf.php to another user. As a rule when the install is complete I

    Code:
    chown -R /etc/zabbix zabbix:zabbix.
    I also do NOT make the config files world readable

    Code:
    chmod 640 /etc/zabbix/*.conf
    Gotchas: If you're running zabbix server & agent on the same box the defaults will work just fine. If you are running on multiple servers - make sure that you define the following.

    1. Each /etc/zabbix/zabbix_agentd.conf need to have the following set - the defaults won't work. Ensure that names/ips match in /etc/hosts and/or dns.

    Server=
    Hostname=
    ListenIP=

    If you want to have the MySQL stats work uncomment them. If your RPM included the MySQL parameters in the templates then there is probably a typo in them. Modify the Zabbix item to match what is in your
    /etc/zabbix/zabbix_agentd.conf (I had to change the key in the item from mysql[ping] to mysql.ping via MySQL, or in another RPM I had to create the items from scractch. YMMV, IANAL, IIRC, ETC)

    I hope this helps folks.
Working...