This article takes the CentOS 6.7 x86_64 system as an example, the environment is the new system which just completes.
Zabbix-server-End Environmental monitoring
[Email protected] ~]# Cat/etc/redhat-releasecentos release 6.7 (Final) [[email protected] ~]# uname-r2.6.32-573.8.1.el6 . X86_64[[email protected] ~]# uname-mx86_64[[email protected] ~]# Hostnamelinux-node1.example.com[[email protected] ~] # Ifconfig | Awk-f ' [inet addr:|] + ' Nr==2{print $} ' 10.19.1.19[[email protected] ~]# yum repolist loaded plugin: fastestmirror, securityloading mirror speeds from Cached Hostfile * base:mirrors.aliyun.com * epel:mirrors.aliyun.com * extras:mirrors.aliyun.com * updates:mirrors.aliy Un.com
First specify the Zabbix yum source
[Email protected] ~]# RPM-IVH http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
Then specify the Epel source for the Zabbix
[Email protected] ~]# RPM-IVH http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Zabbix-server also want to monitor themselves, so zabbix-agent also need to install. Install the Zabbix-server side. Need to download content about 18MB.
[email protected] ~]# Yum install-y zabbix zabbix-get zabbix-server zabbix-web-mysql zabbix-web zabbix-agent zabbix-send Er
Zabbix need database support, I chose MySQL, installed on this side, using Yum installation. Need to download content about 10MB.
[email protected] ~]# Yum install-y mysql-server
After the MySQL installation is complete, you need to modify the/ETC/MY.CNF configuration file to add 2 lines of content. (2 lines with comments)
[Email protected] ~]# VIM/ETC/MY.CNF [mysqld]datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sockuser=mysql# Disabling symbolic-links is recommended to prevent assorted security Riskssymbolic-links=0character-set-server=utf8 #指定 The character set is UTF8, important. Innodb_file_per_table=1 #让innodeb的每个表文件单独存储 [mysqld_safe]log-error=/var/log/mysqld.logpid-file=/var/run/mysqld/ Mysqld.pid
Set the MySQL service to boot, and then turn on the MySQL service.
[[email protected] ~]# chkconfig mysqld on[[email protected] ~]# chkconfig--list mysqldmysqld 0: Off 1: off 2: Enabled 3: Enable 4: Enable 5: Enable 6: off [[email protected] ~]#/etc/init.d/mysqld start[[email protected] ~]#/etc/init.d/mysqld statusmysql D (PID 2009) is running ...
Set the root user admin password to MySQL, for example, I set the password to Oldboy.
[Email protected] ~]# mysqladmin-uroot password Oldboy
Enter MySQL to create the libraries and users needed for Zabbix.
[Email protected] ~]# mysql-uroot-poldboymysql> CREATE database Zabbix character set UTF8; Query OK, 1 row Affected (0.00 sec) Mysql> Grant all privileges on zabbix.* to [email protected] identified by ' Zabbix '; Query OK, 0 rows Affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows Affected (0.00 sec) mysql> quit; Bye
Enter MySQL again, import the Zabbix database
[Email protected] ~]# mysql-uroot-poldboymysql> use zabbixdatabase changedmysql> source/usr/share/doc/ Zabbix-server-mysql-2.4.7/create/schema.sql;mysql> source/usr/share/doc/zabbix-server-mysql-2.4.7/create/ Images.sql;mysql> source/usr/share/doc/zabbix-server-mysql-2.4.7/create/data.sql;mysql> quit; Bye
Take a look at the current zabbix_server configuration file contents.
[Email protected] ~]# egrep-v "(^#|^$)"/etc/zabbix/zabbix_server.conflogfile=/var/log/zabbix/zabbix_ server.loglogfilesize=0pidfile=/var/run/zabbix/zabbix_server.piddbname=zabbixdbuser=zabbixdbsocket=/var/lib/ mysql/mysql.socksnmptrapperfile=/var/log/snmptt/snmptt.logalertscriptspath=/usr/lib/zabbix/ Alertscriptsexternalscripts=/usr/lib/zabbix/externalscripts
Edit this profile to increase the password setting for one row of the database, set the password to Zabbix, which is 1 lines with comments. The default is on line 106th of the configuration file.
[Email protected] ~]# egrep-v "(^#|^$)"/etc/zabbix/zabbix_server.conflogfile=/var/log/zabbix/zabbix_ Server.loglogfilesize=0pidfile=/var/run/zabbix/zabbix_server.piddbname=zabbixdbuser=zabbixdbpassword=zabbix # Set the database password to zabbixdbsocket=/var/lib/mysql/mysql.socksnmptrapperfile=/var/log/snmptt/snmptt.logalertscriptspath=/ Usr/lib/zabbix/alertscriptsexternalscripts=/usr/lib/zabbix/externalscripts
The related directories required to create the Zabbix.
[Email protected] ~]# mkdir/etc/zabbix/alertscripts[[email protected] ~]# mkdir/etc/zabbix/externalscripts
Start the Zabbix-server service, set up the Zabbix-server and httpd services to boot from.
[[Email protected] ~]# /etc/init.d/zabbix-server startstarting zabbix server: [ Determine][[email protected] ~]# chkconfig zabbix-server on[[email protected] ~]# chkconfig httpd on [[email protected] ~]# chkconfig --list zabbix-serverzabbix-server 0: Off 1: Off   2: Enable 3: Enable 4: Enable 5: Enable 6: Off [[email protected] ~] ]# chkconfig --list httpdhttpd 0: Off 1: Turn off   2: Enable 3: Enable 4: Enable 5: Enable 6: Off
Configure the Iptables settings (I just shut down the service for the sake of convenience), disable the SELinux feature.
[[email protected] ~]#/etc/init.d/iptables stop[[email protected] ~]# chkconfig iptables off[[email protected] ~]# Chkcon Fig--list iptablesiptables 0: Off 1: Off 2: Off 3: Off 4: off 5: Off 6: off [[email protected] ~]# Setenforce 0setenforce: SELinux is disabled[[email protected] ~]# getenforce disabled
Edit php config file, specify Date.timezong (time zone) for Asia Shanghai, default in line 946.
[Email protected] ~]# egrep-v "(^;|^$)"/etc/php.ini |grep Date.timezonedate.timezone = Asia/shanghai
Start the httpd service.
[[email protected] ~]#/etc/init.d/httpd start
The initial installation under the command line is complete, and the following goes into the installation process for the Web interface.
My native IP address is 10.19.1.19, so I use the browser to access Http://10.19.1.19/zabbix
[Email protected] ~]# Ifconfig | Awk-f ' [inet addr:|] + ' Nr==2{print $ ' 10.19.1.19
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/77/CA/wKioL1ZudyjyFLnAAAK8vYQWX0c881.png "title=" Zabbix-server01a.png "alt=" Wkiol1zudyjyflnaaak8vyqwx0c881.png "/>
Click on the "Next" button
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/77/CB/wKiom1ZueBKCEtrzAALvzTNuaDk948.png "title=" Zabbix-server02a.png "alt=" Wkiom1zuebkcetrzaalvztnuadk948.png "/>
This interface check the environment required by Zabbix-server, if all "OK" will continue to click on the "Next" button, if there are non-"OK" items, please follow the prompts to modify.
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/77/CB/wKiom1ZueKXAbzfLAALFppHaqHA946.png "title=" Zabbix-server03a.png "alt=" wkiom1zuekxabzflaalfpphaqha946.png "/> This page is the configuration of the connection database, we are using the MySQL database, The database is localhost, the port uses the default, the database name is Zabbix, the user name is Zabbix, and the password is Zabbix. (The password is specified when the database was created, such as is not set at the time of Zabbix, please change according to their actual situation, and also/etc/zabbix/zabbix_server.conf the Dbpassword content in the configuration file needs to be changed) click "Test Connection button to prompt "OK" is successful, you can click the "Next" button to proceed to the next step.
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/77/CB/wKiom1Zuel_Sr0dKAAKltUHN0bo250.png "title=" Zabbix-server04a.png "alt=" wkiom1zuel_sr0dkaakltuhn0bo250.png "/> This page need to specify the address and port of Zabbix-server, it is recommended to keep the default, Name one can be filled according to their own preferences, after the Zabbix installation is complete, the name shown on the page is the name, I set the name of radish. Click on the "Next" button to proceed to the next step after the setup is complete.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/77/CC/wKiom1ZueuuitQu6AAKkhbJNigo572.png "title=" zabbix-server05_ copy. png "alt=" Wkiom1zueuuitqu6aakkhbjnigo572.png "/>
This page is to make sure you set the information is wrong, if there is no problem, directly click on the "Next" button to enter the next step.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/77/CB/wKioL1Zue1zylC7OAAJ_8CR4uIc953.png "title=" zabbix-server06_ copy. png "alt=" wkiol1zue1zylc7oaaj_8cr4uic953.png "/> This page shows that the configuration file was created successfully, click" Finish " button to complete the Zabbix-server page installation and enter the Zabbix-server login page.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/77/CC/wKiom1Zue8bRgVWoAALdHvI5BHA057.png "title=" zabbix-server07_ copy. png "alt=" wkiom1zue8brgvwoaaldhvi5bha057.png "/>zabbix login page, Default user name is Admin, default password is Zabbix, try to log in.
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/77/CC/wKiom1ZufCey5vmIAAII7a2dVNA133.png "title=" zabbix-server08_ copy. png "alt=" wkiom1zufcey5vmiaaii7a2dvna133.png "/> Login successful, enter into the Zabbix management interface, since this zabbix-server the foundation installation is complete.
This article is from "rookie East" blog, please be sure to keep this source http://radish.blog.51cto.com/5944322/1722814
Enterprise-class distributed Monitoring System Zabbix series (Zabbix-server installation)