centos安装zabbix3.0

        Centos7安装zabbix监控

系统环境:Centos7.0
Zabbix:下载http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Development/3.0.0alpha2/zabbix-3.0.0alpha2.tar.gz/download

所需软件:zabbix-3.0.0alpha2.tar.gz
Apache
Mysql
Php

安装系统依赖的软件包:
yum –y install gcc gcc-c++ wget automake mysql-server httpd php mysql-devel net-snmp-devel
curl-devel perl-DBI php-gd php-mysql php-bcmath php-mbstring php-xml

因为centos7的环境是mariadb,所以重新安装mysql的社区版,(过程可能有点缓慢)

wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

rpm -ivh mysql-community-release-el7-5.noarch.rpm

yum install mysql-community-server

设置mysql的数据库
/etc/init.mysqld start
设置密码

mysql –uroot
 > set password for 'root'@'localhost' = password('123456');
  mysql –uroot –p123456   设置zabbix的数据库和用户密码

Mysq> create database zabbix character set utf8;
Mysql> grant all on zabbix.* TO zabbix@'localhost' identified by 'zabbix';
Mysql> flush privileges;
cd zabbix-3.0.0alpha2/database/mysql
mysql -uroot -p123456 < schema.sql
mysql -uroot -p123456 < images.sql
mysql -uroot -p123456 < data.sql

添加zabbix用户
groupadd zabbix
useradd zabbix –g zabbix –s /sbin/nologin
安装zabibx服务

 mkdir /opt/zabbix 
  tar –zxvf zabbix-3.0.0alpha2.tar.gz
   cd zabbix-3.0.0alpha2
./configure --with-mysql --with-net-snmp --with-libcurl --enable-server --enable-agent --enable-proxy --prefix=/opt/zabbix/
make  && make install

安装fping软件
http://fping.sourceforge.net/
tar fping-3.4.tar
./configure
make && make install
修改配置文件
cp misc/init.d/fedora/core5/zabbix_server /etc/init.d/
chmod 755 /etc/init.d/zabbix_*
vim /etc/init.d/zabbix_server

修改ZABBIX_BIN=”/opt/zabbix/sbin/zabbix_server”
vim /opt/zabbix/etc/zabbix_server.conf

修改FpingLocation=/usr/local/sbin/fping

vim /etc/httpd/conf/httpd.conf
DBName=zabbix
DBUser=zabbix 
DBPassword=zabbix
DirectoryIndex index.html index.html.var index.php
AlertScriptsPath=/opt/scripts       指定脚本的存放位置

修改php的配置文件

vim /etx/php.ini
max_execution_time = 300
max_input_time = 300
date.timezone = PRC
post_max_size = 32M

将zabbix的部署文件放在httpd的发布位置下面
cp -r frontend/php/* /var/www/html/
chown –R zabbix:zabbix /var/www/html/*
启动服务
/etc/init.d/zabbix_server start
/etc/init.d/httpd start
浏览器访问192.168.65.154
centos安装zabbix3.0_第1张图片
设置登录密码:zabbix
设置服务器的配置文件
vim /var/www/html/conf/zabbix.conf.php


    $['DATABASE']          = 'zabbix';
    $['USER']              = 'zabbix';
    $['PASSWORD']          = 'zabbix';

centos安装zabbix3.0_第2张图片
Zabbix 客户端安装

Zabbix 客户端安装
groupadd zabbix
useradd zabbix -g zabbix –s /sbin/nologin

yum -y install gcc gcc-c++ libcurl libcurl-devel

./configure --with-net-snmp --with-libcurl --enable-agent --prefix=/opt/zabbix/
Make && make install

3、修改配置文件
cp misc/init.d/fedora/core5/zabbix_agentd /etc/init.d/
chown -R zabbix:zabbix /etc/init.d/zabbix_*
chmod 755/etc/init.d/zabbix_*

vim /etc/init.d/zabbix_agentd
修改ZABBIX_BIN="/opt/zabbix_agentd/sbin/zabbix_agentd"
 vim /opt/zabbix/etc/zabbix_agentd.conf
Server=192.168.xxx.xxx
ServerActive=192.168.xx.xxx
Hostname=Zabbix server

/etc/init.d/zabbix_agentd start
chkconfig zabbix_agentd on

你可能感兴趣的:(centos安装zabbix3.0)