关闭selinux和防火墙

selinux关闭:

1 命令查看出selinux的状态
sestatus -v
2 临时关闭 selinux
setenforce 0
3 永久关闭selinux
vi /etc/sysconfig/selinux
把里边的一行改为
SELINUX=disabled 防火墙关闭:
(之前的版本)
service stop iptables 关闭iptables
chkconfig iptables off 开机不启动
(现在的版本)
systemctl stop firewalld。service
systemctl disable firewalld。service

一、刚刚开始安装zabbix时候需要配置zabbix源和epel源

zabbix源配置:

[zabbix]
name=zabbix
baseurl=http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/
# 或则 baseurl=http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/ 两个都可以
gpgcheck=0
enabled=1
 
epel源配置:(什么版本系统选什么源)

epel(RHEL 7)

	wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

epel(RHEL 6)

	wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo

epel(RHEL 5)

	wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-5.repo

yum  makecache    先确定网络能通,否则:

[root@localhost ~]# yum makecache
已加载插件:fastestmirror
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的名称或服务"

One of the configured repositories failed (未知),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

1. Contact the upstream for the repository and get them to fix the problem.

2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).

3. Run the command with the repository temporarily disabled
yum --disablerepo=<repoid> ...

4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:

yum-config-manager --disable <repoid>
or
subscription-manager repos --disable=<repoid>

5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:

yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: base/7/x86_64

 
二、安装zabbix对应的包(如果一台主机扮演三个端,那么可以都安装上,但是一般来说,都是在zabbix服务端安装zabbix-server-mysql ,zabbix-web, zabbix-web-mysql)
yum install -y zabbix-server-mysql zabbix-get # 服务端安装的包
yum install -y zabbix-agent zabbix-sender # agent端安装的包
yum install -y zabbix-web zabbix-web-mysql # web-GUI端安装的包
 
三、安装zabbix DB:(在/etc/my.cfg中加入   skip_name_resolve=on innodb_file_per_table=on)
yum install mariadb-server
systemctl start mariadb.service

