zoukankan      html  css  js  c++  java
  • zabbix的安装与配置

    1、安装zabbix的扩展源

    zabbix官网https://www.zabbix.com,注意32位和64位

    rpm -i https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

    2、zabbix的安装

    安装扩展源 yum  -y  install  epel-release

    yum update  升级yum源

    安装apm报需要的lamp环境yum  install  -y  httpd  mysql mysql-libs  php php-mysql mysql-server  php-bcmath  php-gd  php-mbstring

    安装zabbix的服务端  yum  -y install    zabbix-agent   zabbix-get  zabbix-server-mysql   zabbix-web  zabbix-web-mysql

    /etc/init.d/zabbix-server      start    /etc/init.d/zabbix-agent start          /etc/init.d/httpd start   (service zabbix-server start )   (systemctl  zabbix-server start)

    3、修改mysql配置

     vi  /etc/my.cnf

    [mysql]
    default-character-set=utf8
    [mysqld]
    character_set_server=utf8

    启动mysqld服务service   mysqld  start

    建库导入数据     

    mysql -uroot -p

    mysql> create database zabbix character set utf8;

    mysql> grant all    on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix';

    mysql> flush privileges;

    cd  /usr/share/doc/zabbix-server-mysql-3.0.12/create.sql.gz 

    gzip   -d   create.sql.gz 

    mysql -uroot   -p  zabbix < create.sql

    systemctl enable httpd

    修改zabbix-server的配置文件,并启动

    vim /etc/zabbix/zabbix_server.conf

    DBHost=127.0.0.1  //在DBName=zabbix上面

    DBPasswd=zabbix    //在DBuser下面

    systemctl  start zabbix-server

    systemctl  enable zabbix-server

    netstat  -lnp |grep zabbix   zabbix-server监听10051端口

    如果不能启动查看   /var/log/message   /var/log/zabbix/zabbix_server.log

    如果遇到下列问题

    问题所在

    zabbix_server[46512]: segfault at 18 ip 00007f78842b4bd0 sp 00007fff1995a818 error 4 in libpthread-2.17.so[7f78842ab000+16000]

    产生原因

    Centos7 中 gnutls.x86_64 (gnutls.x86_64 3.3.8-14.el7_2 ) 版本过高,需要降级 3.1.18-8.el7(1.20)

    解决办法  http://rpm.pbone.net/index.php3/stat/4/idpl/27382700/dir/scientific_linux_7/com/gnutls-3.1.18-8.el7.x86_64.rpm.html/  下载,

     降级  rpm -Uvh --force gnutls-3.1.18-8.el7.x86_64.rpm

    [root@localhost ~]# rpm -Uvh --force gnutls-3.1.18-8.el7.x86_64.rpm
    warning: gnutls-3.1.18-8.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 192a7d7d: NOKEY
    error: Failed dependencies:
        gnutls(x86-64) = 3.3.8-12.el7 is needed by (installed) gnutls-dane-3.3.8-12.el7.x86_64
        gnutls(x86-64) = 3.3.8-12.el7 is needed by (installed) gnutls-utils-3.3.8-12.el7.x86_64
    [root@localhost ~]# yum -y remove gnutls-dane-3.3.8-12.el7.x86_64

    重启zabbix-server

    systemctl  restart  zabbix-server.service  

     4、进入web界面进行配置

    http://180.76.162.180/zabbix

    vi  /etc/php.ini
    date.timezone = Asia/Shanghai
    max_execution_time = 300
    post_max_size = 32M
    max_input_time=300
    memory_limit = 128M

     登录账户admin,密码zabbix

    zabbix客户端安装

    rpm  -i   https://repo.zabbix.com/zabbix/3.4/rhel/6/i386/zabbix-agent-3.4.0-1.el6.i686.rpm

    yum  -y  install  zabbix-agent

    配置配置 zabbix_agentd.conf 文件

    vi /etc/zabbix/zabbix_agentd.conf

    LogFile=/tmp/zabbix/zabbix_agent.log

    Server=180.76.162.180                              (写zabbix服务器的ip)

    ServerActive= 180.76.162.180                        (写zabbix服务器的ip)

    Hostname=162.180                     (zabbix服务器页面添加时的主机相同)                          

    UnsafeUserParameters=1 

    Include=/etc/zabbix/zabbix_agentd.conf.d/

    配置并启动服务

    service zabbix-agent restart

    chkconfig zabbix-agent on

     netstat  -lnp  |grep  zabbix

    web界面增加主机

    参考https://blog.csdn.net/zongyimin/article/details/51250382

    I can feel you forgetting me。。 有一种默契叫做我不理你,你就不理我

  • 相关阅读:
    年末反思
    Flink运行时架构
    Phoenix 启动报错:Error: ERROR 726 (43M10): Inconsistent namespace mapping properties. Cannot initiate connection as SYSTEM:CATALOG is found but client does not have phoenix.schema.
    Clickhouse学习
    Flink简单认识
    IDEA无法pull代码到本地,Can't Update No tracked branch configured for branch master or the branch doesn't exist.
    第1章 计算机系统漫游
    简单的 Shell 脚本入门教程
    开源≠免费 常见开源协议介绍
    MySQL 视图
  • 原文地址:https://www.cnblogs.com/weidaijie/p/9576955.html
Copyright © 2011-2022 走看看