Zabbix 3.2 监控部署


一、准备工作1.系统环境系统:CentOS 6.8 X86_64MySQL:5.7.12Apache:2.4.20PHP:7.1.4Zabbix:3.2.6
2.安装所需环境[root@Kry133 ~]# rpm -ivh http://www.lishiming.net/data/p_w_upload/forum/epel-release-6-8_64.noarch.rpm[root@Kry133 ~]# yum -y install gcc gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel libmcrypt-devel net-snmp-devel OpenIPMI-devel
二、安装LAMP环境1.mysql安装[root@Kry133 src]# tar zxvf mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz[root@Kry133 src]# mv mysql-5.7.12-linux-glibc2.5-x86_64 /usr/local/mysql[root@Kry133 src]# useradd mysql -s /sbin/nologin -M[root@Kry133 src]# chown -R mysql.mysql /usr/local/mysql/[root@Kry133 src]# cd /usr/local/mysql/[root@Kry133 mysql]# cp support-files/my-default.cnf /etc/my.cnf[root@Kry133 mysql]# vim /etc/my.cnf[root@Kry133 mysql]# mkdir /data #/data/mysql目录在初始时自动创建[root@Kry133 mysql]# ./bin/mysqld –initialize –user=mysql –datadir=/data/mysql #初始化[root@Kry133 mysql]# cp support-files/mysql.server /etc/init.d/mysqld[root@Kry133 mysql]# chkconfig –add mysqld[root@Kry133 mysql]# chkconfig –level 35 mysqld on[root@Kry133 mysql]# service mysqld start[root@Kry133 mysql]# vim /etc/profile.d/mysql.sh[root@Kry133 mysql]# source /etc/profile.d/mysql.sh[root@Kry133 mysql]# mysql -uroot -p’4qS5&qd%z=Qy’mysql> set password = password(‘123123’); #修改密码
2.安装httpd[root@Kry133 src]# wgethttp://mirror.bit.edu.cn/apache/apr/apr-util-1.5.4.tar.bz2[root@Kry133 src]#wgethttp://mirror.bit.edu.cn/apache/apr/apr-1.5.2.tar.bz2[root@Kry133 src]# tar jxvf apr-1.5.2.tar.bz2 && tar jxvf apr-util-1.5.4.tar.bz2[root@Kry133 src]# tar jxvf httpd-2.4.20.tar.bz2[root@Kry133 src]# mv apr-1.5.2 ./httpd-2.4.20/srclib/apr[root@Kry133 src]# mv apr-util-1.5.4 ./httpd-2.4.20/srclib/apr-util[root@Kry133 src]# tar jxvf pcre-8.35.tar.bz2[root@Kry133 src]# cd pcre-8.35[root@Kry133 pcre-8.35]# ./configure && make && make install[root@Kry133 src]# cd httpd-2.4.20[root@Kry133 src]# mkdir /usr/local/apache2.4[root@Kry133 httpd-2.4.20]# ./configure –prefix=/usr/local/apache2.4 –with-included-apr –enable-so –enable-deflate=shared –enable-expires=shared –enable-rewrite=shared[root@Kry133 httpd-2.4.20]# make && make install[root@Kry133 httpd-2.4.20]# cd /usr/local/apache2.4/[root@Kry133 apache2.4]# vim conf/httpd.conf[root@Kry133 apache2.4]# cp bin/apachectl /etc/init.d/httpd[root@Kry133 apache2.4]# vim /etc/init.d/httpd[root@Kry133 apache2.4]# chkconfig –add httpd[root@Kry133 apache2.4]# chkconfig –level 35 httpd on[root@Kry133 apache2.4]# service httpd start
3.安装PHP[root@Kry133 src]# wget http://cn2.php.net/distributions/php-7.1.4.tar.gz[root@Kry133 src]# tar zxvf php-7.1.4.tar.gz[root@Kry133 php-7.1.4]# mkdir /usr/local/php[root@Kry133 php-7.1.4]# ./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache2.4/bin/apxs –with-config-file-path=/usr/local/php/etc –with-mysqli=mysqlnd –with-pdo-mysql=mysqlnd –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-curl –with-gettext –enable-ftp –enable-mbstring –enable-bcmath –with-gd –enable-gd-native-ttf –with-openssl –enable-sockets –enable-soap –with-libxml-dir –with-iconv-dir –with-bz2 –disable-ipv6 –enable-calendar –enable-dom –enable-xml –enable-fpm –with-libdir=lib64[root@Kry133 php-7.1.4]# make && make install[root@Kry133 php-7.1.4]# cd /usr/local/apache2.4/[root@Kry133 apache2.4]# vim conf/httpd.conf[root@Kry133 apache2.4]# service httpd restart
三、Zabbix 部署1.安装zabbix [root@Kry133 src]# tar zxvf zabbix-3.2.6.tar.gz[root@Kry133 src]# cd zabbix-3.2.6[root@Kry133 zabbix-3.2.6]# useradd -s /sbin/nologin -M zabbix[root@Kry133 zabbix-3.2.6]# mkdir /usr/local/zabbix[root@Kry133 zabbix-3.2.6]# ./configure –prefix=/usr/local/zabbix –enable-server –enable-agent –with-mysql –enable-ipv6 –with-net-snmp –with-libcurl –with-libxml2 –with-openipmi[root@Kry133 zabbix-3.2.6]# make && make install[root@Kry133 zabbix-3.2.6]# cp -r frontends/php /usr/local/apache2.4/htdocs/zabbix[root@Kry133 zabbix-3.2.6]# vim /usr/local/zabbix/etc/zabbix_server.conf[root@Kry133 zabbix-3.2.6]# cp misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix[root@Kry133 zabbix-3.2.6]# chkconfig –add zabbix[root@Kry133 zabbix-3.2.6]# chkconfig –level 35 zabbix on[root@Kry133 zabbix-3.2.6]# service zabbix start
2.配置数据[root@Kry133 zabbix-3.2.6]# mysql -uroot -pmysql>create databasezabbix charactersetutf8 collate utf8_bin;mysql>grantall on zabbix.*to zabbix@localhost identified by ‘zabbix’;mysql>flush privileges;[root@Kry133 zabbix-3.2.6]# mysql -uzabbix -pzabbix zabbix
[root@Kry133 zabbix-3.2.6]# mysql -uzabbix -pzabbix zabbix
[root@Kry133 zabbix-3.2.6]# mysql -uzabbix -pzabbix zabbix