[root@localhost ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database zabbix charset 'utf8';
MariaDB [(none)]> grant all on zabbix.* to zabbix@'192.168.23.%' identified by '123456';
MariaDB [(none)]> flush privileges;
 
四、zabbix server数据库初始化:
2.0系列:导入三个sql脚本,这三个脚本要按顺序执行
3.0系列: 导入一个sql脚本 :create.sql
cd /usr/share/doc/zabbix-server-mysql-3.0.10/
gzip -d create.sql.gz
mysql -h192.168.23.67 -uzabbix -p123456 zabbix < create.sql
登入到mysql,可以查看zabbix数据库中初始化生成的表
 
五、启动zabbix-server进程
①:启动zabbix-server进程会读取配置文件:/etc/zabbix/zabbix_server.conf,这个配置文件中的指令有四类
GENERAL PARAMETERS
ADVANCED PARAMETERS
LOADABLE MODULES
TLS-RELATED PARAMETERS
 
②:修改 GENERAL PARAMETERS 中的指令
ListenPort=10051 : 监听的端口号
SourceIP= :授权使用的监控的IP地址,如果服务器有多个IP地址,有必要的情况下,只需要监听一个IP即可
LogType=file :日志的类型
LogFile=/var/log/zabbix/zabbix_server.log:日志的路径
LogFileSize=0 :日志滚动的阈值,0表示不滚动
PidFile=/var/run/zabbix/zabbix_server.pid :pid的存放文件
DBHost=192.168.23.67 :指定数据库的主机地址
DBName=zabbix (zabbix数据库名称)
DBUser=zabbix (连接数据库的用户名)
DBPassword=123456 (数据库密码)
DBSocket=/var/lib/mysql/mysql.sock (mariadb是通过yum安装的,因此socket文件不在/tmp目录下面)
 
③:启动服务
systemctl start zabbix-server.service  (按照以上步骤操作,不知道什么情况启动不了,然后试了一下又可以了,可以的话帮忙解决以下)
④:确保本机的trousers程序包版本一定是0.3.11之后的版本
 
6、配置zabbix-web (在安装 zabbix-web和zabbix-web-mysql的时候,默认会安装httpd程序包和php-mysql程序包)
①:配置php的时区
1:php.ini
2:/etc/httpd/conf.d/zabbix.conf(使用这个)
php_value date.timezone Asia/Shanghai :表示在mod_php5.c模块里面,设定为上海的时间
②:启动httpd
systemctl start httpd
 
7、登入http://192.168.23.67/zabbix/页面
 
8、进入zabbix页面后需要填写:Database  type  (mysql)
                                                   Database host (zabbix,service的ip)
                                                   Database port (zabbix配置文件中配置的3306)
                                                   Database name (zabbix)
                                                  User   (zabbox)
                                                  passwd (密码1234546)
9:设置数据库的连接方式,如:数据库名,用户名,密码等,如果在设置的时候写错了,可以直接修改/etc/zabbix/web/zabbix.conf.php文件
 
10:zabbix-web的登入名为:admin,密码为:zabbix
 
 
 
 
 

搭建zabbix详细步骤的更多相关文章

  1. 搭建SSH详细步骤及相关说明

    因为手里已有相关jar,为方便我搭建的是:Struts2.0+Hibernate3.3+Spring3.0,数据库:MySQL 如果想搭建最新的,在官网上下载最新jar即可. 这里会对比MyEclip ...

  2. vue框架搭建的详细步骤(一)

    在这里我们先快速的搭建一个vue的脚手架: (1).在安装vue的环境之前,安装NodeJS环境是必须的.可以使用node -v指令检查,需要保证安装了4.0版本以上的nodeJS环境. 没有安装的话 ...

  3. elk搭建的详细步骤以及说明

    一:准备工作 1.准备一台虚拟机 192.168.175.222      elk-node2 2.关闭防火墙以及selinux 命令:systemctl stop firewalld       # ...

  4. Hbase 0.98集群搭建的详细步骤

    准备工作 Hbase的搭建是依赖于Hadoop的,Hbase的数据文件实际上存储在HDFS文件系统中,所以我们需要先搭建hadoop环境,之前的博文中已经搭建过了(详见http://www.cnblo ...

  5. 利用docker搭建yii2 详细步骤

    定位镜像 在hub.docker.com 搜索yii2,并且最后定位到 https://hub.docker.com/r/codemix/yii2-base/codemix/yii2-base 然后在 ...

  6. hadoop2.6.4的HA集群搭建超详细步骤

    hadoop2.0已经发布了稳定版本了,增加了很多特性,比如HDFS HA.YARN等.最新的hadoop-2.6.4又增加了YARN HA 注意:apache提供的hadoop-2.6.4的安装包是 ...

  7. vue框架搭建的详细步骤之项目结构(二)

    上一篇中简单的创建了一个脚手架,这篇简单的讲一下脚手架的项目结构:     (1).build/ 此目录包含开发服务器和生产webpack构建的实际配置.通常,您不需要触摸这些文件,除非您要自定义We ...

  8. 吴裕雄--天生自然JAVA SPRING框架开发学习笔记:SSH框架(Struts2+Spring+Hibernate)搭建整合详细步骤

    在实际项目的开发中,为了充分利用各个框架的优点,通常都会把 Spring 与其他框架整合在一起使用. 整合就是将不同的框架放在一个项目中,共同使用它们的技术,发挥它们的优点,并形成互补.一般而言,在进 ...

  9. 顶 最新简捷实用的JSP动态网站环境搭建详细步骤

    阿里西西小编给您推荐这个最新简捷实用的JSP动态网站环境搭建详细步骤讲解,这里还有关于JSP 动态网站 环境 搭建 的教程,希望您能够喜欢并学到东西提升自己的知识与技能,下面是内容详细阅读: 最新简捷 ...

随机推荐

  1. Linux入门第一天——环境搭建补充内容(xshell与虚拟机等操作)

    一.xShell的安装和使用 前往官网下载一个个人版的 xShell :https://www.netsarang.com/products/xsh_overview.html 要更换免费版的putt ...

  2. pythonDjango开发-安装第三方插件

    Python安装插件方式: 1.easy_install package 2.pip install package 如果pip安装报错,可以使用以下两种方法解决: 1.python -m pip i ...

  3. Openstack入门篇(十六)之Cinder服务的部署与测试

    1.理解块存储服务 操作系统获得存储空间的方式一般有两种: 通过某种协议(SAS,SCSI,SAN,iSCSI 等)挂接裸硬盘,然后分区.格式化.创建文件系统:或者直接使用裸硬盘存储数据(数据库) 通 ...

  4. TMS320VC5509启动模式选择

    1. TMS320VC5509内部没有存储空间,所以需要外部接flash.如果使用JTAG仿真板子的话,应该是选择USB下载模式,同时EEPROM应该是支持SPI FALSH的.

  5. 【操作系统】C语言编写的FAT16文件系统

    [操作系统]C语言编写的FAT16文件系统 这是操作系统的期末课程设计作业之一,主要功能是在物理内存中虚拟出一个1M大小的FAT16的文件系统,然后把它读入内存中,进行具体的文件操作,具体的实用性不大 ...

  6. 封装的一套简单轻量级JS 类库(RapidDevelopmentFramework.JS)

    1.最近好久没有更新自己的博客了,一直在考虑自己应该写一些什么.4.2日从苏州回到南京的路上感觉自己的内心些崩溃和失落,我就不多说了? 猛然之间我认为自己需要找一下内心的平衡.决定开发属于自己一套快速 ...

  7. python笔记--冒泡排序升级版

    前言 面试的时候经常有面试官喜欢问如何进行冒泡排序?这个问题相信能难倒一批英雄好汉,本篇就详细讲解如何用python进行冒泡排序. 一.基本原理 1.概念: 冒泡排序(Bubble Sort),是一种 ...

  8. 你这一辈子要用到的C数学函数都在这

       两数相加  #include <stdio.h> int main(void){ int a = 10;  //定义变量a, 把10 赋值给a int b = 20;  //定义变量 ...

  9. Python中格式化format()方法详解

    Python中格式化format()方法详解 Python中格式化输出字符串使用format()函数, 字符串即类, 可以使用方法; Python是完全面向对象的语言, 任何东西都是对象; 字符串的参 ...

  10. 推荐3个小程序开源组件库——Vant、iView、ColorUI

    推荐3个小程序开源组件库 在进行小程序开发时,经常会遇到编写组件方面的阻碍,这让我们花费大量的时间在页面以及 CSS 样式编写上.因此可以使用开源组件库,有些复杂的组件可以直接拿来使用,节省开发时间, ...