plantegg 发表于 2019-1-22 10:09:53

Zabbix实战笔记

              
  
                     Zabbix监控系统安装详解
  
  1使用ntp同步时间
  ntpdate ntp.sjtu.edu.cn
  2关闭防火墙
  Iptable -F
  3下载zabbix软件包
  wgethttp://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix_2.4.5.orig.tar.gz
  4安装lamp环境包
  # yum -y install httpd php mysql-server mysql-devel php-gd gcc php-mysql php-xml libcurl-devel crul-* net-snmp* libxml2-*
  5另外zabbix还需要两个软件包需要安装
  
  Php-bcmatphp-mbstring 这两个yum里没有所以得下载
  wget http://dl.cactifans.org/tools/php-bcmath-5.3.3-22.el6.x86_64.rpm
wget http://dl.cactifans.org/tools/php-mbstring-5.3.3-22.el6.x86_64.rpm
  
  # rpm -ivh php-bcmath-5.3.3-22.el6.x86_64.rpm--nodeps
  # rpm -ivh php-mbstring-5.3.3-22.el6.x86_64.rpm--nodeps
  
  
  Ok解压zabbix,进行编译
  # ./configure--prefix=/application/zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
  
  # make install
  
  
  Ok启动apache服务和mysql服务
  # /etc/init.d/httpdstart
  正在启动 httpd:
  # /etc/init.d/mysqld start
  正在启动 mysqld:                                          [确定]
  # chkconfighttpd on
  # chkconfig mysqld on
  
  
  
  设置数据库编码
  在mysqld添加
  character-set-server=utf8
  在文件末尾添加
  
  default-character-set= utf8
  
  
  重启mysql
  # /etc/init.d/mysqldrestart
  
  
  进入mysql安全配置,按里面提示部署
  # mysql_secure_installation
  
  
  进入mysql,创建zabbix库
  mysql> create database zabbix;
  Query OK, 1 row affected (0.00 sec)
  创建用户
  mysql> grant all on zabbix.* to zabbix@localhost identified by '123.com';
  Query OK, 0 rows affected (0.00 sec)
  
  
  
  导入zabbix数据库
  # mysql -uzabbix -p123.com zabbix
页: [1]
查看完整版本: Zabbix实战笔记