Zabbix monitoring platform installation and deployment
Zabbix monitoring platform deployment, need at least four components, namely Zabbix_Server, Zabbix_Web, Databases, Zabbix_Agentd, the following detailed steps to Zabbix installation configuration monitoring platform:
First, prepare the system environment
Server端:192.168.2.101 (httpd、mysql、PHP)
Agent端:192.168.2.102
系统环境:LAMP
setenforce 0 :关闭Selinux
systemctl stop firewalld:关闭防火墙
systemctl disable firewalld 永久关闭防火墙
下载zabbix版本,各个版本之间安装方法相差不大,可以根据实际情况选择安装版本,本文版本为Zabbix-3.2.6.tar.gz。(现在zabbix4.*界面比较好看 可以直接下载zabbix4.4.*来安装 下载地址)
https://sourceforge.net/projects/zabbix/)
Second, the source is mounted zabbix-server, install the expansion dependencies.
yum install -y mysql-libs mysql-devel curl curl-devel net-snmp net-snmp-devel perl-DBI
cd /usr/src
wget-c https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.2.6/zabbix-3.2.6.tar.gz
tar xzf zabbix-3.2.6.tar.gz
./configure --prefix=/usr/local/zabbix/ --enable-server --with-mysql --with-libcurl
make && make install
The installation is completed the following prompts to install successfully
Third, the deployment of LAMP environment
yum install httpd httpd-devel php php-devel php-mysql mariadb-server mysql –y
启动数据库,建立zabbix库并授权
systemctl start mariadb
create database zabbix charset=utf8; 创建数据库
grant all on zabbix.* to zabbix@'localhost' identified by "123456";
flush privileges; 刷新权限
导入数据到zabbix库
cd /usr/src/zabbix-3.2.6/database/mysql (下载编译路径)
cd /usr/src/zabbix-3.2.6/database/mysql
Data into the database
mysql -h192.168.11.14 -uzabbix -p123456 zabbix <schema.sql
mysql -h192.168.11.14 -uzabbix -p123456 zabbix <images.sql
mysql -h192.168.11.14 -uzabbix -p123456 zabbix <data.
Backup configuration files
cd /usr/local/zabbix/etc/
\cp zabbix_server.conf zabbix_server.conf.bak
Edit the configuration file zabbix_server.conf
vim zabbix_server.conf
LogFile=/tmp/zabbix_server.log
DBHost=locDdalhost #数据库主机名,当设置为localhost时,连接mysql通过sock
DBName=zabbix #指定存放zabbix数据数据库的名字
DBUser=zabbix #指定连接数据库的用户名
DBPassword=123456 #用户连接数据库需要的密码
Set up as a system service and authorized
\cp /usr/src/zabbix-3.2.11/misc/init.d/tru64/zabbix_server /etc/init.d/
chmod o+x /etc/init.d/zabbix_server
Establish zabbix user (needs to start), flexible connection (start required)
groupadd zabbix
useradd -g zabbix zabbix
usermod -s /sbin/nologin zabbix
ln -s /usr/local/zabbix/sbin/zabbix_* /usr/local/sbin/
Remote PHP
vim /var/www/html/info.php 验证发布文件
启动Apache:systemctl restart httpd
启动zabbix:service zabbix_server restart
Copy zbbix-WEB program code files to the Apache distribution directory
\cp /usr/src/zabbix-3.2.11/frontends/php/* /var/www/html/ -rf
Tip: If the error re-install version of PHP 500
由于zabbix3.2.9需要php5.4版本以上,默认自带5.3.3(会报500或者打不开网页等错误信息 则重新安装PHP
[root@localhost etc]# rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm
卸载PHP
[root@localhost etc]# yum -y remove php*
安装php5.6
[root@localhost etc]# yum -y install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64 php56w-mbstring php56w-bcmath php56w-gd php56w-xml gd gd-devel --skip-broken
Add boot from the start
[root@localhost etc]# chkconfig --add httpd
[root@localhost etc]# chkconfig httpd on
[root@localhost etc]# chkconfig --add mysqld
[root@localhost etc]# chkconfig mysqld on
Open a browser to access the local IP,
设置zabbix web管理界面安装配置,点击next step,如下图
浏览器访问出现以下报错:
Editing php.ini, run the following code (big trick)
yum install php-mbstring php-bcmath php-gd php-xml install gd gd-devel -y
sed -i '/post_max_size/s/8/16/g;/max_execution_time/s/30/300/g;/max_input_time/s/60/300/g;s/\;date.timezone.*/date.timezone \= PRC/g;s/\;always_populate_raw_post_data/always_populate_raw_post_data/g' /etc/php.ini
修改完参数后重启htppd:systemctl restart httpd
修改完参数后重启htppd:systemctl restart httpd
Be in / etc / hosts, in the last line of the following
193.192.168.11.44 www.zabbi.com 后期数据库更改方便
Next step fill out the following:
Next step is as follows
Being given five
Zabbix.conf.php file repair needs to create, execute the following command
chmod o+w /var/www/html/conf
Method one: Modify the owner / var / www / html / conf file for apache
chown -R apache conf
Method 2: Download upload / down 192.168.0.101var / www / html / conf directory
用户名:admin
密码:zabbix
登陆成功如下:
After the interface is configured to have the following Chinese alarm: alarm indicates that the server does not start following
Before modifying the configuration files to back up
77行为: DBHost=www.zabbixmysql.com 数据库地址
111行为:DBPassword=123456 数据库密码
As shown below:
performing /etc/init.d/zabbix_server restart given as follows:
given six
Solution:
1)useradd zabbix
2)ln -s /usr/local/zabbix/sbin/zabbix_* /usr/local/sbin/
再启动/etc/init.d/zabbix_server restart报错如下:
Error seven:
Solution:
把/tmp/zabbix_server.log删除即可
rm -rf /tmp/zabbix_server.log
再启动/etc/init.d/zabbix_server restart
Refresh zabbix-sever
The default is English, Chinese modified, (mainly English we do not know)
Fourth, configure zabbix-server:
1)添加到192.168.11.55和192.168.11.66客户端监控:
依次点击主菜单中:
<配置>-<创建主机>-输入主机名称192.168.11.55,并添加群组为linux servers下图:
(IP地址截图错了)
Then click on the bottom of the <add> that is successfully added 55,66 do the same methods, the successful completion of the following figure:
2) Add items to monitor project:
Click the image above Click <192.168.11.66> After <Template> - <select> in the pop-up menu, select <Template OS Linux> - <select> - <add> - <Update>
Further addition, when a client in the same manner as above to add a host
Fifth, the client installation configuration: In 192.168.11.55/66
1)192.168.11.55安装zabbix
cd /usr/src
wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.2.6/zabbix-3.2.6.tar.gz
tar xzf zabbix-3.2.6.tar.gz
cd zabbix-3.2.6
./configure --prefix=/usr/local/zabbix --enable-agent && make && make install
ln –s /usr/local/zabbix/sbin/zabbix_* /usr/local/sbin/
Modify zabbix_agentd.conf client configuration file, execute the following command, zabbix_agentd.conf content, specify the server IP, both of the local Hostname to local IP address or DNS name:
the CPU, memory, load, network card, disk, IO, application services, port , logged-in user,
vim /usr/local/zabbix/etc/zabbix_agentd.conf modify the following parameters
91行 Server=192.168.11.101
132行ServerActive=192.168.11.101
143行 Hostname=192.168.11.102
Copy from the source installation directory zabbix_agentd to the line in the file and directory permissions to execute
cp /usr/src/zabbix-3.2.6/misc/init.d/tru64/zabbix_agentd /etc/init.d/
useradd zabbix
ln -s /usr/local/zabbix/sbin/zabbix_* /usr/local/sbin/
chmod o+x /etc/init.d/zabbix_agentd
/etc/init.d/zabbix_agentd start
In zabbix web interface, see the following memory conditions
Garbled Chinese mode
Solution:
enter the httpd home directory: backup the original font
From the end win a copy fonts to Linux: C: \ Windows \ Fonts upload modified after the original name