色婆ijqwj 发表于 2019-1-20 14:07:16

zabbix的安装与配置

  注:邮箱监控还没有做会尽快弄好如有雷同纯属偶然
  1,gcc,lamp环境和其他一些的zabbix的依赖软件包
  yum -y install gcc* httpd mysql mysql-server mysql-devel php php-mysql php-common php-mbstring php-gd php-odbc php-pear curl curl-devel net-snmp net-snmp-devel perl-DBI php-xml ntpdatephp-bcmath
  

  #同步服务端的时间保持所有服务器时间一致
  server:

  编辑 /etc/ntp.conf文件
  添加信息restrict 192.168.121.0 mask 255.255.255.0 nomodify notrap

  server 127.127.1.0
  fudge 127.127.1.0 startum 10
https://s1.运维网.com/wyfs02/M02/97/9F/wKiom1kwuPjzObXeAABtTVjehsE042.png-wh_500x0-wm_3-wmp_4-s_83791915.png
  

  #重启服务
  service ntpd start
  client:

  vim /etc/ntp.conf
https://s2.运维网.com/wyfs02/M01/97/A1/wKioL1kwvgPANUR0AAAPAHai3jM355.png-wh_500x0-wm_3-wmp_4-s_3852892658.png
  ntpdate -u 192.168.121.1
  

  chkconfig ntpdate on
  

  server:添加zabbix运行所需要的用户和组
     useradd zabbix
  启动mysql并进行密码设置及用户授权
  service mysqld start
  

  mysqladmin -uroot password '123123'
  

  mysql -utoot -p
  

  create database zabbix;


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

  编译安装zabbix
  

  

  server
  

  1,下载解压zabbix,并导入数据库文件
  

  mkdir /cdrom
  

  mount -o loop zabbix.iso /cdrom
  

  cp -a /cdrom/* .
  

  tar -xf zabbix-2.2.2.tar.gz
  

  cd zabbix-2.2.2.tar.gz
  

  导入数据库文件
  mysql -uzabbix -p zbbix < schema.sql
  

  mysql -uzabbix -p zabbix < images.sql
  

  mysql -uzabbix -p zabbix < data.sql
  

  编译安装zabbix
  

  ./configure --sysconfdir=/etc/zabbix/ --enable-server --enable-agent --with-net-snmp --with-libcurl --with-mysql
  

  如果报错 ;NO found mysqlclient libary
         cd /usr/lib64/mysql
  

  ln -s libmysqlclient_r.so.16.0.0 libmysqkclient_r.so
  

  ln -s libmysqlclient.so.16.0.0 libmysqlclient.so
  

  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  make && make install
  

  复制zabbixserver端跟agent端的启动脚本,并设置执行权限
  

  cp misc/init.d/tru64/zabbix_agentd /etc/init.d/
  

  cp misc/init.d/tru64/zabbix_server /etc/init.d/
  

  chmod +x /etc/init.d/zabbix_*
  

  将zabbix的页面文件复制到/var/www/html下
  

  mkdir /var/www/html/zabbix
  

  cp -a /root/zabbix-2.2.2/frontends/php/ /var/www/html/zabbix
  

  chown -R apache:apache /var/www/html/zabbix
  

  配置php文件
  vim /etc/php.ini 添加
  

  date.timezone = Asia/Shanghai
  

  max_execution_time = 300
  

  max_input_time = 300
  

  post_max_size = 32M
  

  memory_limit = 128M
  

  mbstring.func_overload = 2
  

  配置zabbix-server文件
vim /etc/zabbix/zabbix_server.conf
DBHost=192.168.88.10
DBName= zabbix
DBUser=zabbix
  
DBPassword=123456
  

  

  #service zabbix_server start
  service httpd start
  http://192.168.22.1/zabbix
  

https://s1.运维网.com/wyfs02/M00/97/A4/wKioL1kwzLLjYOmSAAHYoWdAbsY063.png-wh_500x0-wm_3-wmp_4-s_435585686.png
https://s1.运维网.com/wyfs02/M01/97/A2/wKiom1kwzLPiTP3-AAEroSp2l50576.png-wh_500x0-wm_3-wmp_4-s_4203327969.png
https://s4.运维网.com/wyfs02/M00/97/A3/wKiom1kwzLTgjOs1AAEcuxCiZWs432.png-wh_500x0-wm_3-wmp_4-s_4018827751.png
https://s5.运维网.com/wyfs02/M00/97/A4/wKioL1kwzLWBGnSdAAFT15x7Bwk261.png-wh_500x0-wm_3-wmp_4-s_1934797362.png
https://s2.运维网.com/wyfs02/M01/97/A4/wKioL1kwzLahVHfnAAEeyoybcDE784.png-wh_500x0-wm_3-wmp_4-s_3013287344.png
https://s2.运维网.com/wyfs02/M02/97/A3/wKiom1kwzLeTb5hxAADsIRn5sCc929.png-wh_500x0-wm_3-wmp_4-s_4208241839.png
  用户名admin密码zabbix
https://s5.运维网.com/wyfs02/M02/97/A4/wKioL1kwzLiiBZ7PAAD4oQsXDEs171.png-wh_500x0-wm_3-wmp_4-s_360209372.png
  




页: [1]
查看完整版本: zabbix的安装与配置