zoukankan      html  css  js  c++  java
  • 源码部署zabbix4.0监控

    1.安装依赖环境

    yum -y install telnet net-tools python-paramiko dejavu-sans-fonts python-setuptools python-devel sendmail mailx net-snmp net-snmp-devel net-snm-utils freetype-devel libpng-devel perl unbound libtasnl-devel pll-kit-devel OpenIPMI unix0DBC libevent-devel mysql-devel libxml2-devel libssh2-devel OpenIPMI-devel openldap-devel curl-devel unixODBC-devel wget gcc gcc-c++

    2.下载zabbix-4.0.12.tar.gz安装包

    https://www.zabbix.com/

    3.创建zabbix文件夹

    mkdir /zabbix

    4.解压源码包

    tar -zxf zabbix-4.0.12.tar.gz

    5.进入已解压的文件夹

    cd /zabbix-4.0.12

    6.配置

    ./configure --prefix=/home/zabbix/ --enable-server --enable-agent --enable-java --with-mysql --with-unixodbc --with-libxml2 --with-net-snmp --with-ssh2 --with-openipmi --with-ldap --with-libcurl --with-iconv --with-ssh2 --with-openipmi --with-ldap

    7.编译安装

    make && make install 

    8.查看zabbix版本和是否安装成功

    /home/zabbix/sbin/zabbix_server -V

    9.安装mysql数据库

    yum -y install mariadb-server

    10.启动数据库

    systemctl start mariadb

    11.进行mysql数据库初始化

    mysql_secure_installation

    12.进入数据库,创建zabbix数据库

    create database zabbix character set utf8 collate utf8_bin;

    13.创建zabbix访问数据库的用户

     grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix@lfl123'; 

    14.导入zabbix表结构

     mysql -uzabbix -pzabbix@lfl123 zabbix</root/zabbix-4.0.12/database/mysql/schema.sql
    
     mysql -uzabbix -pzabbix@lfl123 zabbix</root/zabbix-4.0.12/database/mysql/images.sql
    
     mysql -uzabbix -pzabbix@lfl123 zabbix</root/zabbix-4.0.12/database/mysql/data.sql

    15.修改zabbix_serve.conf配置文件

     vim /zabbix/etc/zabbix_server.conf

    检查DBUser=zabbix DBName=zabbix DBPassword=zabbix密码 DBHost=localhost

    16.创建zabbix用户并把用户加入用户组

    groupadd --system zabbix
    
    useradd --system -g zabbix -s /sbin/nologin -c "Zabbix" zabbix

    17.启动zabbix服务

    /home/zabbix/sbin/zabbix_server -c /zabbix/etc/zabbix_server.conf 

    18.更改zabbix配置文件

    vim/zabbix/etc/zabbix_agentd.conf

    19.启动zabbix客户端

    /home/zabbix/sbin/zabbix_agentd -c /zabbix/etc/zabbix_agentd.conf

    20.安装zabbix rpm包源

    rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

    21.安装zabbix web前端

    yum -y install zabbix-web-mysql

    22.修改php配置文件

    cat /etc/php.ini
    
    max_execution_time = 300
    
    max_input_time = 300
    
    max_input_vars = 10000
    
    memory_limit = 128M
    
    post_max_size = 16M
    
    always_populate_raw_post_data = -1
    
    date.timezone ="Asia/Shanghai"

    23.启动httpd服务

    systemctl start httpd

    systemctl enable httpd

    25.访问

    ip:port/zabbix

    26.zabbix服务端安装客户端启动并加入开机自启动

    yum -y install zabbix_agent
    systemctl start zabbix_agent
    systemctl enable zabbix_agent

    27. 被监控端安装zabbix_agent客户端

    rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
    yum -y install zabbix_agent
    systemctl start zabbix_agent
    systemctl enable zabbix_agent
  • 相关阅读:
    xlwt 写sheet xls 文件
    xlrd 安装步骤
    托管DLL和非托管DLL的区别
    MongoDB 第一篇
    memcache
    gitignore忽略规则
    GIT 学习笔记
    前端渲染模板(一):Thymeleaf
    架构实战项目心得(十四):spring-boot结合Swagger2构建RESTful API测试体系
    架构实战项目心得(十一):基于spring-security-oauth2的mysql数据表设计
  • 原文地址:https://www.cnblogs.com/lfl17718347843/p/11534896.html
Copyright © 2011-2022 走看看