首页 > 代码库 > 在centos下安装zabbix

在centos下安装zabbix

1、防火墙及SELINUX关闭
http://blog.csdn.net/xiegh2014/article/details/53031781

2、yum源配置
http://blog.csdn.net/xiegh2014/article/details/53031894
rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm

3、安装PHP所需包
yum -y install httpd php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap wget ntpdate net-snmp*
yum install -y gcc mysql-community-devel libxml2-devel  unixODBC-devel net-snmp-devel libcurl-devel libssh2-devel OpenIPMI-devel openssl-devel openldap-devel

4、mysql安装及账号创建
yum -y install mysql-server mysql 
yum -y install mysql mysql-devel mysql-server

/etc/init.d/mysqld restart

mysql -u root -p
CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY ‘zabbix‘;
5、下载zabbix3.2.0安装包
链接:http://pan.baidu.com/s/1i492Ywt 密码:ox2x
groupadd zabbix
useradd -g zabbix zabbix

tar -xvf zabbix-3.2.0.tar.gz 
cd /data/zabbix-3.2.0/database/mysql/
mysql -u zabbix -p zabbix < schema.sql
mysql -u zabbix -p zabbix < images.sql 
mysql -u zabbix -p zabbix < data.sql
cd ../../
./configure --enable-server  --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-unixodbc --with-ssh2 --with-openipmi --with-openssl
make install

修改配置启动文件
vim /usr/local/etc/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

创建zabbix-web页面文件夹
mkdir /var/www/html/zabbix
cd /data/zabbix-3.2.0/frontends/php/
cp -a . /var/www/html/zabbix/

创建一个规则允许web服务器访问前端文件
chcon -Rv --type=httpd_sys_content_t /var/www/html

运行Apache和zabbix访问外网
setsebool -P httpd_can_network_connect=1
setsebool -P zabbix_can_network=1

设置Apache用户web接口文件的所有者
chown -R apache:apache /var/www/html/zabbix

为zabbix web界面添加权限
chmod +x /var/www/html/zabbix/conf/
cp /data/zabbix-3.2.0/misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix_server
chkconfig --add /etc/init.d/zabbix_server

启用Zabbix服务器,Apache和MySQL服务启动
chkconfig httpd on
chkconfig mysqld on
chkconfig zabbix_server on

启动
/etc/init.d/httpd start
service zabbix_server start

vim /etc/php.ini
post_max_size=16M
max_execution_time=300
max_input_time=300
date.timezone=Asia/Shanghai
always_populate_raw_post_data=http://www.mamicode.com/-1>
http://172.16.8.100/zabbix/

技术分享技术分享技术分享技术分享技术分享技术分享技术分享技术分享

zabbix客户端安装
yum -y install http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-release-3.2-1.el6.noarch.rpm  
yum install zabbix-agent -y

修改配置文件
sed -i ‘s/Server=127.0.0.1/Server=172.16.8.100/‘ /etc/zabbix/zabbix_agentd.conf
grep -n ‘^Server=‘ /etc/zabbix/zabbix_agentd.conf 
/etc/init.d/zabbix-agent start
chkconfig zabbix-agent on

zabbix3.2中文显示乱码的问题,
可以参考http://blog.csdn.net/xiegh2014/article/details/52038536

[root@qas-zabbix include]# pwd
/var/www/html/zabbix/include
[root@qas-zabbix include]# vi defines.inc.php
#修改第93行
define(‘ZBX_FONT_NAME‘,‘msyh‘);
#修改第45行改为
define(‘ZBX_GRAPH_FONT_NAME‘,‘msyh‘)
然后下载微软雅黑字体,改名为msyh传入 /var/www/html/zabbix/fonts目录下即可

技术分享

zabbix3.0聚合图形設置
http://blog.csdn.net/xiegh2014/article/details/52124179

技术分享

zabbix网络拓扑图

技术分享

zabbix3.2监控自定义模板
http://blog.csdn.net/xiegh2014/article/details/53887977 

技术分享

在centos下安装zabbix