Install zabbix2.0 on centos7
Prepare the installation environment
1. System Environment
[Root @ localhost ~] # Cat/etc/centos-release
CentOSLinuxrelease7.0.1406 (Core)
[Root @ localhost ~] # Uname-r
3.10.0-123. el7.x86 _ 64
2. Disable firewall and selinux
[Root @ localhostbin] # systemctlstatusiptables
Iptables. service-IPv4firewallwithiptables
Loaded: loaded (/usr/lib/systemd/system/iptables. service; enabled)
Active: inactive (dead) sinceFri2015-07-1710: 58: 54EDT; 16 sago
[Root @ localhostbin] # systemctlstatusfirewalld
Firewalld. service-firewalld-dynamicfirewalldaemon
Loaded: loaded (/usr/lib/systemd/system/firewalld. service; disabled)
Active: inactive (dead)
[Root @ localhostbin] # getenforce
Permissive
3. Running Environment
Source code package preparation:
Install mysql with source code:
[Root @ localhostbin] #./mysql -- version
./MysqlVer14.14Distrib5.6.16, forLinux (x86_64) usingEditLinewrapper
Install httpphp in yum:
[Root @ localhostbin] # apachectl-v
Serverversion: Apache/2.4.6 (CentOS)
Serverbuilt: Mar12201515: 07: 19
[Root @ localhostbin] # php-v
PHP5.4.16 (cli) (built: Jun23201521: 17: 27)
Copyright (c) 1997-2013ThePHPGroup
ZendEnginev2.4.0, Copyright (c) 1998-2013ZendTechnologies
Httpphpmysql-related component installation method (install epel before installing php, refer to phpMyAdmin installation documentation ):
[Root @ localhostbin] # yuminstallgccgcc-c ++ curl-develautoconfhttpdhttpd-manualmod_sslmod_perlmod_auth_mysql
[Root @ localhostbin] # yuminstallphpphp-mysqlnd (php-mysql) php-gdphp-xmlphp-mbstringphp-ldapphp-pearphp-xmlrpcphp-bcmath
[Root @ localhostbin] # yuminstallmysql-connector-odbcmysql-devellibdbi-dbd-mysqlnet-snmp-devel
4. Environment Configuration
Php Environment
[Root @ localhostbin] # vi/etc/php. ini
Date. timezone = Asia/Shanghai
Max_execution_time= 300
Post_max_size = 32 M
Max_input_time= 300
Memory_limit = 128 M
Mbstring. func_overload = 2
Enable 5httpmysql
[Root @ localhostbin] # systemctlstarthttpd
[Root @ localhostbin] # systemctlenablehttpd
[Root @ localhostbin] #/etc/init. d/mysqlstart
[Root @ localhostbin] # chkconfigmysqlon
Zabbix source code installation and configuration 6 installation
[Root@localhostzabbix-2.0.3] # tarzxvf/root/7.17/zabbix-2.0.3.tar.gz
[Root@localhostzabbix-2.0.3] # cdzabbix-2.0.3/
[Root @ localhostlocal] #. /configure -- prefix =/usr/local/zabbix -- enable-server -- enable-proxy -- enable-agent -- with-mysql =/usr/bin/mysql_config -- with-net-snmp -- with-libcurl
[Root @ localhostlocal] # make
[Root @ localhostlocal] # makeinstall
7. Add zabbix to the system service file
[Root @ localhostlocal] # vi/etc/services
The zabbix-agent10050/tcp # ZabbixAgent
The zabbix-agent10050/udp # ZabbixAgent
The zabbix-trapper10051/tcp # ZabbixTrapper
The zabbix-trapper10051/udp # ZabbixTrapper
8. Import the zabbix Database
[Root @ localhostlocal] #/usr/local/mysql/bin/mysql-uroot-p
Enterpassword:
Mysql> createdatabasezabbixcharactersetutf8;
QueryOK, 1 rowaffected (0.00sec)
Mysql> grantallprivilegesonzabbix. * to "zabbix" @ "localhost" identifiedby "zabbix ";
QueryOK, 0 rowsaffected (0.02sec)
Mysql> flushprivileges;
QueryOK, 0 rowsaffected (0.00sec)
Mysql> exit
Bye
[Root @ localhostzabbix] # cd/usr/local/zabbix-2.0.3/
[Root@localhostzabbix-2.0.3] #/usr/local/mysql/bin/mysql-uzabbix-pzabbixzabbix <./database/mysql/schema. SQL
Warning: Usingapasswordonthecommandlineinterfacecanbeinsecure.
[Root@localhostzabbix-2.0.3] #/usr/local/mysql/bin/mysql-uzabbix-pzabbixzabbix <./database/mysql/images. SQL
Warning: Usingapasswordonthecommandlineinterfacecanbeinsecure.
[Root@localhostzabbix-2.0.3] #/usr/local/mysql/bin/mysql-uzabbix-pzabbixzabbix <./database/mysql/data. SQL
Warning: Usingapasswordonthecommandlineinterfacecanbeinsecure.
9 create a soft link between the zabbix configuration file and the execution File
[Root@localhostzabbix-2.0.3] # ln-s/usr/local/zabbix/etc/zabbix
[Root@localhostzabbix-2.0.3] # mkdir/var/log/zabbix
[Root@localhostzabbix-2.0.3] # chownzabbix. zabbix/var/log/zabbix/
[Root@localhostzabbix-2.0.3] # ln-s/usr/local/zabbix/bin/*/usr/bin/
[Root@localhostzabbix-2.0.3] # ln-s/usr/local/zabbix/sbin/*/usr/sbin/
[Root@localhostzabbix-2.0.3] # vi/etc/init. d/zabbix_server
BASEDIR =/usr/local/zabbix
[Root@localhostzabbix-2.0.3] # vi/etc/init. d/zabbix_agentd
BASEDIR =/usr/local/zabbix
10 modify the zabbix_server.conf File
[Root@localhostzabbix-2.0.3] # vi/etc/zabbix/zabbix_server.conf
DBName = zabbix
DBUser = zabbix
DBPassword = zabbix
11. Configure the monitored host file (because zabbix-server is also in the monitored range, modify this file)
[Root@localhostzabbix-2.0.3] # vi/etc/zabbix/zabbix_agentd.conf
Server = 127.0.0.1 # zabbix-server connected in passive mode
ServerActive = 127.0.0.1: 20051 # zabbix-server and port number connected in Active Mode
LogFile =/tmp/zabbix_agentd.log
UnsafeUserParameters = 1 # enable the Custom Script Function. You must enable the custom key. When you add a custom configuration file, append the variable to it:
Include =/etc/zabbix/filename. conf
12 copy a page file
[Root@localhostzabbix-2.0.3] # cp-rfrontends/php // var/www/html/zabbix
[Root@localhostzabbix-2.0.3] # chown-Rapache.apache/var/www/html/zabbix
13. enable the Service
# Chkconfigzabbix_serveron
[Root@localhostzabbix-2.0.3] # chkconfigzabbix_agentdon
[Root@localhostzabbix-2.0.3] #/etc/init. d/zabbix_serverstart
Startingzabbix_server (viasystemctl): [OK]
[Root@localhostzabbix-2.0.3] #/etc/init. d/zabbix_agentdstart
Startingzabbix_agentd (viasystemctl): [OK]
Configure zabbix14 logon on the web interface
Enter IP/zabbix in the browser address bar
15 Account Login
Account: admin Password: zabbix
Now zabbix has been installed. Detailed configuration and optimization will be made in the near future. Stay tuned! Thank you!