Zabbix配置分为两部分
1.Zabbix服务端的配置
  安装Zabbix源:

[root@c71 ~]#     rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm

  列出 zabbix-release 这个包里面文件的列表

[root@c71 ~]# rpm -ql zabbix-release
/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
/etc/yum.repos.d/zabbix.repo
/usr/share/doc/zabbix-release-3.4
/usr/share/doc/zabbix-release-3.4/GPL

  将服务器上的软件包信息 现在本地缓存,以提高 搜索 安装软件的速度

 yum makecache

  安装相关软件:

 yum install zabbix-server-mysql zabbix-web-mysql zabbix-server zabbix-agent mariadb-server -y

  安装mysql数据库并进行相关的配置:

[root@c71 ~]# systemctl start mariadb

 [root@c71 ~]# systemctl enable mariadb //设置为开机自启动

 [root@c71 ~]# mysql -uroot -p
  

  Enter password: //回车

  MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;

  MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';

  MariaDB [(none)]> flush privileges;

  MariaDB [(none)]> exit

 [root@c71 doc]# cd /usr/share/doc/zabbix-server-mysql-3.4.15/

[root@c71 zabbix-server-mysql-3.4.15]# zcat create.sql.gz

 [root@c71 zabbix-server-mysql-3.4.15]# zcat create.sql.gz |mysql -uroot zabbix -p
  Enter password: //直接回车

查看数据是否已经写入数据库里面了:

[root@c71 zabbix-server-mysql-3.4.]# mysql -uroot -p
Enter password: //回车
MariaDB [(none)]> use zabbix;
MariaDB [zabbix]> show tables; //如果返回的结果中有表,说明写入成功了。
MariaDB [zabbix]> exit //退出数据库
 Bye

查看Zabbix库的信息是否写入了配置文件内:

[root@c71 zabbix-server-mysql-3.4.]# grep '^[a-Z]' /etc/zabbix/zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=
PidFile=/var/run/zabbix/zabbix_server.pid
SocketDir=/var/run/zabbix
DBName=zabbix
DBUser=
zabbix
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000

需要关闭SELinux和Firewalld

[root@c71 ~]# getenforce  //查看selinux状态
Enforcing //如果是此状态,需要执行下面的命令,将SeLinux关闭
[root@c71 ~]# setenforce

如果需要永久关闭SELinux需要执行下面的操作:

[root@c71 ~]# sed -i s#SELINUX=enforcing#SELINUX=disabled#g /etc/selinux/config

关闭防火墙:

[root@c71 ~]# systemctl stop firewalld
  [root@c71 ~]# systemctl disable firewalld

启动Zabbix服务器并查看启动状态:

[root@c71 ~]# systemctl start zabbix-server
[root@c71 ~]# systemctl status zabbix-server

[root@c71 ~]# systemctl enable zabbix-server //设置为开机自启动

● zabbix-server.service - Zabbix Server
Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; disabled; vendor preset: disabled)
Active: active (running) since Wed -- :: EDT; 6s ago //启动成功
sed -i 's/# php_value date.timezone Europe/php_value date.timezone Asia/g' /etc/httpd/conf.d/zabbix.conf

sed -i 's/Riga/Shanghai/g' /etc/httpd/conf.d/zabbix.conf

启动httpd服务器,提供网页访问能力:

[root@c71 ~]# systemctl start httpd

[root@c71 ~]# systemctl enable httpd

查看到下面内容说明已经成功启动:

[root@c71 ~]# ps -ef | grep httpd
root : ? :: /usr/sbin/httpd -DFOREGROUND
apache : ? :: /usr/sbin/httpd -DFOREGROUND
apache : ? :: /usr/sbin/httpd -DFOREGROUND
apache : ? :: /usr/sbin/httpd -DFOREGROUND
apache : ? :: /usr/sbin/httpd -DFOREGROUND
apache : ? :: /usr/sbin/httpd -DFOREGROUND
root : pts/ :: grep --color=auto httpd

访问服务器地址,测试:
http://192.168.219.129/zabbix/setup.php

 后面的按实际填写,最后一步的名字是Admin,密码是zabbix:

查看当前Zabbix服务端的配置信息

[root@c71 ~]# cat  /etc/zabbix/web/zabbix.conf.php
<?php
// Zabbix GUI configuration file.
global $DB; $DB['TYPE'] = 'MYSQL';
$DB['SERVER'] = 'localhost';
$DB['PORT'] = '';
$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 = '';
$ZBX_SERVER_NAME = 'test'; $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;

Zabbix服务端一键部署脚本:

rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
yum makecache
yum install zabbix-server-mysql zabbix-web-mysql zabbix-server zabbix-agent mariadb-server -y
systemctl start mariadb
mysqladmin -u root password zabbix
zcat /usr/share/doc/zabbix-server-mysql-3.4.14/create.sql.gz |mysql -uroot zabbix -pzabbix [手动配置]
mysql -uroot -pzabbix <<EOF
create database zabbix charset = utf8;
grant all on zabbix. * to zabbix@localhost identified by 'zabbix';
flush privileges;
EOF
sed -i 's/# DBHost=localhost/DBHost=localhost/g' /etc/zabbix/zabbix_server.conf
sed -i 's/# DBPassword=/DBPassword=zabbix/g' /etc/zabbix/zabbix_server.conf
sed -i 's/# DBPort=3306/DBPort=3306/' /etc/zabbix/zabbix_server.conf
systemctl start zabbix-server
sed -i 's/# php_value/php_value/g' /etc/httpd/conf.d/zabbix.conf
sed -i 's#Europe/Riga#Asia/ShangHai#g' /etc/httpd/conf.d/zabbix.conf
systemctl start httpd systemctl restart zabbix-server
systemctl restart httpd
systemctl restart mariadb
systemctl enable zabbix-server.service
systemctl enable httpd.service
systemctl enable mariadb.service
systemctl stop firewalld
systemctl disable firewalld
cd /usr/share/doc/zabbix-server-mysql-3.4.15/ && zcat create.sql.gz |mysql -uroot zabbix -pzabbix

  


