zoukankan      html  css  js  c++  java
  • zabbix 3.0 快速安装文档

    系统要求:Red Hat Enterprise Liunx/Centos  7
     
    Zabbix安装:

    # rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
    zabbix 官方源中包含了fping,iksemel,libssh2,在non-supported中
     
    Server端
    # yum install zabbix-server-mysql zabbix-web-mysql
    Agent端
    # yum install zabbix-agent
     
    数据库安装:

    centos 7的yum 源默认没有mysql
    需要先下载mysql的repo源
    # wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
    # rpm -ivh mysql-community-release-el7-5.noarch.rpm
    # yum install mysql-server
    安装完成后默认没有密码
    登陆mysql时提示ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2),原因是/var/lib/mysql的访问权限问题。下面的命令把/var/lib/mysql的拥有者改为当前用户:
    #chown -R root:root /var/lib/mysql
    重启
    #systemctl restart mysqld
     
    导入数据结构
    正常方式:
    shell> mysql -uroot -p<password>
    mysql> create database zabbix character set utf8 collate utf8_bin;
    mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<password>';
    mysql> quit;
    shell> cd database/mysql
    shell> mysql -uzabbix -p<password> zabbix < schema.sql
    # stop here if you are creating database for Zabbix proxy
    shell> mysql -uzabbix -p<password> zabbix < images.sql
    shell> mysql -uzabbix -p<password> zabbix < data.sql
    取巧方式:
    shell> mysql -uroot -p<password>
    mysql> create database zabbix character set utf8 collate utf8_bin;
    mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<password>';
    mysql> quit;
    # cd /usr/share/doc/zabbix-server-mysql-3.0.0
    # zcat create.sql.gz | mysql -uroot zabbix
     
    编辑Zabbix-Server 配置文件
    # vim /etc/zabbix/zabbix_server.conf
    DBHost=localhost
    DBName=zabbix
    DBUser=zabbix
    DBPassword=zabbix
     
    启动,注意关闭selinux setenforce 0 和防火墙
    # systemctl start zabbix-server
     
    修改php的“date.timezone”
    # 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 Europe/Riga  打开注释,修改时区
    启动http
    # systemctl start httpd
    登陆网页设置zabbix-web 默认账号密码是Admin/zabbix
     
    中文支持:

     
    通过修改web端源文件来开启中文语言
    vim /usr/share/zabbix/include/locales.inc.php
    'zh_CN' => ['name' => _('Chinese (zh_CN)'), 'display' => true], #也就是把false改为true
    更换语言后,图形会出现乱码,需要修改配置文件
    vim /usr/share/zabbix/include/defines.inc.php
     
    #修改第93行
    define('ZBX_FONT_NAME', 'msyh'); 
    #修改第45行改为 
    define('ZBX_GRAPH_FONT_NAME', 'msyh')
    下载微软雅黑字体,改名为msyh传入/usr/share/zabbix/fonts 目录下即可。
  • 相关阅读:
    Goahead在linux环境下安装部署
    vim卡住怎么办
    Clickhouse 实现 row number功能
    JavaScript ES6 模块化
    MySQL012事务的四个基本特征是什么
    MySQL015简述mysql中索引类型有哪些,以及对数据库的性能的影响
    MySQL010MySQL执行计划怎么看
    JavaScript ES6 Promise
    MySQL011如何处理MySQL的慢查询
    MySQL009MySQL为什么需要主从复制和读写分离
  • 原文地址:https://www.cnblogs.com/wang-yc/p/5489743.html
Copyright © 2011-2022 走看看