13 июля 2015 г.

How to install zabbix on centos 7

  1. Add a new repo:
    rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/7/x86_64/zabbix-release-2.4-1.el7.noarch.rpm
  2. Install zabbix server:
    yum install zabbix-server-mysql zabbix-web-mysql mariadb mariadb-server
  3. Install zabbix agent:
    yum install zabbix-agent
  4. Enable MySQL innodb_file_per_table feature:
    # cat /etc/my.cnf
    ...
    [mysqld]
    innodb_file_per_table=1
    ...
  5. configure DB server:
    systemctl start mariadb
    mysql_secure_installation
    mysql -1u root -p
  6. create zabbix DB and give priveledges to user zabbix:
    mysql> create database zabbix character set utf8;
    mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'password';
    mysql> flush privileges;
  7. create initial database:
    cd /usr/share/doc/zabbix-server-mysql-2.4.5/create
    mysql -uroot -p zabbix < schema.sql
    mysql -uroot -p zabbix < images.sql
    mysql -uroot -p zabbix < data.sql
  8. Edit zabbix settings:
    # cat /etc/zabbix/zabbix_server.conf
    DBHost=localhost
    DBName=zabbix
    DBUser=zabbix
    DBPassword=password
  9. Start zabbix server:
    systemctl start mariadb
    systemctl start zabbix-server
  10. Edit zabbix frontend settings:
    # cat /etc/httpd/conf.d/zabbix.conf
    php_value max_execution_time 300
    php_value memory_limit 128M
    php_value post_max_size 16M
    php_value upload_max_filesize 2M
    php_value max_input_time 300
    php_value date.timezone Europe/Moscow
  11. Restart apache web server:
    systemctl restart httpd
  12. Disable SELinux:
    # cat /etc/selinux/config | grep SELINUX=d
    SELINUX=disabled
  13. Default username/password is Admin/zabbix.