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

zabbix 安装

时间:2015-09-02 00:39:11      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:

1、在已有的LAMP或者LNMP的基础上安装zabbix,安装一些依赖包:

yum -y install mysql-devel libcurl-devel net-snmp-devel

2、添加用户:

groupadd zabbix
useradd zabbix -g zabbix

3、创建数据库,添加授权账号

mysql -uxxx  -pxxx

mysql> create database zabbix character set utf8;
mysql> grant all privileges on zabbix.*  to zabbix@localhost identified by ‘zabbix‘;

4、编译安装zabbix

cd  /usr/local/src

wget  http://fossies.org/linux/misc/zabbix-2.4.6.tar.gz

tar -zxvf   zabbix-2.4.6.tar.gz

cd  zabbix-2.4.6

./configure --prefix=/usr/local/zabbix-2.4.6/ --enable-server

--enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2
make install
5、将默认安装的3个库还原至zabbix数据库
cd  /usr/local/src/zabbbix-2.4.6
mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/schema.sql
mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/images.sql
mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/data.sql
6、修改配置文件
cp misc/init.d/fedora/core/zabbix_server /etc/init.d/
cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
cp -R frontends/php/*  /data/www1/zabbix
sed -i ‘s/^DBUser=.*$/DBUser=zabbix/g‘ /usr/local/zabbix-2.4.6/etc/zabbix_server.conf
sed -i ‘s/^.*DBPassword=.*$/DBPassword=zabbix/g‘ /usr/local/zabbix-2.4.6/etc/zabbix_server.conf
sed -i ‘s/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix-2.4.6/g‘ /etc/init.d/zabbix_server
sed -i ‘s/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix-2.4.6/g‘ /etc/init.d/zabbix_agentd
7、添加服务端口:
cat >>/etc/services <<EOF
zabbix-agent 10050/tcp     #Zabbix Agent
zabbix-agent 10050/udp     #Zabbix Agent
zabbix-trapper 10051/tcp   #Zabbix Trapper
zabbix-trapper 10051/udp   #Zabbix Trapper
EOF
8、启动服务
/etc/init.d/zabbix_server start
/etc/init.d/zabbix_agentd start
echo "/etc/init.d/zabbix_server start" >> /etc/rc.local
echo "/etc/init.d/zabbix_agentd start" >> /etc/rc.local

9、web页面配置,配置http访问好了后web登陆:http://ip/zabbix

确认每个Required都是ok的才会显示Next按钮,如果有Fail的需要完善系统要求

 
 
 
 

zabbix 安装

标签:

原文地址:http://www.cnblogs.com/dantes91/p/4777350.html

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