3.配置PHP [root@Kry133 zabbix-3.2.6]# cd ../php-7.1.4[root@Kry133 php-7.1.4]# cp php.ini-production /usr/local/php/etc/[开发云主机域名root@Kry133 php-7.1.4]# vim /etc/php.ini[root@Kry133 php-7.1.4]# service httpd restart
4.zabbix 网页配置浏览器访问 Zabbix Server ip/zabbix

四、扩展内容1.PHP 扩展:
2.Zabbix 特殊监控选项:五、FAQ1.mysql启动时报一下错误;/usr/libexec/mysqld: Can’t find file: ‘./mysql/plugin.frm’ 解决办法:关闭selinux
2.登录zabbix web页面报以下错误;A non well formed numeric value encountered [zabbix.php:21 → require_once() → ZBase->run() → ZBase->proce***equest() → CView->getOutput() → include() → make_status_of_zbx() → CFrontendSetup->checkRequirements() → CFrontendSetup->checkPhpMemoryLimit() → str2mem() in include/func.inc.php:410]原因:因为PHP 7.1.4 类型强化解决办法:[root@Kry133 sbin]# sed -i ‘/$last = strtolower(substr($val, -1));/a$val = substr($val,0,-1);’ /usr/local/apache2.4/htdocs/zabbix/include/func.inc.php
3.启动zabbix_server 端口没监听,web页面显示服务没运行,查看日志报以下错误;Is this process already running? Could not lock PID file [/tmp/zabbix_server.pid]: [11] Resource temporarily unavailable解决办法:rm -rf /tmp/zabbix_server.pid ,再执行zabbix_server,服务器启动正常。
4.启动报错zabbix 服务报以下错误;error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory解决办法:[root@Kry133 sbin]# ln -s /usr/local/mysql/lib/libmysqlclient.so.20 /lib64/libmysqlclient.so.20[root@Kry133 sbin]# echo “/usr/local/mysql/lib” >> /etc/ld.so.conf
5.zabbix 服务启动正常,日志报错以下内容; 8779:20170512:085715.539 [Z3001] connection to database ‘zabbix’ failed: [1045] Access denied for user ‘zabbix’@’localhost’ (using password: NO) 8779:20170512:085715.539 database is down: reconnecting in 10 seconds解决办法:修改 /usr/local/zabbix/etc/zabbix_server.conf 中 ListenIP=0.0.0.0
6.web页面出现乱码解决办法:①.在本地找到C:WindowsFontssimkai.ttf,上传到zabbix网站目录fonts目录下.②.修改zabbix php配置文件[root@Kry133 zabbix]# sed -i ‘s/DejaVuSans/simkai/g’ include/defines.inc.php以上操作未能解决乱码问题创建数据库指定字符集create database zabbix default charset utf8;或者my.cnf增加default-character-set = utf8

相关推荐: 什么是redis集群配置与管理

本篇文章给大家分享的是有关什么是redis集群配置与管理,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。Redis在3.0版本以后开始支持集群,经过中间几个版本的不断更新优化,最新的版本集群功能已经…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

Like (0)
Donate 微信扫一扫 微信扫一扫
Previous 06/04 16:30
Next 06/04 16:30

相关推荐