2.Zabbix客户端的配置

CentOS6上安装:

rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/3.4/rhel/6/x86_64/zabbix-agent-3.4.14-1.el6.x86_64.rpm

CentOS7上安装:

rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-agent-3.4.14-1.el7.x86_64.rpm

接下来的步骤已在CentOS6上安装为例:

  

1.Zabbix配置[仅环境搭建]的更多相关文章

  1. Django + Apache + wsgi配置和环境搭建(ubuntu)

    上一篇写了Django + nginx + uwsgi配置和环境搭建(ubuntu) 由于公司服务器环境问题,又配置了apache的环境.记录例如以下: 一. 安装环境: #apache sudo a ...

  2. tomcat配置及环境搭建

    步骤一 下载tomcat 下载tomcat并安装,登陆tomcat官网,http://tomcat.apache.org/,Windows系统建议选择Windows Service Installer ...

  3. zabbix分布式监控环境搭建

    本次测试主要是在 centos 系统环境实践,测试内容:集群多台服务器资源监控做后续铺垫.zabbix的简介和自身的特点.在这就不阐述了 查询防火墙状态service iptables status停 ...

  4. Redis主从配置和哨兵监控配置——服务器端环境搭建

    一:介绍 公司用到的redis框架,主要分为cluster的缓存集群和sentinel中的哨兵主从.这种的选用方式一般需要更具业务场景来做区分,两种框架的配置图为:右图为哨兵主从框架和cliuster ...

  5. zabbix基础之环境搭建

    zabbix入门 环境部署 安装mysql #安装MySQL,官方的MySQL的repo源地址:http://repo.mysql.com/ #选择指定的MySQL版本,我这里选mysql5.7的版本 ...

  6. Android Studio安装配置、环境搭建详细步骤及基本使用

    前言 Android Studio的安装配置及使用篇终于来啦~ 废话不多说,以下针对JDK正确安装(及其环境变量配置完毕,即Java开发环境下).Android Studio的安装,配置,以及创建工程 ...

  7. windows下Qt5.1.0配置android环境搭建 good

    1.首先下载好需要配置的软件: 1>Qt 5.1.0 for Android (Windows 32-bit, 716 MB)(Info)下载地址: http://qt-project.org/ ...

  8. vue环境配置脚手架环境搭建vue工程目录

    首先在初始化一个vue项目之前,我们需要下载node.js,并且安装! 下载地址: nodejs.cn/download 安装完成之后,windows+r 运行命令 cmd  输入node -v  检 ...

  9. settings 配置 + 测试环境搭建

    若想将模型转为mysql数据库中的表,需要在settings中配置: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', ...

随机推荐

  1. [UE4]Reliable,可靠性

    1.Reliable,不会丢失,立刻发出,适合重要的事件 2.Unreliable,可能会丢失,适合表现相关的和不重要的事件 3.全部的远程调用都使用Reliable,可能会造成网络拥堵 4.尽量避免 ...

  2. SCCM2012 R2实战系列之七:软件分发(exe)

    在上一章节中,我们完成了SCCM 2012客户端代理软件的安装,现在就可以为客户端来部署应用程序了. SCCM2012增加了应用程序分发,同时保留了SCCM 2007里的包分发.应用程序分发可以直接对 ...

  3. C# 连接数据库实现增删改查

    class Program { private static string urls = "server=127.0.0.1;port=3306;user=root;password=123 ...

  4. MVC 访问静态页面 View 下面放JS

    http://blog.csdn.net/qq_17255515/article/details/53293120

  5. spark2.3.0 配置spark sql 操作hive

    spark可以通过读取hive的元数据来兼容hive,读取hive的表数据,然后在spark引擎中进行sql统计分析,从而,通过spark sql与hive结合实现数据分析将成为一种最佳实践.配置步骤 ...

  6. 网络基础和python

    ·五层协议 物理层,数据链路层,网络层,传输层,应用层 ·用户上网流程 1.本机获取 2.打开浏览器,,输入网址. 3.dns协议(基于udp协议) 4.HTTP部分的内容 5 TCP协议 6 IP协 ...

  7. SparkStreaming性能调优

    合理的并行度 减少任务启动开销 选择合适的batch Duration 内存调优 设置合理的cpu数

  8. tp3.2 支付宝app支付

    pay方法 /** *支付宝支付 */ public function pay($param) { vendor('alipay.AopSdk');// 加载类库 $config = array( ' ...

  9. linux文件基本权限-基本权限的修改

    基本权限的修改 当我们在linux或unix系统的terminal输入"ls -l"命令时,将输出文件的详细信息.第一列,如“drwxr-xr-x”就是文件的权限信息. yinti ...

  10. wordpress写文章添加gif图片变成静态图片的解决办法

    添加文章时gif只能静态,记得在添加时选择完整尺寸,不要压缩即可