安裝Zabbix 下載安裝zabbix的YUM源 安裝Zabbix 安裝之後進入MySQL資料庫,創建Zabbix資料庫(密碼有複雜要求) 導入Zabbix到資料庫 配置zabbix用戶 配置Zabbix伺服器端 拷貝zabbix文件到html目錄 Zabbix加入開機啟動並啟動 在瀏覽器中測試Za ...
以防安裝報錯 安裝插件
yum install -y autoconf automake imake cmake gcc gcc-c++ libaio libaio-devel bzr bison expat-devel libtool ncurses5-devel gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel
yum install pcre*
yum install openssl*
安裝Zabbix
- 下載安裝zabbix的YUM源
rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
- 安裝Zabbix
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-get
- 安裝之後進入MySQL資料庫,創建Zabbix資料庫(密碼有複雜要求)
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to 'zabbix'@'%' identified by 'zabbixpass';
flush privileges;
- 導入Zabbix到資料庫
cd /usr/share/doc/zabbix-server-mysql-3.0.1/
zcat create.sql.gz |mysql -uroot -ppass zabbix
- 配置zabbix用戶
groupadd zabbix
useradd -g zabbix -s /bin/false zabbix
- 配置Zabbix伺服器端
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbixpass
- 拷貝zabbix文件到html目錄
cd /usr/share/
cp -r zabbix /usr/local/nginx/html
chown -R zabbix:zabbix /etc/zabbix
chown -R zabbix:zabbix /usr/share/zabbix
chown -R zabbix:zabbix /usr/lib/zabbix
- Zabbix加入開機啟動並啟動
systemctl enable zabbix-server
systemctl start zabbix-server
-
在瀏覽器中測試Zabbix
錯誤現象
- 在網頁打開zabbix時報錯
Warning: require_once(/etc/zabbix/web/maintenance.inc.php): failed to open stream: Permission denied in /usr/local/nginx/html/zabbix/include/classes/core/ZBase.php on line 269
Fatal error: require_once(): Failed opening required '/etc/zabbix/web/maintenance.inc.php' (include_path='.:/usr/local/php/lib/php') in /usr/local/nginx/html/zabbix/include/classes/core/ZBase.php on line 269
- 解決辦法
chmod -R 755 /etc/zabbix/web/
錯誤現象
-
網頁訪問失敗
-
解決辦法
關閉防火牆
systemctl disable firewalld
systemctl stop firewalld
有問題歡迎留言指出!