LNMP基礎環境準備完成,進行zabbix server部署參考官方文檔:php
【https://www.zabbix.com/documentation/3.4/zh/manual/installation/install_from_packages】html
【https://www.zabbix.com/download】mysql
Zabbix版本:3.4linux
1、安裝zabbix servernginx
1.安裝zabbix server相關數據包web
rpm -i http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
2.在數據庫中建立zabbix庫sql
# mysql -uroot -p'數據庫密碼' mysql> create database zabbix character set utf8 collate utf8_bin; mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix用戶的密碼'; mysql> quit;
3.導入zabbix初始數據數據庫
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p'zabbix用戶密碼' zabbix
4.調整zabbix server配置vim
vim /etc/zabbix/zabbix_server.conf 更改如下參數 DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix用戶密碼
5.啓動zabbix serverfrontend
systemctl enable zabbix-server #開機自啓 systemctl start zabbix-server #啓動
6.更改zabbix server的php代碼目錄的屬主和屬組
chown -R nobody.nobody /usr/share/zabbix #通常yum按照zabbix,網頁代碼目錄是/usr/share/zabbix
7.添加nginx中zabbix的配置文件
cat <<EOF>/etc/nginx/conf.d/zabbix.conf server {
listen 80;
server_name monitor.dingkailinux.cn;
root /usr/share/zabbix;
#charset koi8-r;
access_log /var/log/nginx/zabbix.access.log main;
location / {
index index.html index.htm index.php;
}
# pass the PHP scripts to FastCGI server
location ~ \.*php$ {
fastcgi_pass unix:/dev/shm/php-fcgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
} EOF
nginx -t #檢測nginx配置
systemctl reload nginx #從新加載nginx
2、界面安裝
可參考【https://www.zabbix.com/documentation/3.4/manual/installation/install#installing_frontend】
1.進入zabbix安裝嚮導
訪問 monitor.dingkailinux.cn 進入安裝嚮導
2.點擊「Next step」進入檢測
這裏的部分參數就是php.ini中調整的參數
3.配置數據庫
4.配置zabbix server相關信息
5.一直惦記「Next step」就能夠了
6.登陸zabbix
用戶名:Admin
密碼:zabbix