【zabbix 监控】第一章 zabbix的安装配置

安装前准备

一、下载网络yum源:

http://mirrors.163.com/.help/centos.html
https://opsx.alibaba.com/mirror
1、首先备份/etc/yum.repos.d/CentOS-Base.repo,备份之前要先安装weget(yum -y install wget)mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、选择下载一下两个中任意一个yum源
网易163 yum源:
下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
• CentOS7
• CentOS6
• CentOS5
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo #163的yum源,下载到指定目录下wget http://mirrors.163.com/.help/CentOS7-Base-163.repo -P /etc/yum.repos.d/

阿里云yum源:https://opsx.alibaba.com/mirror
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
注:关于wget的几个参数介绍:
-O 指定保存的文件名后下载文件
-c 断点续传
--limit-rare 限速下载 例: wget --limit-rare=3K /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 

3、运行以下命令生成缓存
yum clean all
yum makecache

二、防火墙设置

1、可以开启防火墙:
[[email protected] ~]# firewall-cmd --permanent --add-service=http
success
[[email protected] ~]# firewall-cmd --permanent --add-service=https
success
[[email protected] ~]# firewall-cmd --reload
success
[[email protected] ~]# systemctl enable firewalld.service

2、如果感觉麻烦可以考虑关闭防火墙:
[[email protected] ~]# systemctl stop firewalld.service
[[email protected] ~]# systemctl disable firewalld.service

三、关闭SELINUX

1、查看SElinux状态:
[[email protected] ~]#/usr/sbin/sestatus -v #如果SELinux status参数为enabled即为开启状态
SELinux status: enabled
[[email protected] ~]# getenforce
Disabled
2、关闭SELinux:
(1)临时关闭(不用重启机器):
setenforce 0 #设置SELinux 成为permissive模式
#setenforce 1 设置SELinux 成为enforcing模式
(2)永久关闭(需要重启服务器)
修改配置文件:
[[email protected] ~]# vim /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled
或者sed关闭:
[[email protected] ~]# sed -i "s/^SELINUX\=enforcing/SELINUX\=disabled/g" /etc/selinux/config

开始安装zabbix

1、参考官网提供的zabbix帮助手册:https://www.zabbix.com/documentation/3.2/manual

2、搭建zabbix的yum仓库:
由于我们epl的yum仓库里存放的zabbix的版本较低,所以我们先搭建一个zabbix的yum仓库,服务端和客户端上都要做这个步骤。

安装过程中如遇见了如下问题,是与原来yum发生冲突卸载即可(此问题是我重复安装zabbix 不同版本yum源导致,一般不会出现):
[[email protected] yum.repos.d]# rpm -ivh http://mirrors.aliyun.com/zabbix/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
获取http://mirrors.aliyun.com/zabbix/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
警告:/var/tmp/rpm-tmp.DERtgj: 头V4 RSA/SHA512 Signature, 密钥 ID a14fe591: NOKEY
准备中... ################################# [100%]
file /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX from install of zabbix-release-3.2-1.el7.noarch conflicts with file from package zabbix-release-3.0-1.el7.noarch
file /etc/yum.repos.d/zabbix.repo from install of zabbix-release-3.2-1.el7.noarch conflicts with file from package zabbix-release-3.0-1.el7.noarch
[[email protected] yum.repos.d]# yum -y remove zabbix-release-3.0-1.el7.noarch

 如果没有上述问题直接往下执行:

[[email protected] ~]#rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
或者用下边的方法
[[email protected] yum.repos.d]# rpm -ivh http://101.110.118.57/repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm

[[email protected] ~]# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-get

Error downloading packages:
iksemel-1.4-2.el7.centos.x86_64: [Errno 256] No more mirrors to try.
fping-3.10-1.el7.x86_64: [Errno 256] No more mirrors to try.
zabbix-web-mysql-3.2.11-1.el7.noarch: [Errno 256] No more mirrors to try.
zabbix-server-mysql-3.2.11-1.el7.x86_64: [Errno 256] No more mirrors to try.

yum -y install unixODBC #一个链接数据库的组件, fping

[email protected] ~]#  yum -y install mariadb mariadb-server

[[email protected] ~]#systemctl enable mariadb ;systemctl start mariadb
[[email protected] ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 43
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 character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on zabbix.* to [email protected] identified by ‘yanglt‘;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]>  flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit

[[email protected] ~]# cd /usr/share/doc/zabbix-server-mysql-3.2.11/
[[email protected] zabbix-server-mysql-3.2.11]#  zcat create.sql.gz | mysql -uroot zabbix  #解压并导入库
[[email protected] zabbix-server-mysql-3.2.11]# 

[[email protected] ~]#vim /etc/zabbix/zabbix_server.conf
修改一下内容:
[[email protected] ~]# vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=yanglt

[[email protected] ~]#  systemctl enable zabbix-server.service ;systemctl start zabbix-server.service 

[[email protected] ~]# vim /etc/httpd/conf.d/zabbix.conf
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
php_value date.timezone Asia/Shanghai     #只需要增加一行,或者修改时区
[[email protected] ~]# systemctl enable httpd
[[email protected] ~]# systemctl start httpd

打开网页:http://192.168.19.128/zabbix

