cl_303303303 发表于 2019-1-24 07:19:47

centos7安装zabbix3记录

  公司的zabbix2.0用了很久了,想尝试更新一下。
  一、安装环境缺少的包
  yum -y install wget net-snmp-devel OpenIPMI-devel httpd openssl-devel java lrzsz fping-devel libcurl-devel perl-DBI pcre-devel libxml2 libxml2-devel mysql-devel gcc php php-bcmath php-gd php-xml php-mbstring php-ldap php-mysql.x86_64 php-pear php-xmlrpcnet-tools wget vim-enhanced
  关闭selinux配置
  systemctl stop firewall
  systemctl disable firewall
  sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
  二、安装服务器端包
  #rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
#yum clean all
#yum install zabbix-server-mysql zabbix-web-mysql
三、安装数据库
  #yum -y install mariadb-server
  启动mariadb
# systemctl start mariadb
之前的服务管理命令还可以用
# service mariadb start
设置开机自启动
# systemctl enable mariadb
安全初始化,设置root密码等
# mysql_secure_installation
https://s4.运维网.com/wyfs02/M00/8C/B9/wKioL1h17gGQxV2QAADsJtFa5iI071.png-wh_500x0-wm_3-wmp_4-s_3903348350.png
  导入数据库文件:
  # cd /usr/share/doc/zabbix-server-mysql-3.0.7/
# ls
AUTHORSChangeLogCOPYINGcreate.sql.gzNEWSREADME
# zcat create.sql.gz | mysql -uroot zabbix
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
# zcat create.sql.gz | mysql -uroot -p zabbix
Enter password:
#
  四、启动zabbix server端
  修改 Zabbix Server 配置,并启动 Zabbix Server 服务
# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
快捷操作命令:
# sed -i "s/# DBHost/DBHost/g" zabbix_server.conf
# sed -i "s/# DBPassword=/DBPassword=zabbix/g" zabbix_server.conf
启动zabbix-server服务
# systemctl start zabbix-server
  # ps -ef | grep zabbix
zabbix   14505   10 16:38 ?      00:00:00 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf开机自启动zabbix-server服务
# systemctl enable zabbix-server
  五、修改PHP、apache等
编辑PHP配置
# vi /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 Asia/Shanghai
快捷修改命令
# sed -i "s/# php_value date.timezone Europe\/Riga/php_value date.timezone Asia\/Shanghai/g" /etc/httpd/conf.d/zabbix.conf
启动Apache服务
# systemctl start httpd
开机启动Apache服务
# systemctl enable httpd
  六、登陆 Zabbix 管理页面http://虚拟机IP/zabbix/,显示Zabbix安装向导。
(后面的看着点击就是)
  七、安装zabbix agent
  八、其他配置,更换字体等参考这2篇文章
  http://www.tuicool.com/articles/V363Unj
  http://www.linuxidc.com/Linux/2016-11/137044.htm



页: [1]
查看完整版本: centos7安装zabbix3记录