码迷,mamicode.com
首页 > 其他好文 > 详细

zabbix监控服务部署

时间:2018-05-30 19:23:00      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:login   zabbix   snmp   front   release   back   文件   amp   hostname   

技术分享图片

1.修改主机名
2.安装LNMP平台
3.修改php.ini参数

max_execution_time = 300
max_input_time = 300
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
date.timezone = Asia/Shanghai
always_populate_raw_post_data = -1

4.修改创建zabbix库设置zabbix用户

create database zabbix default charset utf8;
grant all privileges on zabbix.* to zabbix@localhost identified by zabbix;
flush privileges;


5.下载zabbix源码包安装依赖:可以随便下

yum install mysql-devel curl-devel net-snmp-devel -y
cd /usr/local/src/
wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.2.7/zabbix-3.2.7.tar.gz
tar zxf zabbix-3.2.6.tar.gz && cd /usr/local/src/zabbix-3.2.6
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 --with-mysql=/usr/local/mysql/bin/mysql_config
make && make install


6.创建zabbix用户导入zabbix数据

useradd zabbix -s /sbin/nologin
mysql -uroot -p123456 zabbix < database/mysql/schema.sql
mysql -uroot -p123456 zabbix < database/mysql/images.sql
mysql -uroot -p123456 zabbix < database/mysql/data.sql

7.zabbix启动脚本

cp /usr/local/src/zabbix-3.2.6/misc/init.d/tru64/zabbix_* /etc/init.d/
chmod +x /etc/init.d/zabbix_*

8.复制zabbixweb文件到nginx站点目录下

mkdir -p /home/wwwroot/zabbix
cp -rp frontends/php/* /home/wwwroot/zabbix/

9.编辑zabbix配置文件

vim /usr/local/zabbix/etc/zabbix_server.conf
LogFile=/tmp/zabbix_server.log
PidFile=/tmp/zabbix_server.pid
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

10.启动服务

/usr/local/nginx/sbin/nginx
/usr/local/php/sbin/php-fpm
/etc/init.d/mysqld start
/usr/local/zabbix/sbin/zabbix_server
/usr/local/zabbix/sbin/zabbix_agentd

11.字体设置:

windwos拷贝微软雅黑:rz上传到

cd /wwwroot/zabbix/fonts
mv DejaVuSans.ttf DejaVuSans.ttf.back
rz msyh.ttf
mv msyh.ttf DejaVuSans.ttf
chown 1000:1000 DejaVuSans.ttf

12.zabbix-agent客户端安装

客户端安装参考刘杰:

wget http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-agent-3.0.3-1.el6.x86_64.rpm
yum localinstall zabbix-agent-3.0.3-1.el6.x86_64.rpm

客户端安装(方法二):

wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
rpm -ivh zabbix-release-2.4-1.el6.noarch.rpm
yum install zabbix-agent

客户端被动配置:注:服务端/etc/hosts文件中加入客户端主机名解析

vim /etc/zabbix/zabbix_agentd.conf
Server=zabbix服务器ip地址
Hostname=本机主机名
/etc/init.d/zabbix-agent start
netstat -lnt|grep 10050
echo "/etc/init.d/zabbix-agent start" >>/etc/rc.d/rc.local

zabbix监控服务部署

标签:login   zabbix   snmp   front   release   back   文件   amp   hostname   

原文地址:https://www.cnblogs.com/wylhome/p/9112525.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!