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

Zabbix2.2 详细安装手册

时间:2018-05-28 16:02:36      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:centos 6   flush   XML   bpa   exe   openssl   开机启动   password   mysq   

主机系统:CentOS 6.5 x64

一、环境安装

1.修改yum源(略),使用的是163的源,基本上各大源站都可以。

2.yum install httpd mysql mysql-devel mysql-server php * -y

3.yum -y install gcc gcc-c++ autoconf make cmake openssl openssl-develncurses-devel libxml2-devel zlib-devel php-mysql php-gd curl curl-develnet-snmp net-snmp-devel perl-DBI php-xml mysql-devel php-bcmath php-mbstring

二、环境配置

1.配置数据库

#mysqladmin -u root password ‘root‘

#mysql -u root -p

mysql>create database zabbix character set utf8;

mysql>grant all on zabbix.* to zabbix@"%" identified by "zabbix";   #给zabbix表添加权限

mysql>flush privileges;

2.下载zabbix安装包

#wget https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.20/zabbix-2.2.20.tar.gz --no-check-certificate

#tar -zxvf zabbix-2.2.20.tar.gz

#cd zabbix-2.2.20

初始化zabbix数据库

#mysql -uzabbix -h192.168.1.3 -pzabbix zabbix < database/mysql/schema.sql

#mysql -uzabbix -h192.168.1.3 -pzabbix zabbix < database/mysql/images.sql

#mysql -uzabbix -h192.168.1.3 -pzabbix zabbix < database/mysql/data.sql

# ./configure--prefix=/usr/local/zabbix --enable-server --with-net-snmp --with-libcurl--with-mysql=/usr/bin/mysql_config

(当时报错Curl library 未发现,yum安装yum install curl-devel

#make && make install

#useradd -r zabbix -s /sbin/nologin

#cp misc/init.d/tru64/zabbix_server /etc/init.d/(这里需要修改下脚本的命令路径)

#cp -r frontends/php /var/www/html/zabbix

修改php.ini相关选项

date.timezone =Asia/Shanghai

post_max_size = 50M

max_execution_time = 300

max_input_time = 300

3.修改zabbix配置文件

添加端口

#vi/etc/services

zabbix-agent    10050/tcp               # Zabbix Agent
zabbix-agent    10050/udp               # Zabbix Agent
zabbix-trapper  10051/tcp               # Zabbix Trapper
zabbix-trapper  10051/udp               # Zabbix Trapper
8、修改配置文件
# cp -a frontends/php/* /var/www/html/
修改/etc/httpd/conf/httpd.conf
DirectoryIndex index.html index.html.var index.php

修改/usr/local/zabbix/etc/zabbix_server.conf参数:
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

#cp misc/init.d/fedora/core5/zabbix_server /etc/init.d/
#cp misc/init.d/fedora/core5/zabbix_agentd /etc/init.d/
#chmod 700 /etc/init.d/zabbix_*


vim /etc/init.d/zabbix_server
修改
     ZABBIX_BIN="/usr/local/sbin/zabbix_server"

     ZABBIX_BIN="/usr/local/zabbix/sbin/zabbix_server"
vim /etc/init.d/zabbix_agentd
修改
     ZABBIX_BIN="/usr/local/sbin/zabbix_agentd"

     ZABBIX_BIN="/usr/local/zabbix/sbin/zabbix_agentd"
9、启动服务并设置开机启动
/etc/init.d/zabbix_server start

Zabbix2.2 详细安装手册

标签:centos 6   flush   XML   bpa   exe   openssl   开机启动   password   mysq   

原文地址:https://www.cnblogs.com/sunc/p/9100338.html

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