1、zabbix简介

zabbix(音同 zæbix)是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。
zabbix能监视各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题。
zabbix由2部分构成,zabbix server与可选组件zabbix agent。
zabbix server可以通过SNMP,zabbix agent,ping,端口监视等方法提供对远程服务器/网络状态的监视,数据收集等功能,它可以运行在Linux,Solaris,HP-UX,AIX,Free BSD,Open BSD,OS X等平台上。

  更多详细信息请访问zabbix官网:https://www.zabbix.com/

2、zabbix版本选择

  企业使用建议选择zabbix的LTS版本(Long Time Support),尝鲜的可以选择官方的最新版本。

3、zabbix安装

  本篇随笔基于CentOS 7.2编写。适用于CentOS 7所有版本及RedHat系列。

官方yum源:http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
阿里云yum源:https://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
安装官方的yum源 

[root@zabbix-server ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
Retrieving http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
warning: /var/tmp/rpm-tmp.PutPhp: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...1:zabbix-release-3.2-1.el7         ################################# [100%]
[root@zabbix-server ~]#

View Code

  查看都安装了什么

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

View Code

  安装zabbix及其他必须的软件

[root@zabbix-server ~]# yum install -y zabbix-server-mysql zabbix-web-mysql

View Code

  由于CentOS 7比较特殊,MySQL已经没了,只能安装mariadb:

[root@zabbix-server ~]# yum install -y mariadb-server

View Code

  启动并设置开机自启动数据库

[root@zabbix-server bin]# systemctl enable mariadb.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
[root@zabbix-server bin]# systemctl start mariadb.service
[root@zabbix-server bin]#

View Code

  初始化数据库

[root@zabbix-server ~]# find / -type f -name "mysql_secure_installation"
/usr/bin/mysql_secure_installation    #mariadb数据库自带的初始化脚本
[root@zabbix-server ~]#
[root@zabbix-server bin]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set root password? [Y/n] y
New password:    #123456
Re-enter new password:    #123456
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
[root@zabbix-server bin]#

View Code

  创建zabbix数据库

[root@zabbix-server ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.52-MariaDB MariaDB Server
Copyright (c) 2000, 2016, 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.01 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by '123456';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> \q
Bye
[root@zabbix-server ~]#

View Code

  导入zabbix库的数据

[root@zabbix-server ~]# ll /usr/share/doc/zabbix-server-mysql-3.2.7/create.sql.gz
-rw-r--r-- 1 root root 1161488 Jul 19 00:09 /usr/share/doc/zabbix-server-mysql-3.2.7/create.sql.gz
[root@zabbix-server ~]# zcat /usr/share/doc/zabbix-server-mysql-3.2.7/create.sql.gz|mysql -uzabbix -p zabbix
Enter password:
[root@zabbix-server ~]# mysql -uzabbix -p123456 -e "use zabbix;show tables;"
+----------------------------+
| Tables_in_zabbix           |
+----------------------------+
| acknowledges               |
| actions                    |
| alerts                     |
| application_discovery      |
| application_prototype      |
| application_template       |
| applications               |
| auditlog                   |
| auditlog_details           |
| autoreg_host               |
| conditions                 |
| config                     |
| corr_condition             |
| corr_condition_group       |
| corr_condition_tag         |
| corr_condition_tagpair     |
| corr_condition_tagvalue    |
| corr_operation             |
| correlation                |
| dbversion                  |
| dchecks                    |
| dhosts                     |
| drules                     |
| dservices                  |
| escalations                |
| event_recovery             |
| event_tag                  |
| events                     |
| expressions                |
| functions                  |
| globalmacro                |
| globalvars                 |
| graph_discovery            |
| graph_theme                |
| graphs                     |
| graphs_items               |
| group_discovery            |
| group_prototype            |
| groups                     |
| history                    |
| history_log                |
| history_str                |
| history_text               |
| history_uint               |
| host_discovery             |
| host_inventory             |
| hostmacro                  |
| hosts                      |
| hosts_groups               |
| hosts_templates            |
| housekeeper                |
| httpstep                   |
| httpstepitem               |
| httptest                   |
| httptestitem               |
| icon_map                   |
| icon_mapping               |
| ids                        |
| images                     |
| interface                  |
| interface_discovery        |
| item_application_prototype |
| item_condition             |
| item_discovery             |
| items                      |
| items_applications         |
| maintenances               |
| maintenances_groups        |
| maintenances_hosts         |
| maintenances_windows       |
| mappings                   |
| media                      |
| media_type                 |
| opcommand                  |
| opcommand_grp              |
| opcommand_hst              |
| opconditions               |
| operations                 |
| opgroup                    |
| opinventory                |
| opmessage                  |
| opmessage_grp              |
| opmessage_usr              |
| optemplate                 |
| problem                    |
| problem_tag                |
| profiles                   |
| proxy_autoreg_host         |
| proxy_dhistory             |
| proxy_history              |
| regexps                    |
| rights                     |
| screen_user                |
| screen_usrgrp              |
| screens                    |
| screens_items              |
| scripts                    |
| service_alarms             |
| services                   |
| services_links             |
| services_times             |
| sessions                   |
| slides                     |
| slideshow_user             |
| slideshow_usrgrp           |
| slideshows                 |
| sysmap_element_url         |
| sysmap_url                 |
| sysmap_user                |
| sysmap_usrgrp              |
| sysmaps                    |
| sysmaps_elements           |
| sysmaps_link_triggers      |
| sysmaps_links              |
| task                       |
| task_close_problem         |
| timeperiods                |
| trends                     |
| trends_uint                |
| trigger_depends            |
| trigger_discovery          |
| trigger_tag                |
| triggers                   |
| users                      |
| users_groups               |
| usrgrp                     |
| valuemaps                  |
+----------------------------+
[root@zabbix-server ~]#

View Code

  修改zabbix-server配置文件

[root@zabbix-server ~]# vim /etc/zabbix/zabbix_server.conf
# This is a configuration file for Zabbix server daemon
# To get more information about Zabbix, visit http://www.zabbix.com
############ GENERAL PARAMETERS #################
### Option: ListenPort
#       Listen port for trapper.
#
# Mandatory: no
# Range: 1024-32767
# Default:
# ListenPort=10051
### Option: SourceIP
#       Source IP address for outgoing connections.
#
# Mandatory: no
# Default:
# SourceIP=
### Option: LogType
#       Specifies where log messages are written to:
#               system  - syslog
#               file    - file specified with LogFile parameter
#               console - standard output
#
# Mandatory: no
# Default:
# LogType=file
### Option: LogFile
#       Log file name for LogType 'file' parameter.
#
# Mandatory: no
# Default:
# LogFile=
LogFile=/var/log/zabbix/zabbix_server.log
### Option: LogFileSize
#       Maximum size of log file in MB.
#       0 - disable automatic log rotation.
/DBHost
#       1 - critical information
#       2 - error information
#       3 - warnings
#       4 - for debugging (produces lots of information)
#       5 - extended debugging (produces even more information)
#
# Mandatory: no
# Range: 0-5
# Default:
# DebugLevel=3
### Option: PidFile
#       Name of PID file.
#
# Mandatory: no
# Default:
# PidFile=/tmp/zabbix_server.pid
PidFile=/var/run/zabbix/zabbix_server.pid
### Option: DBHost
#       Database host name.
#       If set to localhost, socket is used for MySQL.
#       If set to empty string, socket is used for PostgreSQL.
#
# Mandatory: no
# Default:
# DBHost=localhost
### Option: DBName
#       Database name.
#       For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
#
# Mandatory: yes
# Default:
# DBName=
DBName=zabbix
### Option: DBSchema
#       Schema name. Used for IBM DB2 and PostgreSQL.
#
# Mandatory: no
# Default:
# DBSchema=
### Option: DBUser
#       Database user. Ignored for SQLite.
#
# Mandatory: no
# Default:
# DBUser=
DBUser=zabbix
### Option: DBPassword
#       Database password. Ignored for SQLite.
#       Comment this line if no password is used.
#
# Mandatory: no
# Default:
# DBPassword=
DBPassword=123456
### Option: DBSocket
#       Path to MySQL socket.
#
# Mandatory: no
# Default:
# DBSocket=/tmp/mysql.sock
### Option: DBPort
"/etc/zabbix/zabbix_server.conf" 642L, 14894C written
[root@zabbix-server ~]#

View Code

  启动zabbix-server服务

[root@zabbix-server ~]# systemctl start zabbix-server
[root@zabbix-server ~]# systemctl enable zabbix-server
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.
[root@zabbix-server ~]#

View Code

  设置正确的时区

[root@zabbix-server conf.d]# vim /etc/httpd/conf.d/zabbix.conf
#
# Zabbix monitoring system php web frontend
#
Alias /zabbix /usr/share/zabbix
<Directory "/usr/share/zabbix">Options FollowSymLinksAllowOverride NoneRequire all granted<IfModule mod_php5.c>php_value max_execution_time 300php_value memory_limit 128Mphp_value post_max_size 16Mphp_value upload_max_filesize 2Mphp_value max_input_time 300php_value always_populate_raw_post_data -1php_value date.timezone Asia/Shanghai</IfModule>
</Directory>
<Directory "/usr/share/zabbix/conf">Require all denied
</Directory>
<Directory "/usr/share/zabbix/app">Require all denied
</Directory>
<Directory "/usr/share/zabbix/include">Require all denied
</Directory>
<Directory "/usr/share/zabbix/local">Require all denied
</Directory>
~
~
~
~
~
"zabbix.conf" 37L, 831C written
[root@zabbix-server conf.d]#

View Code

  启动httpd

[root@zabbix-server conf.d]# systemctl start httpd
[root@zabbix-server conf.d]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[root@zabbix-server conf.d]#

View Code

  浏览器访问:http://10.0.0.11/zabbix

web界面会自动检查所有的条件是否满足,未满足的会提示。
配置数据库连接
默认不需要修改,只需要自己随便设置一个name就可以了。
所有的设置信息全部显示,可以查看校验是否有误
成功界面,显示成功安装zabbix,并告知配置文件及路径
登录界面,默认用户名Admin,默认密码zabbix。
登陆之后,进入zabbix监控页
zabbix3.0之后,默认支持中文显示,修改成中文步骤如下
中文显示界面如下

  zabbix-agent客户端安装

[root@zabbix-server~]# yum install -y zabbix-get zabbix-agent    #其中zabbix-agent负责数据收集,zabbix-get是一个server端模拟数据收集的命令,常用语部署自定义监控前的测试工具

View Code

  启动zabbix-agent

[root@zabbix-server conf.d]# systemctl start zabbix-agent.service
[root@zabbix-server conf.d]# systemctl enable zabbix-agent.service
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.

View Code

  检查

[root@zabbix-server conf.d]# netstat -lnutp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      4398/mysqld
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1465/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1774/master
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN      5293/zabbix_agentd
tcp        0      0 0.0.0.0:10051           0.0.0.0:*               LISTEN      4538/zabbix_server
tcp6       0      0 :::80                   :::*                    LISTEN      4685/httpd
tcp6       0      0 :::22                   :::*                    LISTEN      1465/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      1774/master
tcp6       0      0 :::10050                :::*                    LISTEN      5293/zabbix_agentd
tcp6       0      0 :::10051                :::*                    LISTEN      4538/zabbix_server
udp        0      0 127.0.0.1:323           0.0.0.0:*                           3293/chronyd
udp6       0      0 ::1:323                 :::*                                3293/chronyd
[root@zabbix-server conf.d]#

View Code

转载于:https://www.cnblogs.com/jie-fang/p/7288450.html

CentOS 7.2安装zabbix 3.0 LTS相关推荐

  1. CentOS 7 源码安装Zabbix 5.0 LTS

    Zabbix监控系统的Web采用PHP编写而成,需要安装PHP动态解析组件,并用PHP操作数据库.httpd与PHP的交互式通过php-fpm完成的,需要在httpd服务的配置文件中开启FastCGI ...

  2. CENT OS 8 Stream 安装部署 Zabbix 6.0 LTS

    CENT OS 8 Stream 安装部署 Zabbix 6.0 LTS Zabbix架构 信息汇总 CentOS 8 Stream 部署Zabbix6.0 替换CentOS8源为阿里源 替换Cent ...

  3. linux rpm安装zabbix,CentOS 7上安装Zabbix Server 3.0 图文详解

    CentOS 7上安装Zabbix Server 3.0 图文详解 1.查看系统信息. cat /etc/RedHat-release CentOS Linux release 7.0.1406 (C ...

  4. ZABBIX 4.0 LTS+Grafana5.3部署

    一.概述 1.Zabbix 4.0 LTS 2018年10月1日,Zabbix官方正式发布Zabbix 4.0 LTS版本,作为长期支持版本,意味着可以获得官方5年的支持.其中完全支持到2021年10 ...

  5. CentOS 6.6 搭建Zabbix 3.0.3 过程

    分享CentOS 6.6下搭建Zabbix 3.0.3 的过程,希望都大家有所帮助. 环境安装 系统环境: # cat /etc/RedHat-release  CentOS release 6.6 ...

  6. CentOS-7部署安装Zabbix 3.0

    文章目录 **实验目的:** 部署安装Zabbix 3.0: 配置"主机名和hosts解析" 安装MySQL(CentOS-7中更名为 mariadb ) 使用官方yum源安装Za ...

  7. CentOS7 离线安装 ZABBIX 5.0

    小伙伴可能遇到了在公司内网环境下无法访问外网情况,无法访问外网yum源部署ZABBIX 对于rpm包依赖问题比较头疼.本文将会进行离线部署实战. 离线安装所需依赖的rpm包.这个包怎么下载呢?依赖的包 ...

  8. centos 7.4 安装zabbix 3.4

    Centos 7.4 安装Zabbix 3.4 如有兴趣请加群进行交流:435303957 可以关注微信公众号:GZ-Big-Data .贵州大数据架构师 如需转载请注明出处!谢谢 一.安装环境 1 ...

  9. CentOS 8.1安装MySQL 8.0详解

    CentOS 8.1安装MySQL 8.0详解 引言 一.YUM在线安装 0.删除已安装的MySQL 1.添加MySQL Yum Repository 2.选择MySQL版本 3.安装MySQL 4. ...

最新文章

  1. python cx_oracle 有超时的设置吗_python cx_Oracle的基础使用方法(连接和增删改查)
  2. python中bytearray和java中byte[]的区别_Python经典面试题:说说Python中xrange和range的区别?...
  3. ASP.NET 文件上传于下载
  4. 计算机四级软件工程知识点,计算机四级考试题库及搜题软件,送一份备考指南给大家!...
  5. jps出现– process information unavailable解决方法
  6. java 自循环_java自学之:循环问题
  7. TF-tf.keras.layers.MaxPool1D
  8. python实现自动打电话软件_python拨打电话
  9. 浏览器打开是360导航页面解决方法
  10. finecms aip.php漏洞,代码审计| FineCMS的GetShell姿势
  11. Day_03——MySQL数据库查询语句练习
  12. 【kafka】Kafka 快速入门
  13. 绿坝,监控了哪些应用程序?装了绿坝的朋友,使用要小心啊!
  14. 【Vue】 favicon.ico:1 GET http://127.0.0.1:5500/favicon.ico 404 (Not Found)
  15. Python利用有道词典接口制作即时翻译的工具
  16. 多国语言翻译-多国翻译语言软件免费
  17. 图解NebulaGraph-开源国产分布式图数据库!
  18. interFoam进行两相流模拟的一些典型参数设置对比paraview绘制相界面的方法
  19. jQuery EasyUI ztree插件使用
  20. 如何进行“花式”HTTP接口测试

热门文章

  1. 「深度解读」为什么连Google也无法阻挡垂直行业SaaS的浪潮
  2. OC开发_Storyboard——绘制和视图
  3. (转帖)C#--web services之wsdl文件生成cs
  4. windows WEB 服务器安全策略
  5. 印度 语言简称_保存印度的语言和文化:图卢维基百科的诞生
  6. 开源身份证识别_新的开源:金钱,公司和身份
  7. 查询雇佣的所有员工_想要最好的员工? 让他们自己雇用
  8. (39) gulp开发服务器
  9. JavaScript实现继承的几种方式
  10. C++ 数据抽象 封装 接口