CentOS7+Zabbix3.0.3安装

一. 设置基本LINUX系统  参考 http://1step.blog.51cto.com/1160799/1795157

二.安装MariaDB/Mysql
1.添加MariaDB源(或者手动下载安装)

vi /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.1 CentOS repository list - created 2016-03-18 07:33 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

2.安装MariaDB-server MariaDB-client

yum install MariaDB-server MariaDB-client -y
Dependencies Resolved
================================================================================================== 
Package                       Arch         Version                           Repository     Size
==================================================================================================
Installing:
 MariaDB-client                x86_64       10.1.15-1.el7.centos              mariadb        39 M
 MariaDB-server                x86_64       10.1.15-1.el7.centos              mariadb       100 M
 MariaDB-shared                x86_64       10.1.15-1.el7.centos              mariadb       1.3 M
     replacing  mariadb-libs.x86_64 1:5.5.44-2.el7.centos
Installing for dependencies:
 MariaDB-common                x86_64       10.1.15-1.el7.centos              mariadb        43 k
 boost-program-options         x86_64       1.53.0-25.el7                     base          155 k
 galera                        x86_64       25.3.15-1.rhel7.el7.centos        mariadb       7.7 M
 jemalloc                      x86_64       3.6.0-1.el7                       mariadb       104 k
 lsof                          x86_64       4.87-4.el7                        base          331 k
 perl-Compress-Raw-Bzip2       x86_64       2.061-3.el7                       base           32 k
 perl-Compress-Raw-Zlib        x86_64       1:2.061-4.el7                     base           57 k
 perl-DBI                      x86_64       1.627-4.el7                       base          802 k
 perl-Data-Dumper              x86_64       2.145-3.el7                       base           47 k
 perl-IO-Compress              noarch       2.061-2.el7                       base          260 k
 perl-Net-Daemon               noarch       0.48-5.el7                        base           51 k
 perl-PlRPC                    noarch       0.2020-14.el7                     base           36 k
 rsync                         x86_64       3.0.9-17.el7                      base          360 k
 Transaction Summary
 ==================================================================================================
 Install  3 Packages (+13 Dependent packages)

3.设置MariaDB

mkdir -pv /data/zabbix
chown -R mysql.mysql /data
mysql_install_db --user=mysql --datadir=/data/zabbix
mv /etc/my.cnf /etc/my.cnf.old
cp /usr/share/mysql/my-large.cnf /etc/my.cnf
vim /etc/my.cnf
[client]
default-character-set = utf8

[mysqld]
socket = /var/lib/mysql/mysql.sock
datadir = /data/zabbix
innodb_file_per_table = on
skip_name_resolve = on
character-set-server=utf8

[mysql]
default_character_set = utf8

设置mariadb起动,并开机起动

systemctl start mariadb
systemctl enable mariadb

4.设置zabbix账号连接信息

mysql
CREATE DATABASE zabbix CHARACTER SET utf8;
GRANT ALL on zabbix.* TO ‘zabbix‘@‘10.10.10.%‘ IDENTIFIED BY ‘zabbix‘;
GRANT ALL on zabbix.* TO ‘zabbix‘@‘zabbix‘ IDENTIFIED BY ‘zabbix‘;
GRANT ALL on zabbix.* TO ‘zabbix‘@‘localhost‘ IDENTIFIED BY ‘zabbix‘;
FLUSH PRIVILEGES;

三.安装zabbix
1.下载zabbix http://www.zabbix.com/download.php
zabbix-agent
zabbix-get
zabbix-server-mysql
zabbix-web
zabbix-web-mysql

2.设置阿里云的epel源

yum install wget -y
wget http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm

3.安装zabbix

yum localinstall zabbix* -y
Dependencies Resolved
===================================================================================================================
 Package                       Arch     Version                    Repository                                 Size
