zabbix 安装

来源:互联网 发布:新材料在线软件 编辑:程序博客网 时间:2024/06/06 15:49


参考:http://blog.csdn.net/wn_hello/article/details/52121826

agent 配置:http://blog.csdn.net/wn_hello/article/details/52237755

安装Zabbix服务器端

CentOS版本:7.0 Zabbix版本: 3.0.4

(1)首先配置LAMP环境:

# yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-server krb5-devel libidn libidn-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers  net-snmp-devel# yum install *bcmath* --skip-broken# yum -y install httpd httpd-devel# yum -y install mysql mysql-server mysql-devel# yum -y install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

(2)设置防火墙

# firewall-cmd --zone=public --add-port={80/tcp,10051/tcp} --permanent# firewall-cmd --reload
  • 1
  • 2
  • 3

(3)设置selinux

#vi /etc/selinux/configSELINUX=disabled
  • 1
  • 2

(4)设置mysql密码,登录数据库,设置账号和权限

# systemctl restart  mariadb# mysqladmin -uroot password '123456'# mysql -uroot -p123456mysql> use mysql;mysql>create database zabbix character set utf8;mysql>grant all privileges on zabbix.* to zabbix_user@localhost identified by '123456';
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

(5)启动httpd和mysql,并设置开机启动

#systemctl restart mariadb.service#systemctl restart httpd.service#systemctl enable mariadb.service#systemctl enable httpd.service
  • 1
  • 2
  • 3
  • 4
  • 5

(6)添加用户群组

#groupadd zabbix#useradd -g zabbix -m zabbix
  • 1
  • 2
  • 3

(7)解压安装包,导入数据库表,注意导入顺序

#tar -zxvf zabbix-3.0.4.tar.gz#cd zabbix-3.0.4/database/mysql/#mysql -uroot –p123456 zabbix < schema.sql#mysql -uroot - p123456 zabbix < images.sql #mysql -uroot - p123456 zabbix < data.sql
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

(8)编译安装zabbix

#./configure --prefix=/usr/local/zabbix --with-mysql --with-net-snmp --with-libcurl --enable-server --enable-agent --enable-proxy# make install
  • 1
  • 2
  • 3

(9)修改server配置文件, zabbix数据库配置与步骤4中设置一致

#vi /usr/local/zabbix/etc/zabbix_server.confLogFile=/tmp/zabbix_server.logPidFile=/tmp/zabbix_server.pidDBName=zabbixDBUser=zabbix_userDBPassword=123456     #指定zabbix数据库密码ListenIP= ip.ip.ip.ip   #服务器IP地址
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

(10)添加前端文件

# mkdir /var/www/html/zabbix# cp -rf zabbix-3.0.4/frontends/php/* /var/www/html/zabbix
  • 1
  • 2
  • 3

(11)修改php相关参数

#vi /etc/php.inimax_execution_time = 300max_input_time = 300memory_limit = 128Mpost_max_size = 32Mdate.timezone = Asia/Shanghai
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7

(12)将zabbix添加到系统路径,并建立软链接

#cp zabbix-3.0.4/misc/init.d/tru64/zabbix_server /etc/init.d/# chmod +x /etc/init.d/zabbix_server# ln -s /usr/local/zabbix/sbin/* /usr/local/sbin/# ln -s /usr/local/zabbix/bin/* /usr/local/bin/
  • 1
  • 2
  • 3
  • 4
  • 5

(13)启动zabbix

# systemctl restart zabbix_server
  • 1

(14)在浏览器中访问http://服务器端IP/zabbix/setup.php


原创粉丝点击