窝窝插件 发表于 2019-1-18 11:05:21

Linux 搭建Zabbix监控

  搭建Zabbix监控
  一,搭建Zabbix监控 服务器 192.168.4.21
  1.1 部署服务运行环境 (LAMP/LNMP)
  1.2 安装zabbix 软件(源码)
  软件包:
  zabbix-3.2.3.tar.gz
  php-bcmath-5.4.45-13.el7.remi.x86_64.rpm
  php-mbstring-5.4.45-13.el7.remi.x86_64.rpm
  1.2.1 安装准备
  # yum -y install gcc gcc-c++//安装编译工具
  # rpm -q gcc gcc-c++
  gcc-4.8.5-4.el7.x86_64
  gcc-c++-4.8.5-4.el7.x86_64
  # useradd zabbix//创建运行帐号
  1.2.2 安装Zabbix
  # tar -zxf zabbix-3.2.3.tar.gz
  # cd zabbix-3.2.3/
  # ./configure --help
  --prefix=PREFIX         install architecture-independent files in PREFIX
  
  --enable-server         Turn on build of Zabbix server
  --enable-agent          Turn on build of Zabbix agent and client utilities
  --with-mysql[=ARG]      use MySQL client library , optionally
  specify path to mysql_config
  

  # ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql
  ...
  Now run 'make install'
  ...
  # make install
  # ls /usr/local/zabbix/
  binetclibsbinshare
  

  1.2.3 做初始化配置
  # cp -r frontends/php/ /var/www/html/zabbix
  # ls /var/www/html/zabbix/
  # mysql -uroot -p123456
  MariaDB [(none)]> create database zabbixdb;
  MariaDB [(none)]> grant all on zabbixdb.* to zabbixuser@'localhost' identified by '123456';
  # cd /root/zabbix/zabbix-3.2.3/database/mysql/
  # ls
  data.sqlimages.sqlschema.sql
  # mysql -uzabbixuser -p123456 zabbixdb < schema.sql
  # mysql -uzabbixuser -p123456 zabbixdb < images.sql
  # mysql -uzabbixuser -p123456 zabbixdb < data.sql
  # firefox http://192.168.4.21/zabbix
http://s1.运维网.com/images/20180111/1515673850477180.jpg
http://s1.运维网.com/images/20180111/1515673905497276.jpg
  # vim /etc/php.ini
  672 post_max_size = 16M
  384 max_execution_time = 300
  394 max_input_time = 300
http://s1.运维网.com/images/20180111/1515673960471869.jpg
http://s1.运维网.com/images/20180111/1515673986772548.jpg   

  # yum list | grep -i php-gd
  php-gd.x86_64                           5.4.16-36.el7_1            dvd
  # yum -y install php-gd.x86_64
  # yum list | grep -i php-xml
  php-xml.x86_64                        5.4.16-36.el7_1            dvd
  php-xmlrpc.x86_64                     5.4.16-36.el7_1            dvd
  # yum -y install php-xml
  # rpm -ivh --nodeps php-mbstring-5.4.45-13.el7.remi.x86_64.rpm
  # rpm -ivh --nodeps php-bcmath-5.4.45-13.el7.remi.x86_64.rpm
http://s1.运维网.com/images/20180111/1515674150567012.jpg
http://s1.运维网.com/images/20180111/1515674094711693.jpg
http://s1.运维网.com/images/20180111/1515674172826594.jpg
http://s1.运维网.com/images/20180111/1515674208282897.jpg
# chmod o+w /var/www/html/zabbix/conf
      # ls /var/www/html/zabbix/conf
      maintenance.inc.phpzabbix.conf.phpzabbix.conf.php.example
      # cat /var/www/html/zabbix/conf/zabbix.conf.php
页: [1]
查看完整版本: Linux 搭建Zabbix监控