===================================================================================================================
Installing:
 zabbix-agent                  x86_64   3.0.3-1.el7                /zabbix-agent-3.0.3-1.el7.x86_64          1.0 M
 zabbix-get                    x86_64   3.0.3-1.el7                /zabbix-get-3.0.3-1.el7.x86_64            829 k
 zabbix-java-gateway           x86_64   3.0.3-1.el7                /zabbix-java-gateway-3.0.3-1.el7.x86_64   1.3 M
 zabbix-proxy-mysql            x86_64   3.0.3-1.el7                /zabbix-proxy-mysql-3.0.3-1.el7.x86_64    2.1 M
 zabbix-release                noarch   3.0-1.el7                  /zabbix-release-3.0-1.el7.noarch           20 k
 zabbix-sender                 x86_64   3.0.3-1.el7                /zabbix-sender-3.0.3-1.el7.x86_64         853 k
 zabbix-server-mysql           x86_64   3.0.3-1.el7                /zabbix-server-mysql-3.0.3-1.el7.x86_64   3.3 M
 zabbix-web                    noarch   3.0.3-1.el7                /zabbix-web-3.0.3-1.el7.noarch             29 M
 zabbix-web-mysql              noarch   3.0.3-1.el7                /zabbix-web-mysql-3.0.3-1.el7.noarch      0.0  
Installing for dependencies:
 OpenIPMI-libs                 x86_64   2.0.19-11.el7              base                                      501 k
 OpenIPMI-modalias             x86_64   2.0.19-11.el7              base                                       15 k
 apr                           x86_64   1.4.8-3.el7                base                                      103 k
 apr-util                      x86_64   1.5.2-6.el7                base                                       92 k
 dejavu-fonts-common           noarch   2.33-6.el7                 base                                       64 k
 dejavu-sans-fonts             noarch   2.33-6.el7                 base                                      1.4 M
 fontpackages-filesystem       noarch   1.44-8.el7                 base                                      9.9 k
 fping                         x86_64   3.10-4.el7                 epel                                       46 k
 httpd                         x86_64   2.4.6-40.el7.centos.1      updates                                   2.7 M
 httpd-tools                   x86_64   2.4.6-40.el7.centos.1      updates                                    82 k
 iksemel                       x86_64   1.4-6.el7                  epel                                       50 k
 java-1.8.0-openjdk-headless   x86_64   1:1.8.0.91-1.b14.el7_2     updates                                    31 M
 javapackages-tools            noarch   3.4.1-11.el7               base                                       73 k
 libX11                        x86_64   1.6.3-2.el7                base                                      605 k
 libX11-common                 noarch   1.6.3-2.el7                base                                      162 k
 libXau                        x86_64   1.0.8-2.1.el7              base                                       29 k
 libXpm                        x86_64   3.5.11-3.el7               base                                       54 k
 libjpeg-turbo                 x86_64   1.2.90-5.el7               base                                      134 k
 libpng                        x86_64   2:1.5.13-7.el7_2           updates                                   213 k
 libtool-ltdl                  x86_64   2.4.2-21.el7_2             updates                                    49 k
 libxcb                        x86_64   1.11-4.el7                 base                                      189 k
 libxslt                       x86_64   1.1.28-5.el7               base                                      242 k
 libzip                        x86_64   0.10.1-8.el7               base                                       48 k
 lksctp-tools                  x86_64   1.0.13-3.el7               base                                       87 k
 mailcap                       noarch   2.1.41-2.el7               base                                       31 k
 net-snmp-libs                 x86_64   1:5.7.2-24.el7_2.1         updates                                   747 k
 php                           x86_64   5.4.16-36.1.el7_2.1        updates                                   1.4 M
 php-bcmath                    x86_64   5.4.16-36.1.el7_2.1        updates                                    56 k
 php-cli                       x86_64   5.4.16-36.1.el7_2.1        updates                                   2.7 M
 php-common                    x86_64   5.4.16-36.1.el7_2.1        updates                                   563 k
 php-gd                        x86_64   5.4.16-36.1.el7_2.1        updates                                   126 k
 php-ldap                      x86_64   5.4.16-36.1.el7_2.1        updates                                    51 k
 php-mbstring                  x86_64   5.4.16-36.1.el7_2.1        updates                                   503 k
 php-mysql                     x86_64   5.4.16-36.1.el7_2.1        updates                                    99 k
 php-pdo                       x86_64   5.4.16-36.1.el7_2.1        updates                                    97 k
 php-xml                       x86_64   5.4.16-36.1.el7_2.1        updates                                   124 k
 python-javapackages           noarch   3.4.1-11.el7               base                                       31 k
 python-lxml                   x86_64   3.2.1-4.el7                base                                      758 k
 t1lib                         x86_64   5.1.2-14.el7               base                                      166 k
 tzdata-java                   noarch   2016e-1.el7                updates                                   180 k
 unixODBC                      x86_64   2.3.1-11.el7               base                                      413 k
 Transaction Summary
