码迷,mamicode.com
首页 > 其他好文 > 详细

zabbix基础之安装

时间:2016-11-03 19:19:13      阅读:278      评论:0      收藏:0      [点我收藏+]

标签:zabbix安装

1.zabbix是一款开源监控工具,可监控对象众多,使用者较多。下面我们来安装zabbix

 在安装zabbix之前,提前部署好LAMP或者LNMP。

 

 zabbix可以在官网中获取,地址:http://www.zabbix.com/download

 zabbix官网为我们提供了三种安装方式:

    (1)源码编译安装      

        # tar -zxvf zabbix-3.2.1.tar.gz        
        同时安装server和agent,并支持将数据放入mysql数据中,可使用类似如下配置命令:
        ./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-ssh2
        
        如果仅安装server,并支持将数据放入mysql数据中,可使用类似如下配置命令:
        ./configure --enable-server --with-mysql --with-net-snmp --with-libcurl
        
        如果仅安装proxy,并支持将数据放入mysql数据中,可使用类似如下配置命令:
        ./configure --prefix=/usr --enable-proxy --with-net-snmp --with-mysql --with-ssh2
        
        如果仅安装agent,可使用类似如下配置命令:
        ./configure --enable-agent
        
        
        而后编译安装zabbix即可:
        # make
        # make install

    (2)配置yum源安装

        [root@localhost ~]# wget http://repo.zabbix.com/zabbix/2.2/rhel/7/x86_64/zabbix-release-2.2-1.el7.noarch.rpm
        [root@localhost ~]# rpm -ivh zabbix-release-2.2-1.el7.noarch.rpm
            [root@localhost ~]# yum clean all
        已加载插件:fastestmirror, langpacks
        正在清理软件源: base extras updates zabbix zabbix-non-supported
        Cleaning up everything
        Cleaning up list of fastest mirrors
        [root@localhost ~]# yum makecache

     (3)rpm包下载安装


 2.配置zabbix-database,以mysql为例,可使用mysql和pgsql

MariaDB [(none)]> create database zabbix character set utf8;
MariaDB [(none)]> grant all on zabbix.* to ‘zbxuser‘@‘localhost‘ identified by ‘zbxpass‘;
MariaDB [(none)]> grant all on zabbix.* to ‘zbxuser‘@‘192.168.%.%‘ identified by ‘zbxpass‘;
MariaDB [(none)]> flush privileges;

#连接测试
[root@localhost ~]# mysql -uzbxuser -hlocalhost -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.50-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

MariaDB [(none)]> \q
Bye


3.安装zabbix

[root@localhost ~]# yum install zabbix zabbix-agent zabbix-get zabbix-sender zabbix-server zabbix-server-mysql zabbix-web zabbix-web-mysql

#在httpd中生成zabbix的配置文件
[root@localhost zabbix]# systemctl restart httpd.service 
[root@localhost zabbix]# ls /etc/httpd/conf.d/
autoindex.conf  php.conf  README  userdir.conf  welcome.conf  zabbix.conf

创建用户:
[root@localhost ~]# groupadd zabbix
[root@localhost ~]# useradd -g zabbix zabbix

注意:同时安装了server和agent的节点上,建议其运行用户不要相同。

source /usr/local/src/zabbix-3.0.1/database/mysql/schema.sql #导入脚本文件到zabbix数据库
source /usr/local/src/zabbix-3.0.1/database/mysql/images.sql #导入脚本文件到zabbix数据库
source /usr/local/src/zabbix-3.0.1/database/mysql/data.sql #导入脚本文件到zabbix数据库

 



本文出自 “linux启航” 博客,请务必保留此出处http://jiayimeng.blog.51cto.com/10604001/1868975

zabbix基础之安装

标签:zabbix安装

原文地址:http://jiayimeng.blog.51cto.com/10604001/1868975

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!