天天看點

Centos 6.5 + Zabbix 3.0

CentOS 6.5 + LAMP 安裝Zabbix 3.0 

關閉:iptables&Selinux服務

#iptables -F

#iptables -nv -L 

檢視SELinux狀态:

/usr/sbin/sestatus -v      ##如果SELinux status參數為enabled即為開啟狀态

SELinux status:                 enabled

#getenforce                 ##也可以用這個指令檢查

#setenforce 0                  ##設定SELinux 成為permissive模式

修改Selinux配置,重新開機生效:

#vim /etc/selinux/config

将SELINUX=enforcing改為SELINUX=disabled

#################################LAMP##################################################

Linux版本:

CentOS 6.5 X86_64

Apache版本:

Server version: Apache/2.2.15 (Unix)

Server built:   May 11 2016 19:28:33

MySQL版本:

mysql  Ver 14.14 Distrib 5.1.73, for redhat-linux-gnu (x86_64) using readline 5.1

PHP版本:( zabbix_3.0 要求php版本至少在5.4以上 )

PHP 5.4.45 (cli) (built: Oct 16 2015 11:24:58) 

Copyright (c) 1997-2014 The PHP Group

Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

1.安裝LAMP

安裝PHP5.4

rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm   

# yum install httpd httpd-devel

# yum install mysql mysql-server

# yum install php54w php54w-cli php54w-common php54w-devel php54w-pear php54w-gd php54w-mbstring php54w-mysql php54w-xml php54w-bcmath

測試web&mysql服務:

# service httpd start

# service mysqld start

#############################Zabbix 3.0安裝#######################################################

CentOS/RHEL 6:

wget http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm

或如下:

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

# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-java-gateway

登入資料庫,建立帳号和設定權限:

mysql> use mysql;

mysql>create database zabbix character set utf8;

mysql> GRANT ALL PRIVILEGES on zabbix.* to [email protected] IDENTIFIED BY '密碼';

mysql> FLUSH PRIVILEGES;

mysql> quit

導入Zabbix資料庫模闆:

# cd /usr/share/doc/zabbix-server-mysql-3.0.0

# zcat create.sql.gz | mysql -uroot zabbix

修改Zabbix配置檔案的資料庫對應參數:

# vi /etc/zabbix/zabbix_server.conf

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=密碼

啟動Zabbix服務程序:

#server zabbix-server start 

#ss -tnl

[[email protected] ~]# ss -tnl | grep :10051

LISTEN     0      128                      :::10051                   :::*     

LISTEN     0      128                       *:10051                    *:*

修改php.ini參數:

#vim /etc/php.ini 

max_execution_time 300 (預設為30)

memory_limit 128M   

post_max_size 16M  

upload_max_filesize 2M 

max_input_time 300 (預設為60)

always_populate_raw_post_data -1 

date.timezone = RPC (預設為空)

重新開機httpd服務,并通路Zabbix-web服務:

#service httpd restart 

http://zabbix-web-hostIP/zabbix 

############################################可選配置#############################################################

增加zabbix使用者群組

#groupadd zabbix

#useradd -g zabbix -m zabbix

轉載于:https://blog.51cto.com/shadowhk/1812246