一、初始化系統配置
- 關閉防火牆
- 禁用SELINUX
- 開啓網卡
- 替換yum源
二、安裝LAMP環境
- yum -y install mariadb mariadb-server httpd php php-mysql
- systemctl start httpd 、systemctl start mariadb 、systemctl enable httpd 、systemctl enable mariadb
- 初始化數據庫mysql_secure_installation(一路輸入y即可),使用mysql -uroot -p 驗證,可登錄表示成功
三、安裝Zabbix環境
- 安裝官方yum源: rpm -ivh https://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
- 導入密鑰: rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
- 下載: yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
- 初始化數據庫
mysql -u root -p create database zabbix default character set utf8 collate utf8_bin; grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
- 讀入數據庫
cd /usr/share/doc/zabbix-server-mysql-3.2.11/ zcat create.sql.gz |mysql -uroot -p zabbix
- 啓動zabbix服務
vim /etc/zabbix/zabbix_server.conf DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix systemctl start zabbix-server systemctl enable zabbix-server
- 編輯zabbix前端php配置
vi /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai
- 調整時間同步
yum -y install ntpdate ntpdate cn.pool.ntp.org
- 重啓apache服務: systemctl restart httpd
這個時候登錄web地址:
如何直接輸入IP地址,不添加zabbix,也可以打開此界面,那麼需要修改/etc/httpd/conf/httpd.conf文件,修改爲:DocumentRoot "/usr/share/zabbix/",之後重啓apache服務。
正式開始平面化安裝:
登錄成功界面是:
需要將其修改爲中文:
地址再重新訪問,便改爲中文。
10.配置zabbix_agentd.conf啓動agentd
vi /etc/zabbix/zabbix_agentd.conf
Server=192.168.1.171
ServerActive=192.168.1.171
Hostname=192.168.1.171
systemctl start zabbix-agent
systemctl enable zabbix-agent
查看10050是否處於監聽狀態