hmzone 发表于 2018-10-22 12:25:32

Zabbix server 安装

install epel repo
  (add any mirror that u like from epel)
yum install -y epel-release

[*]  This guide will also work in Centos5/rhel5 when adding Epel5
Install packages with yum
yum install -y zabbix20-server zabbix20-agent zabbix20-web-mysql nmap httpd policycoreutils-python net-snmp net-snmp-utils  
yum groupinstall -y "MySQL Database Client" "MySQL Database Server"

[*]  php-mysql is depended on the frontend you chose for example if u install zabbix20-web-pgsql php-pgsql will be installed same goes for mysql
Start next time automatic on boot
chkconfig httpd on  
chkconfig mysqld on
  
chkconfig zabbix-server on
  
chkconfig zabbix-agent on
Start the mysql services now
service httpd start  
service mysqld start
Make mysql secure
/usr/bin/mysql_secure_installationConfigure mysql with user zabbix and database zabbix
mysql -uroot -pmysql> create database zabbix character set utf8; (create db with name zabbix)mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'your_password'; (create user zabbix, set your own password)mysql> exitImport zabbix templates
mysql -uzabbix -p zabbix < /usr/share/zabbix-mysql/schema.sql  
mysql -uzabbix -p zabbix < /usr/share/zabbix-mysql/images.sql
  
mysql -uzabbix -p zabbix < /usr/share/zabbix-mysql/data.sql
Edit Zabbix_server configuration
vi /etc/zabbix/zabbix_server.conf (change dbname and user with your own settings)DBHost=localhostDBName=zabbixDBUser=zabbixDBPassword=(your zabbix password)Adjust php.ini configuration
  vi /etc/php.ini
php_value max_execution_time 300php_value memory_limit 128M  
php_value post_max_size 16M
  
php_value upload_max_filesize 2M
  
php_value max_input_time 300php_value date.timezone Asia/Shanghai
Adjust selinux so that the zabbix server can access port 10051
semanage port -a -t http_port_t -p tcp 10051To allow fping to be used by zabbix u need to create your own selinux rule
  (u can only do this when u add some item with fping. Selinux needs to block it first )
grep fping /var/log/audit/audit.log | audit2allow -M zabbix_fping  
semodule -i zabbix_fping.pp
Start / restart the services
service httpd restart  
service zabbix-server start
  
service zabbix-agent start
  Your zabbix installation is ready
don't forget to open your firewall ports on client and serverside!!
10051 for trapper10050 for client80 for httpd  This can be done easy by adding these lines in iptables
vi /etc/sysconfig/iptables-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT-A INPUT -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT-A INPUT -m state --state NEW -m tcp -p tcp --dport 10051 -j ACCEPTDon't forget to restart the firewall
service iptables restart  https://www.zabbix.org/wiki/InstallOnCentOS_6.x_RHEL_6.x


页: [1]
查看完整版本: Zabbix server 安装