密码为数据库授权用户密码:

默认用户名:Admin

密码:zabbix

你好

原文地址:https://www.cnblogs.com/yangleitao/p/9475651.html

时间: 2024-07-31 05:57:47

【zabbix 监控】第一章 zabbix的安装配置的相关文章

java基础 第一章上(安装 配置java、简单dos命令)

一.安装 配置java     下载安装          1.java官网下载jdk(32位或者64位根据自己电脑而定). 2.双击jdk.exe文件安装. 环境变量配置 右击我的电脑--属性--高级系统设置--环境变量--找path变量--在path变量最前面输入java文件中bin的路径--再找classpath变量最前面加英文"   . ;". 1.   2.  3.   4.    5.最后点击确认完成java配置. 6.在命令提示符中输入javac 查看是否配置成功. 显示

zabbix专题:第一章 zabbix入门简介(更新中)

zabbix入门简介 备注:本章节图片来自互联网 对Linux有兴趣的朋友加入QQ群:476794643 在线交流 本节目录大纲 zabbix专题:第一章 zabbix简介 我们为什么需要监控? 常用的开源监控系统有哪些? Zabbix是什么? Zabbix的功能和特性 Zabbix的架构 Zabbix的工作流程 zabbix的进程 zabbix的逻辑关系图 zabbix监控环境中相关术语 zabbix的流程图,其串联了各术语之间的关系 zabbix的监控架构 zabbix专题:第一章 zabb

zabbix监控实战<2>----zabbix-server的安装与部署

第一章     zabbix-server的安装与部署 1.1  环境部署 eth0                               eth1 master      10.0.0.71                     172.16.1.71 node1       10.0.0.81                     172.16.1.81 1.2   安装zabbix-server 一. [[email protected] ~]# rpm -ivh https:/

zabbix监控之基于LNMP环境安装

本文描述zabbix在lnmp环境中的搭建过程,为减少配置难度,mysql,php采用yum安装. 本安装过程以直接高效的方式叙述. 1.Yum安装mysql mysql使用yum安装方式 yum install mysql-servermysql-devel mysql /etc/init.d/mysqld start 2.Yum安装php yum安装后的php配置文件是/etc/php.ini. yum install -y php php-mysqlphp-gd libjpeg* php-

zabbix监控之二----Zabbix受控端及监控项

4.station32受控端安装zabbix 4.1:下载所需要用的的程序包:只有受控端是主动模式时才需要装zabbix-sender [[email protected]]# yum -y localinstall \ zabbix-2.2.3-1.el6.x86_64.rpm\               # 主程序server端/agent端都需要 zabbix-agent-2.2.3-1.el6.x86_64.rpm\         # 受控端安装agent程序 zabbix-send

Zabbix监控之使用Zabbix监控windows主机【7】

Zabbix监控 之使用Zabbix监控windows主机[7] 我们前面介绍了Zabbix3.0监控linux主机,今天我们使用Zabbix监控windows主机,其实操作都是一样的:具体见下:我们首先下载windows zabbix agent安装服务:我们第一个url是下载链接,第二个第三个是最新的3.0和2.2.9的下载链接:http://www.zabbix.com/download.phphttp://www.zabbix.com/downloads/3.0.0/zabbix_age

06: Zabbix基础 、 Zabbix监控实战 、 Zabbix报警机制

部署搭建Zabbix监控服务器 192.168.4.56 部署Zabbix监控服务运行环境 LAMP 安装Zabbix软件2.1 安装准备]# rpm -q gcc gcc-c++]# useradd zabbix 2.2 安装软件包]# tar -zxf zabbix-3.2.3.tar.gz]# cd zabbix-3.2.3/]# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mys

第一章 Hue的安装

第一章 Hue的安装 1.Hue的介绍 HUE=Hadoop User Experience ? Hue是一个开源的Apache Hadoop UI系统,由Cloudera Desktop演化而来,最后Cloudera公司将其贡献给Apache基金会的Hadoop社区,它是基于Python Web框架Django实现的. ? 通过使用Hue我们可以在浏览器端的Web控制台上与Hadoop集群进行交互来分析处理数据,例如操作HDFS上的数据,运行MapReduce Job,执行Hive的SQL语句

linux监控平台介绍,zabbix监控介绍,zabbix安装,忘记Admin密码如何做

linux监控平台介绍 cacti.nagios.zabbix.smokeping.open-falcon等等 cacti.smokeping偏向于基础监控,成图非常漂亮 cacti.nagios.zabbix服务端监控中心,需要php环境支持,其中zabbix和cacti都需要mysql作为数据存储,nagios不用存储历史数据,注重服务或者监控项的状态,zabbix会获取服务或者监控项目的数据,会把数据记录到数据库里,从而可以成图 open-falcon为小米公司开发,开源后受到诸多大公司和

Zabbix监控 之sendEmail脚本邮件报警配置【5】

本次zabbix邮件报警时通过sendEmail这一个轻量级的命令行的smtp电子邮件客户端,使用脚本的方式实现邮件报警. 此次使用的Linux发行版是CentOS 6.5,zabbix版本为3.0.3 Zabbix监控之不发送邮件异常[附属] 一.下载sendEmail wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz sendEmail安装方法: 1 2 3 shell# tar xv