===================================================================================================================
Install  9 Packages (+41 Dependent packages)

4.将zabbix数据库信息导入MariaDB

cd /usr/share/doc/zabbix-server-mysql-3.0.3/            #根据版本号
gunzip create.sql.gz
mysql -uroot zabbix < create.sql

5.设置zabbix_server

vi /etc/zabbix/zabbix_server.conf 
$ListenPort=10051
# DBHost=localhost                      #如果mysql和zabbix不在同一主机,这里填写IP
DBName=zabbix                           #zabbix数据库名
DBUser=zabbix                           #zabbix数据库连接用户
DBPassword=zabbix                       #zabbix数据库连接密码
DBSocket=/var/lib/mysql/mysql.sock      #和mysql socket配置填写一至,如果mysql和zabbix不在同一主机,这里不填写

6.设置php信息

vi /etc/php.ini
date.timezone = Asia/Chongqing          #修改php的时区

7.设置httpd和zabbix-server启动并开机起动

systemctl start httpd
systemctl enable httpd
systemctl start zabbix-server
systemctl enable zabbix-server

8.设置zabbix页面

打开http://ip/zabbix/

9.查看zabbix php 的设置文件内容

cat /etc/zabbix/web/zabbix.conf.php

<?php
// Zabbix GUI configuration file.
global $DB;

$DB[‘TYPE‘]     = ‘MYSQL‘;
$DB[‘SERVER‘]   = ‘localhost‘;
$DB[‘PORT‘]     = ‘0‘;
$DB[‘DATABASE‘] = ‘zabbix‘;
$DB[‘USER‘]     = ‘zabbix‘;
$DB[‘PASSWORD‘] = ‘zabbix‘;

// Schema name. Used for IBM DB2 and PostgreSQL.
$DB[‘SCHEMA‘] = ‘‘;

$ZBX_SERVER      = ‘localhost‘;
$ZBX_SERVER_PORT = ‘10051‘;
$ZBX_SERVER_NAME = ‘‘;

$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;

四.安装zabbix-agent
1.去http://www.zabbix.com/download.php根据系统下载agent版本
实验为centos6的agent

2.安装agnet

yum localinstall zabbix-agent-3.0.3-1.el6.x86_64.rpm
Dependencies Resolved
=======================================================================================================================================
 Package                     Arch                  Version                       Repository                                       Size
 =======================================================================================================================================
 Installing:
 zabbix-agent                x86_64                3.0.3-1.el6                   /zabbix-agent-3.0.3-1.el6.x86_64                1.0 M
Installing for dependencies:
 libtool-ltdl                x86_64                2.2.6-15.5.el6                base                                             44 k
 unixODBC                    x86_64                2.2.14-14.el6                 base                                            378 k

3.设置agent

vi /etc/zabbix/zabbix_agentd.conf 
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=10.10.10.220
ServerActive=10.10.10.220
#Hostname=Zabbix server                         #可以不用填写,会自动读取hostname
Include=/etc/zabbix/zabbix_agentd.d/

4.启动agent,并设置为开机起动

service zabbix-agent start 
chkconfig zabbix-agent on

五.windows agent安装
下载windows版本的agent解压到C:\Program Files\ ,执行命令

cd c:
cd cd C:\Program Files\zabbix_agents\bin\win32"C:\Program Files\zabbix_agents\bin\win32\zabbix_agentd.exe" --config "C:\Program Files\zabbix_agents\conf\zabbix_agentd.win.conf" --install
"C:\Program Files\zabbix_agents\bin\win32\zabbix_agentd.exe" --start

