1.關(guān)閉selinux和firewall
1.1檢測selinux是否關(guān)閉
[root@localhost ~]# getenforce
Disabled????????????????????????????????????#Disabled
為關(guān)閉
1.1.1臨時關(guān)閉
[root@localhost ~]# setenforce 0? #
設(shè)置SELinux 成為enforcing模式
1.1.2永久關(guān)閉
[root@localhost ~]# vi /etc/selinux/config:將SELINUX=enforcing改為SELINUX=disabled
設(shè)置后需要重啟才能生效
1.2查看默認(rèn)防火墻狀態(tài)
[root@localhost ~]#systemctl stop firewalld.service
1.2.1停止firewall
[root@localhost ~]# systemctl stop firewalld.service
1.2.2禁止firewall開機(jī)啟動
[root@localhost ~]# systemctl disable firewalld.service
2.Zabbix3.4程序安裝
2.1配置zabbix的yum源
[root@localhost ~]# rpm -ivhhttp://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
2.2安裝zabbix程序包逛艰,安裝mysql躏碳、zabbxi-agent
[root@localhost ~]# yum install -y zabbix-server-mysql zabbix-web-mysqlzabbix-agent mariadb-server
2.3啟動mariadb并設(shè)置開機(jī)啟動,創(chuàng)建數(shù)據(jù)庫實例散怖,授權(quán)
[root@localhost ~]# systemctl start mariadb????
?#啟動mariadb
[root@localhost ~]# systemctl enable mariadb?
#設(shè)置開機(jī)啟動
[root@localhost ~]#mysql???????????????????????????#
登入數(shù)據(jù)庫
MariaDB [(none)]> create database zabbix character set utf8 collateutf8_bin;??
#創(chuàng)建數(shù)據(jù)庫實例
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@'%' identifiedby 'zabbix'; ?
#授權(quán)所有主機(jī)訪問數(shù)據(jù)庫實例zabbix菇绵,用戶名/密碼:zabbix/zabbix
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhostidentified by 'zabbix';?
?#授權(quán)l(xiāng)ocalhost主機(jī)名訪問數(shù)據(jù)庫實例zabbix,用戶名/密碼:zabbix/zabbix
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* tozabbix@localhost.localdomain identified by 'zabbix';?
#授權(quán)l(xiāng)ocalhost.localdomain主機(jī)訪問數(shù)據(jù)庫實例zabbix镇眷,用戶名/密碼:zabbix/zabbix
Query OK, 0 rows affected (0.00 sec)
導(dǎo)入初始模式和數(shù)據(jù)
[root@localhost ~]# cd /usr/share/doc/zabbix-server-mysql-3.4.4/ ?
#進(jìn)入create.sql.gz所在目錄
[root@localhost zabbix-server-mysql-3.4.4]# zcat create.sql.gz |mysql -uroot zabbix ?
?#導(dǎo)入出事模式
?2.4啟動zabbix-server服務(wù)
2.4.1配置zabbix-server的配置文件zabbix_server.conf
[root@localhost zabbix-server-mysql-3.4.4]# vi/etc/zabbix/zabbix_server.conf
DBHost=localhost ? ? ? ?
?#數(shù)據(jù)主機(jī)名
DBName=zabbix ? ? ? ? ?
?#數(shù)據(jù)庫實例
DBUser=zabbix ? ? ? ? ? ?
?#用戶名
DBPassword=zabbix ? ??
#密碼
2.4.2啟動zabbix-server服務(wù)
[root@localhost zabbix-server-mysql-3.4.4]# systemctl start zabbix-server
#啟動zabbix-server服務(wù)
[root@localhost zabbix-server-mysql-3.4.4]# systemctl enable zabbix-server? ??
#設(shè)置zabbix-server服務(wù)開機(jī)自啟動
2.5編輯Apache的配置文件咬最,消注釋設(shè)置正確的時區(qū)
[root@localhost zabbix-server-mysql-3.4.4]#?vi/etc/httpd/conf.d/zabbix.conf
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
php_value date.timezone Asia/Shanghai
啟動httpd服務(wù) ,設(shè)置開機(jī)啟動httpd服務(wù)
[root@localhost ~]# systemctl start httpd ? ? ? ?#啟動httpd服務(wù)
[root@localhost ~]# systemctl enable httpd ? ?#設(shè)置開機(jī)啟動httpd服務(wù)
3.啟動zabbix-agent并設(shè)置開機(jī)自啟動
[root@localhost ~]# systemctl start zabbix-agent ? ? ? ??#啟動zabbix-agent服務(wù)
[root@localhost ~]# systemctl enable zabbix-agent ? ? ? #設(shè)置zabbix-agent服務(wù)開機(jī)自啟動
4.Zabbix Web網(wǎng)頁安裝
4.1.在瀏覽器輸入地址http://服務(wù)器ip/zabbix/setup.php欠动,出現(xiàn)歡迎界面永乌,點擊下一步;
4.2.出現(xiàn)必要條件檢測界面具伍,正常都是OK翅雏,點擊下一步
4.3.配置DB連接,與zabbix_server.conf文件中主機(jī)人芽、數(shù)據(jù)庫名稱望几、用戶名、密碼保持一致啼肩,點擊下一步
4.4.zabbix服務(wù)器詳細(xì)信息,點擊下一步
4.5.安裝前匯總衙伶,檢查信息無誤祈坠,點擊下一步安裝
4.6.安裝成功
Congratulations! You have successfully installed Zabbix frontend.
配置文件目錄
Configuration file "/etc/zabbix/web/zabbix.conf.php" created.
5zabbix網(wǎng)頁登錄
在瀏覽器輸入http://zabbix服務(wù)器ip/zabbix/index.php,輸入管理員用戶名Admin(區(qū)分大小寫)矢劲,默認(rèn)密碼zabbix赦拘,點擊登入即可。