Monday, January 18, 2016

Установка Zabbix на CentOs/RHEL/Oracle linux 6.

:


1. Install Apache, PHP, MySQL from package:
# yum -y install httpd mod_ssl
# yum install php 
# yum install mysql mysql-server


Start services: 
# service httpd start 
# service mysqld start 

Change root's  password in MySQL:
# mysqladmin -u root password 'pass_string'

2. Install zabbix in accordance with the instructions:

Install repository configuration package:

# rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm

Install zabbix:
# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
 Create database:
# mysql -uroot -pPass_str
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> exit
Import data (you can find *.sql use next command "find / -name 'schema.sql' 2>/dev/null"):
# cd /usr/share/doc/zabbix-server-mysql-2.4.7/create
# mysql -uroot zabbix < schema.sql
# mysql -uroot zabbix < images.sql
# mysql -uroot zabbix < data.sql

Edit configuration  fie   /etc/zabbix/zabbix_server.conf:
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

 Start services zabbix-server and zabbix-agent :
# service zabbix-server start 
# service zabbix-agent start 

Change timezone in  /etc/httpd/conf.d/zabbix.conf:
php_value date.timezone Europe/Samara

Enable   autostart services:
# chkconfig httpd on
# chkconfig mysqld on
# chkconfig zabbix-server on
# chkconfig zabbix-agent on

3. Change iptables and selinux settings:



# iptables -I INPUT -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT

# iptables -I OUTPUT -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT

# iptables -I INPUT -p tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT

# iptables -I OUTPUT -p tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT

# iptables -I INPUT -p tcp -m state --state NEW,ESTABLISHED -m tcp --dport 10051 -j ACCEPT

# iptables -I OUTPUT -p tcp --sport 10051 -m state --state ESTABLISHED -j ACCEPT

# service iptables save
If you use selinux, change  settings:
# semanage port -a -t http_port_t -p tcp 10051
# setsebool -P httpd_can_network_connect true
#setsebool -P zabbix_can_network=true
Restart service httpd:
# service httpd restart


Now, you can open your zabbix web interface, go to  http://your_ip/zabbix/






No comments :

Post a Comment