server和agent安装完成

时间: 2024-09-30 16:17:50

CentOS7+Zabbix3.0.3安装的相关文章

zabbix3.0 LNMP安装部署 centos7

安装前准备: 1.1本实例运行环境说明: 操作系统版本:CentOS 7 首先,要先搭建Zabbix运行环境:LNMP(Linux + nginx+ MySQL + PHP(5.4以上)) CentOS 7 Ningx 1.9.10 Php7 Mysql 5.6 1.2安装包下载 1.2.1官网安装包更新地址: http://www.zabbix.com/download.php 2.2 3.0 下载: cd /usr/local/src wget http://jaist.dl.sourcef

zabbix-3.0.4安装部署

zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案,由一个国外的团队持续维护更新,软件可以自由下载使用,运作团队靠提供收费的技术支持赢利.zabbix由2部分构成,zabbix server与可选组件zabbix agent.zabbix server可以通过SNMP,zabbix agent,ping,端口监视等方法提供对远程服务器/网络状态的监视,数据收集等功能.zabbix agent需要安装在被监视的目标服务器上,它主要完成对硬件信息或与操作系统有

zabbix3.0.4安装部署文档(一)

关于zabbix及相关服务软件版本: Linux:centos 6.7 nginx:1.9.15 MySQL:5.6 PHP:5.5.35 安装依赖包: yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre* make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel 创建用

zabbix3.0.4安装部署文档(四)--邮件报警

一.使用外部邮箱账号发送报警邮件设置:        1.关闭sendmail或者postfix 使用外部邮箱账号时,不需要启动sendmail或者postfix ,如果在sendmail或者postfix启动的同时          使用外部邮箱发送报警邮件,首先会读取外部邮箱配置信息.         [[email protected] local]# /etc/init.d/sendmail stop        [[email protected] local]# /etc/init

zabbix3.0.4安装部署文档(三)----添加监控主机

一.linux添加监控客户端 1. tar -zxvf zabbix-3.0.4.tar.gz && cd zabbix-3.0.4 编译安装zabbix客户端 ./configure --prefix=/usr/local/zabbix-3.0.4/ --enable-agent make make install 2.修改客户端的配置文件 vim /usr/local/zabbix/etc/zabbix_agentd.conf 以下为客户端zabbix_agent.conf配置文件的说

zabbix3.0.3安装

zabbix3.0.3的安装准备工作 首先查看一下是否安装了mysql  我是用yum安装的 yum list installed | grep mysql 如果有的话会有以下显示 [[email protected] ~]# yum list installed |grep mysqlmysql-libs.x86_64       5.1.73-7.el6    @anaconda-CentOS-201605220104.x86_64/6.8卸载掉 yum remove mysql* 接下来为

PHP 5.5.38 + mysql 5.0.11 + zabbix3.0 + nginx 安装

PHP 5.5.38 + mysql 5.0.11 + zabbix3.0 + nginx 1.首先在安装好环境下安装 zabbix3.0情况下 2. yum install mysql-devel net-snmp-devel curl curl-devel -y groupadd zabbixuseradd -g zabbix zabbix 3. wget -c http://ncu.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20De

zabbix-3.0.4安装步骤详解

zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案. zabbix能监视各种网络参数,保证服务器系统的安全运营:并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题.由2部分构成,分别为zabbix server与可选组件zabbix agent. 一.准备 安装zabbix 3.0.4需要一些底层环境的支持,对一些依赖包的版本要求如下: 1. 查看当前系统的php版本和curl版本 php -v curl -V 软件名 版本支持 备注 前端支持

Zabbix3.0+LNMP安装

1. zabbix3.0实验环境 Nginx:1.10.2 Mysql: 5.6.33 PHP:5.6.12 Zabbix:3.0 Zabbix_server_IP: 192.168.10.150(基于LNMP) Zabbix_client_IP: 192.168.10.106 2. 准备环境LAMP # 更换下载源 wget -O /etc/yum.repos.d/CentOS-Base.repo  yum clean all yum makecache # 清理已经安装的包 rpm -e h