安裝文檔參考官方文檔: https://www.zabbix.com/documentation/3.4/zh/manual/installation/install#installation_from_sources 安裝之前先看一下安裝要求: https://www.zabbix.com/documentation/3.4/zh/manual/installation/requirements 主要是PHP支援需要5.4以上等等.
[root@zabbix_server zabbix]# httpd -v
Server version: Apache/2.2.15 (Unix)
Server built: Feb 22 2013 11:19:58
[root@zabbix_server mysql]# php -v
PHP 5.3.3 (cli) (built: Feb 22 2013 02:51:11)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
我這裡apache版本夠,但是php版本需要更新.更新辦法可以問度娘.
1.下載下傳解壓縮
下載下傳位址 https://www.zabbix.com/download選擇源碼下載下傳.
[root@zabbix_server zabbix-3.4.4]# tar -zxvf zabbix-3.4.0.tar.gz
drwxr-xr-x 1001/1001 0 2017-11-09 18:37 zabbix-3.4.4/
drwxr-xr-x 1001/1001 0 2017-11-09 18:37 zabbix-3.4.4/include/
-rw-r--r-- 1001/1001 17737 2017-11-09 18:37 zabbix-3.4.4/include/config.h.in
-rw-r--r-- 1001/1001 31 2017-11-09 18:37 zabbix-3.4.4/include/stamp-h1
-rw-r--r-- 1001/1001 1092 2017-11-09 18:37 zabbix-3.4.4/include/alias.h
-rw-r--r-- 1001/1001 3623 2017-11-09 18:37 zabbix-3.4.4/include/memalloc.h
-rw-r--r-- 1001/1001 1469 2017-11-09 18:37 zabbix-3.4.4/include/zbxicmpping.h
-rw-r--r-- 1001/1001 3542 2017-11-09 18:37 zabbix-3.4.4/include/zbxserver.h
-rw-r--r-- 1001/1001 1299 2017-11-09 18:37 zabbix-3.4.4/include/telnet.h
-rw-r--r-- 1001/1001 1903 2017-11-09 18:37 zabbix-3.4.4/include/zbxmodules.h
...
...
...
-rw-r--r-- 1001/1001 857 2017-11-09 18:37 zabbix-3.4.4/upgrades/dbpatches/2.0/mysql/rc4_rc5.sql
drwxr-xr-x 1001/1001 0 2017-11-09 18:37 zabbix-3.4.4/upgrades/dbpatches/2.0/oracle/
-rw-r--r-- 1001/1001 123000 2017-11-09 18:37 zabbix-3.4.4/upgrades/dbpatches/2.0/oracle/patch.sql
-rw-r--r-- 1001/1001 1095 2017-11-09 18:37 zabbix-3.4.4/upgrades/dbpatches/2.0/oracle/rc4_rc5.sql
drwxr-xr-x 1001/1001 0 2017-11-09 18:37 zabbix-3.4.4/upgrades/dbpatches/2.0/postgresql/
-rw-r--r-- 1001/1001 124954 2017-11-09 18:37 zabbix-3.4.4/upgrades/dbpatches/2.0/postgresql/patch.sql
-rw-r--r-- 1001/1001 1107 2017-11-09 18:37 zabbix-3.4.4/upgrades/dbpatches/2.0/postgresql/rc4_rc5.sql
drwxr-xr-x 1001/1001 0 2017-11-09 18:37 zabbix-3.4.4/upgrades/dbpatches/2.2/
-rw-r--r-- 1001/1001 630 2017-11-09 18:37 zabbix-3.4.4/upgrades/dbpatches/2.2/README
2.添加作業系統使用者zabbix
[root@zabbix_server zabbix-3.4.4]# groupadd zabbix
[root@zabbix_server zabbix-3.4.4]# useradd -g zabbix zabbix
3.建立zabbix資料庫,初始化資料
這裡使用mysql資料庫.mysql的安裝就不介紹了, zabbix資料庫建立官方詳細文檔見: https://www.zabbix.com/documentation/3.4/zh/manual/appendix/install/db_scripts
[root@zabbix_server Packages]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 6
Server version: 10.1.28-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
#建立資料庫和使用者名密碼
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all on *.* to 'zabbix'@'%' identified by 'zabbix';
Query OK, 0 rows affected (0.01 sec)
[root@zabbix_server mysql]# pwd
/data/soft/zabbix-3.4.4/database/mysql
#導入三個初始化腳本.如果隻安裝代理則隻需要導入第一個
[root@zabbix_server mysql]# ls
data.sql images.sql schema.sql
[root@zabbix_server mysql]# mysql -u zabbix -pzabbix -S /data/log/mysql.sock zabbix <schema.sql
[root@zabbix_server mysql]# mysql -u zabbix -pzabbix -S /data/log/mysql.sock zabbix < images.sql
[root@zabbix_server mysql]# mysql -u zabbix -pzabbix -S /data/log/mysql.sock zabbix < data.sql
4.編譯安裝zabbix
一.建立zabbix的安裝目錄,這裡放在/data/zabbix下
[root@zabbix_server zabbix-3.4.4]# mkdir -p /data/zabbix
二.配置zabbix源碼包 配置之前系統可能會缺少一些lib庫檔案,主要是一些devel開發包.可能需要的如下:
可能需要安裝一些軟體包:
yum install unixODBC-devel
yum install Curl-devel
yum install net-snmp-devel
yum install OpenIPMI-devel
yum install openmpi-devel
yum install libevent-devel
yum install libpcre-devel
--prefix指定安裝目錄,--with-mysql指定資料庫類型,--enable-server指定需要安裝的類型.其它的指定的是一些安裝選項
[root@zabbix_server zabbix-3.4.4]# ./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-openipmi --with-unixodbc --prefix=/data/zabbix
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
...
...
...
Configuration:
Detected OS: linux-gnu
Install path: /data/zabbix
Compilation arch: linux
Compiler: gcc
Compiler flags: -g -O2
Library-specific flags:
database: -I/usr/local/mysql/include/mysql -I/usr/local/mysql/include/mysql/..
libXML2: -I/usr/include/libxml2
unixODBC: -I/usr/include
Net-SNMP: -I/usr/include/rpm -I/usr/local/include -I/usr/lib64/perl5/CORE -I. -I/usr/include
Enable server: yes
Server details:
With database: MySQL
WEB Monitoring: cURL
Native Jabber: no
SNMP: yes
IPMI: no
SSH: no
TLS: no
ODBC: yes
Linker flags: -L/usr/local/mysql/lib -L/usr/lib64 -L/usr/lib64 -rdynamic
Libraries: -lmysqlclient -lxml2 -lodbc -lnetsnmp -levent -lcurl -lm -ldl -lrt -lresolv -lpcreposix -lpcre
Enable proxy: no
Enable agent: yes
Agent details:
TLS: no
Linker flags: -rdynamic
Libraries: -lcurl -lm -ldl -lrt -lresolv -lpcreposix -lpcre
Enable Java gateway: no
LDAP support: no
IPv6 support: yes
***********************************************************
* Now run 'make install' *
* *
* Thank you for using Zabbix! *
* <http://www.zabbix.com> *
***********************************************************
三.編譯和安裝 使用make和make install來安裝:
[root@zabbix_server zabbix-3.4.4]# make
Making all in src
make[1]: Entering directory `/data/soft/zabbix-3.4.4/src'
Making all in libs
make[2]: Entering directory `/data/soft/zabbix-3.4.4/src/libs'
Making all in zbxcrypto
make[3]: Entering directory `/data/soft/zabbix-3.4.4/src/libs/zbxcrypto'
gcc -DHAVE_CONFIG_H -I. -I../../../include -g -O2 -MT libzbxcrypto_a-md5.o -MD -MP -MF .deps/libzbxcrypto_a-md5.Tpo -c -o libzbxcrypto_a-md5.o `test -f 'md5.c' || echo './'`md5.c
mv -f .deps/libzbxcrypto_a-md5.Tpo .deps/libzbxcrypto_a-md5.Po
gcc -DHAVE_CONFIG_H -I. -I../../../include -g -O2 -MT libzbxcrypto_a-base64.o -MD -MP -MF .deps/libzbxcrypto_a-base64.Tpo -c -o libzbxcrypto_a-base64.o `test -f 'base64.c' || echo './'`base64.c
mv -f .deps/libzbxcrypto_a-base64.Tpo .deps/libzbxcrypto_a-base64.Po
gcc -DHAVE_CONFIG_H -I. -I../../../include -g -O2 -MT libzbxcrypto_a-tls.o -MD -MP -MF .deps/libzbxcrypto_a-tls.Tpo -c -o libzbxcrypto_a-tls.o `test -f 'tls.c' || echo './'`tls.c
mv -f .deps/libzbxcrypto_a-tls.Tpo .deps/libzbxcrypto_a-tls.Po
rm -f libzbxcrypto.a
ar cru libzbxcrypto.a libzbxcrypto_a-md5.o libzbxcrypto_a-base64.o libzbxcrypto_a-tls.o
...
...
...
Making all in misc
make[1]: Entering directory `/data/soft/zabbix-3.4.4/misc'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/data/soft/zabbix-3.4.4/misc'
Making all in upgrades
make[1]: Entering directory `/data/soft/zabbix-3.4.4/upgrades'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/data/soft/zabbix-3.4.4/upgrades'
make[1]: Entering directory `/data/soft/zabbix-3.4.4'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/data/soft/zabbix-3.4.4'
[root@zabbix_server zabbix-3.4.4]# make install
....
make[2]: Entering directory `/data/soft/zabbix-3.4.4/upgrades'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/data/soft/zabbix-3.4.4/upgrades'
make[1]: Leaving directory `/data/soft/zabbix-3.4.4/upgrades'
make[1]: Entering directory `/data/soft/zabbix-3.4.4'
make[2]: Entering directory `/data/soft/zabbix-3.4.4'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/data/soft/zabbix-3.4.4'
make[1]: Leaving directory `/data/soft/zabbix-3.4.4'
5.修改zabbix配置檔案
安裝完成後,安裝目錄在上面指定的/data/zabbix下,其中sbin存放的是守護程序,bin放的是工具.etc存放的是配置檔案,share存放的是幫助和一些腳本.lib是庫檔案
可以将zabbix的執行目錄添加到PATH環境變量中.
[root@zabbix_server sbin]# env |grep PATH
PATH=/data/zabbix/bin:/data/zabbix/sbin:/usr/local/mysql/bin:/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin
MODULEPATH=/usr/share/Modules/modulefiles:/etc/modulefiles
[root@zabbix_server zabbix]# pwd
/data/zabbix
[root@zabbix_server zabbix]# ls -l
total 20
drwxr-xr-x 2 root root 4096 Dec 2 21:16 bin
drwxr-xr-x 4 root root 4096 Dec 2 21:16 etc
drwxr-xr-x 2 root root 4096 Dec 2 21:16 lib
drwxr-xr-x 2 root root 4096 Dec 2 21:16 sbin
drwxr-xr-x 4 root root 4096 Dec 2 21:16 share
我們先建立一個log目錄來存放zabbix的日志,由于zabbix server啟動的時候會以zabbix使用者啟動,是以此log目錄需要賦予zabbix的權限:
[root@zabbix_server zabbix]# mkdir log
[root@zabbix_server zabbix]# chown -R zabbix.zabbix /data/zabbix/log
[root@zabbix_server zabbix]# ls
bin etc lib log sbin share
再到etc下修改zabbix_server.conf.主要修改資料庫的連接配接資訊:資料庫名,使用者名,密碼.日志檔案目錄等,其它的一些暫時都是預設的
[root@zabbix_server etc]# vi zabbix_server.conf
[root@zabbix_server etc]# grep -v '^#' zabbix_server.conf |grep -v '^$'
LogFile=/data/zabbix/log/zabbix_server.log
LogFileSize=10
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBSocket=/data/log/mysql.sock
DBPort=3306
Timeout=4
LogSlowQueries=3000
6.啟動zabbix server
啟動程序隻需要執行相應的可執行檔案即可:
[root@zabbix_server zabbix]# zabbix_server
[root@zabbix_server zabbix]# ps -ef |grep zabbix
zabbix 30198 1 0 22:00 ? 00:00:00 zabbix_server
zabbix 30199 30198 0 22:00 ? 00:00:00 zabbix_server: configuration syncer [waiting 60 sec for processes]
zabbix 30200 30198 0 22:00 ? 00:00:00 zabbix_server: alerter #1 started
zabbix 30201 30198 0 22:00 ? 00:00:00 zabbix_server: alerter #2 started
zabbix 30202 30198 0 22:00 ? 00:00:00 zabbix_server: alerter #3 started
zabbix 30203 30198 0 22:00 ? 00:00:00 zabbix_server: housekeeper [startup idle for 30 minutes]
zabbix 30204 30198 0 22:00 ? 00:00:00 zabbix_server: timer #1 [processed 0 triggers, 0 events in 0.000000 sec, 0 maintenances in 0.000000 sec, idle 30 sec]
zabbix 30205 30198 0 22:00 ? 00:00:00 zabbix_server: http poller #1 [got 0 values in 0.087634 sec, idle 5 sec]
zabbix 30206 30198 0 22:00 ? 00:00:00 zabbix_server: discoverer #1 [processed 0 rules in 0.001495 sec, idle 60 sec]
zabbix 30207 30198 0 22:00 ? 00:00:00 zabbix_server: history syncer #1 [synced 0 items in 0.000001 sec, idle 1 sec]
zabbix 30208 30198 0 22:00 ? 00:00:00 zabbix_server: history syncer #2 [synced 0 items in 0.000001 sec, idle 1 sec]
zabbix 30209 30198 0 22:00 ? 00:00:00 zabbix_server: history syncer #3 [synced 0 items in 0.000001 sec, idle 1 sec]
zabbix 30210 30198 0 22:00 ? 00:00:00 zabbix_server: history syncer #4 [synced 0 items in 0.000001 sec, idle 1 sec]
zabbix 30211 30198 0 22:00 ? 00:00:00 zabbix_server: escalator #1 [processed 0 escalations in 0.000368 sec, idle 3 sec]
zabbix 30212 30198 0 22:00 ? 00:00:00 zabbix_server: proxy poller #1 [exchanged data with 0 proxies in 0.000009 sec, idle 5 sec]
zabbix 30213 30198 0 22:00 ? 00:00:00 zabbix_server: self-monitoring [processed data in 0.000003 sec, idle 1 sec]
zabbix 30214 30198 0 22:00 ? 00:00:00 zabbix_server: task manager [started, idle 5 sec]
zabbix 30215 30198 0 22:00 ? 00:00:00 zabbix_server: poller #1 [got 0 values in 0.000008 sec, idle 5 sec]
zabbix 30216 30198 0 22:00 ? 00:00:00 zabbix_server: poller #2 [got 0 values in 0.000008 sec, idle 5 sec]
zabbix 30217 30198 0 22:00 ? 00:00:00 zabbix_server: poller #3 [got 0 values in 0.000008 sec, idle 5 sec]
zabbix 30218 30198 0 22:00 ? 00:00:00 zabbix_server: poller #4 [got 0 values in 0.000012 sec, idle 5 sec]
zabbix 30219 30198 0 22:00 ? 00:00:00 zabbix_server: poller #5 [got 0 values in 0.000008 sec, idle 5 sec]
zabbix 30228 30198 0 22:00 ? 00:00:00 zabbix_server: unreachable poller #1 [got 0 values in 0.000009 sec, idle 5 sec]
zabbix 30229 30198 0 22:00 ? 00:00:00 zabbix_server: trapper #1 [processed data in 0.000000 sec, waiting for connection]
zabbix 30230 30198 0 22:00 ? 00:00:00 zabbix_server: trapper #2 [processed data in 0.000000 sec, waiting for connection]
zabbix 30231 30198 0 22:00 ? 00:00:00 zabbix_server: trapper #3 [processed data in 0.000000 sec, waiting for connection]
zabbix 30232 30198 0 22:00 ? 00:00:00 zabbix_server: trapper #4 [processed data in 0.000000 sec, waiting for connection]
zabbix 30233 30198 0 22:00 ? 00:00:00 zabbix_server: trapper #5 [processed data in 0.000000 sec, waiting for connection]
zabbix 30234 30198 0 22:00 ? 00:00:00 zabbix_server: icmp pinger #1 [got 0 values in 0.000017 sec, idle 5 sec]
zabbix 30235 30198 0 22:00 ? 00:00:00 zabbix_server: alert manager #1 started
zabbix 30236 30198 0 22:00 ? 00:00:00 zabbix_server: preprocessing manager #1 started
zabbix 30237 30198 0 22:00 ? 00:00:00 zabbix_server: preprocessing worker #1 started
zabbix 30238 30198 0 22:00 ? 00:00:00 zabbix_server: preprocessing worker #2 started
zabbix 30245 30198 0 22:00 ? 00:00:00 zabbix_server: preprocessing worker #3 sta
檢視一下日志:
[root@zabbix_server log]# vi zabbix_server.log
30198:20171202:220059.447 Starting Zabbix Server. Zabbix 3.4.4 (revision 74338).
30198:20171202:220059.447 ****** Enabled features ******
30198:20171202:220059.447 SNMP monitoring: YES
30198:20171202:220059.447 IPMI monitoring: NO
30198:20171202:220059.447 Web monitoring: YES
30198:20171202:220059.447 VMware monitoring: YES
30198:20171202:220059.447 SMTP authentication: NO
30198:20171202:220059.447 Jabber notifications: NO
30198:20171202:220059.447 Ez Texting notifications: YES
30198:20171202:220059.447 ODBC: YES
30198:20171202:220059.447 SSH2 support: NO
30198:20171202:220059.447 IPv6 support: YES
30198:20171202:220059.447 TLS support: NO
30198:20171202:220059.448 ******************************
30198:20171202:220059.448 using configuration file: /data/zabbix/etc/zabbix_server.conf
30198:20171202:220059.990 current database version (mandatory/optional): 03040000/03040005
30198:20171202:220059.990 required mandatory version: 03040000
30198:20171202:220100.076 server #0 started [main process]
30201:20171202:220100.079 server #3 started [alerter #2]
30202:20171202:220100.080 server #4 started [alerter #3]
30203:20171202:220100.080 server #5 started [housekeeper #1]
30204:20171202:220100.080 server #6 started [timer #1]
30205:20171202:220100.080 server #7 started [http poller #1]
30206:20171202:220100.081 server #8 started [discoverer #1]
30207:20171202:220100.081 server #9 started [history syncer #1]
30208:20171202:220100.082 server #10 started [history syncer #2]
30209:20171202:220100.082 server #11 started [history syncer #3]
30210:20171202:220100.082 server #12 started [history syncer #4]
30211:20171202:220100.082 server #13 started [escalator #1]
30212:20171202:220100.083 server #14 started [proxy poller #1]
30213:20171202:220100.083 server #15 started [self-monitoring #1]
30214:20171202:220100.083 server #16 started [task manager #1]
30215:20171202:220100.083 server #17 started [poller #1]
30216:20171202:220100.084 server #18 started [poller #2]
30217:20171202:220100.084 server #19 started [poller #3]
30218:20171202:220100.084 server #20 started [poller #4]
30200:20171202:220100.085 server #2 started [alerter #1]
30219:20171202:220100.085 server #21 started [poller #5]
30199:20171202:220100.087 server #1 started [configuration syncer #1]
30229:20171202:220100.090 server #23 started [trapper #1]
30230:20171202:220100.091 server #24 started [trapper #2]
30231:20171202:220100.094 server #25 started [trapper #3]
30232:20171202:220100.094 server #26 started [trapper #4]
30233:20171202:220100.095 server #27 started [trapper #5]
30234:20171202:220100.095 server #28 started [icmp pinger #1]
30235:20171202:220100.095 server #29 started [alert manager #1]
30236:20171202:220100.096 server #30 started [preprocessing manager #1]
30237:20171202:220100.096 server #31 started [preprocessing worker #1]
30228:20171202:220100.096 server #22 started [unreachable poller #1]
30238:20171202:220100.097 server #32 started [preprocessing worker #2]
30245:20171202:220100.099 server #33 started [preprocessing worker #3]
7.安裝zabbix web界面
一.複制PHP檔案
Zabbix前端使用PHP寫的,是以必須運作在PHP支援的Web伺服器上。隻需要簡單的從frontends/php路徑下複制PHP檔案到Web伺服器的HTML檔案目錄,就可以完成安裝。
Apache Web伺服器的HTML檔案目錄的一般包括:
/usr/local/apache2/htdocs (從源代碼安裝Apache的預設目錄)
/srv/www/htdocs (OpenSUSE, SLES)
/var/www/html (Fedora, RHEL, CentOS)
/var/www (Debian, Ubuntu)
:
建議使用子目錄替代HTML根目錄。我們這裡是redhat6使用的rpm安裝的httpd.是以是在/var/www/html下,這裡我們在html下建立一個zabbix目錄,然後将解壓縮檔案中的php目錄下的所有檔案拷貝到建立的zabbix下
[root@zabbix_server html]# pwd
/var/www/html
[root@zabbix_server html]# mkdir zabbix
[root@zabbix_server html]# cp -rf /data/soft/zabbix-3.4.4/frontends/php/* zabbix
[root@zabbix_server html]# ls zabbix/
actionconf.php adm.regexps.php applications.php chart3.php conf graphs.php host_screen.php imgstore.php latest.php popup_httpstep.php report4.php search.php sysmap.php triggers.php
adm.gui.php adm.triggerdisplayoptions.php audio chart4.php conf.import.php history.php hosts.php include local popup_media.php robots.txt services.php sysmaps.php tr_logform.php
adm.housekeeper.php adm.triggerseverities.php auditacts.php chart5.php correlation.php host_discovery.php httpconf.php index.php locale popup.php screenconf.php setup.php templates.php tr_status.php
adm.iconmapping.php adm.valuemapping.php auditlogs.php chart6.php discoveryconf.php hostgroups.php httpdetails.php items.php maintenance.php popup_trexpr.php screenedit.php slideconf.php toptriggers.php tr_testexpr.php
adm.images.php adm.workingtime.php authentication.php chart7.php disc_prototypes.php hostinventoriesoverview.php image.php js map.import.php profile.php screen.import.php slides.php tr_comments.php usergrps.php
adm.macros.php api_jsonrpc.php browserwarning.php chart.php favicon.ico hostinventories.php images jsLoader.php map.php queue.php screens.php srv_status.php tr_events.php users.php
adm.other.php app
二.安裝前端
首先啟動http:
[root@zabbix_server ~]# service httpd status
httpd (pid 30396) is running...
[root@zabbix_server ~]#
登入web界面通路:http://192.168.56.131/zabbix 如果出錯或者無顯示,檢視http的日志:tail -f /var/log/httpd/error_log,如果出現如下資訊說明php版本過低
[root@zabbix_server zabbix]# tail -f /var/log/httpd/error_log
[Sat Dec 02 22:28:07 2017] [notice] Digest: generating secret for digest authentication ...
[Sat Dec 02 22:28:07 2017] [notice] Digest: done
[Sat Dec 02 22:28:07 2017] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 configured -- resuming normal operations
[Sat Dec 02 22:28:07 2017] [warn] ./mod_dnssd.c: No services found to register
[Sat Dec 02 22:28:23 2017] [error] [client 192.168.56.1] PHP Parse error: syntax error, unexpected '[' in /var/www/html/zabbix/index.php on line 32
[Sat Dec 02 22:28:26 2017] [error] [client 192.168.56.1] PHP Parse error: syntax error, unexpected '[' in /var/www/html/zabbix/index.php on line 32
[Sat Dec 02 22:28:27 2017] [error] [client 192.168.56.1] PHP Parse error: syntax error, unexpected '[' in /var/www/html/zabbix/index.php on line 32
[Sat Dec 02 22:28:27 2017] [error] [client 192.168.56.1] PHP Parse error: syntax error, unexpected '[' in /var/www/html/zabbix/index.php on line 32
正常應該出現如下setup:
點選next step,進入預檢查,發現有一些php的配置失敗:
修改相關的php配置,在/etc/php.ini中,其中date.timezone = Asia/Shanghai 使用yum來安裝php56w-bcmath包.完成之後重新開機httpd然後檢視保證全部都是ok:
這裡下一步的時候可能會報錯,那是因為httpd使用者即apache使用者沒有權限對/var/www/html/zabbix/conf寫權限.直接将zabbix/conf賦予777權限即可.也可以下載下傳conf檔案然後上傳到指定目錄:
Zabbix前端已經就緒!位址: http://192.168.56.131/zabbix 預設的使用者名是Admin,密碼是zabbix