• zabbix server端配置


    # wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.0.6/zabbix-2.0.6.tar.gz/download  

     2.安装zabbix所需的组件

    # yum -y install curl curl-devel net-snmp net-snmp-devel perl-DBI

     3.创建用户账号(server,agent)

    # groupadd zabbix
    # useradd -g zabbix zabbix
    # usermod -s /sbin/nologin zabbix
     
    4.创建zabbix数据库并导入zabbix数据库数据(server)
    # mysql -u root -p123456
    > grant all on zabbix.* to zabbix@localhost identified by '123456';
    > create database zabbix;
    # tar zxvf zabbix-2.0.6.tar.gz
    # cd zabbix-2.0.6
    # mysql -uzabbix -p123456 zabbix < database/mysql/schema.sql
    # mysql -uzabbix -p123456 zabbix < database/mysql/images.sql# mysql -uzabbix -p123456 zabbix < database/mysql/data.sql

     5.编译安装

    # ./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl

    报如下错误:

    checking for mysql_config... no

    configure: error: MySQL library not found

    解决办法:yum -y install mysql-devel

    重新./configure

    #make install

    6.编辑配置文件

     # cd /usr/local/etc/

    去掉配置文件注释:

    # cat zabbix_server.conf |grep -v "#" |grep -v "^$" > zabbix_server.conf.bak
    # cp zabbix_server.conf.bak zabbix_server.conf
    # cat zabbix_agentd.conf |grep -v "#" |grep -v "^$" > zabbix_agentd.conf.bak
    # cp zabbix_agentd.conf.bak zabbix_agentd.conf
     
    # vi /usr/local/etc/zabbix_server.conf
    修改如下内容并删除其他未修改参数条目:
    -------------
    LogFile=/var/log/zabbix_server.log
    DBHost=localhost
    DBName=zabbix
    DBUser=zabbix
    DBPassword=123456
    -------------
     
    # vi /usr/local/etc/zabbix_agentd.conf
    修改如下内容并删除其他未修改参数条目:
    -------------
    LogFile=/var/log/zabbix_agentd.log
    Server=127.0.0.1,192.168.7.201
    UnsafeUserParameters=1
    -------------
     
     
     
     
    # touch /var/log/zabbix_server.log
    # chmod 777 /var/log/zabbix_server.log
     
    # touch /var/log/zabbix_agentd.log

    # chmod 777 /var/log/zabbix_agentd.log

     
    7、启动守护进程(server,agent)
    在服务器端运行启动zabbix_server
    # zabbix_server
     server启动端口为10051
     在所有被监控的机器上运行zabbix_agentd 。
    # zabbix_agentd
     agentd启动端口为10050
     配置开机启动脚本:
    # cd zabbix-2.0.6
    # cp misc/init.d/tru64/zabbix_server   /etc/init.d/zabbix_server
    # cp misc/init.d/tru64/zabbix_agentd   /etc/init.d/zabbix_agentd
    # cd /etc/init.d/
    # chmod 755 zabbix_*
    # vi zabbix_server
    # vi zabbix_agentd
    在文件头部的#!/bin/sh行下分别添加如下两行:
    --------------
    #chkconfig: 35 95 95
    #description:zabbix Agent server
    --------------
    # chkconfig --add zabbix_server  
    # chkconfig --add zabbix_agentd
    # chkconfig zabbix_server on
    # chkconfig zabbix_agentd on
     
    重启服务:
    # service zabbix_server restart

    # service zabbix_agentd restart

     
    8.安装zabbix web界面(server)
     
    复制ZABBIX PHP源代码文件

    zabbix的服务端程序是用php写的,因此需要一个支持LAMP架构的服务器平台

    现在将ZABBIX安装目录下 frontends/php 下面的php源代码文件拷贝到web服务器html文件目录下面。

    这里建议用子目录替换APACHE HTML根目录或使用APACHE虚拟主机

    这里测试环境我为了方便就选择了前者。

    先建立一个子目录,将zabbix终端php文件拷贝到该子目录里面,执行下面的命令:

    # mkdir /usr/local/apache2/htdocs/zabbix
    # cd frontends/php

    # cp -a . /usr/local/apache2/htdocs/zabbix

     
    安装前端
     
    # mkdir /usr/local/apache2/htdocs/zabbix
    # cd frontends/php

    # cp -a . /usr/local/apache2/htdocs/zabbix

     

    根据提示修改配置文件:

    vi /usr/local/php/etc/php.ini

    如何安装bcmath和gettext请看我的另一篇博文

    最后全部ok,然后一路next

    给conf目录777的权限

     
  • 相关阅读:
    API设计和微服务
    Eolinker与API文档
    mysql由浅入深探究(一)----数据库简介与mysql安装
    HttpSession详解
    运行python程序的时候不停的输出destroy和clean信息
    ERROR 1221 (HY000): Incorrect usage of UNION and ORDER BY
    GitLab / Github如何修改默认主分支
    mac安装pyenv和遇到的奇怪问题
    Python Pytest装饰器@pytest.mark.parametrize详解
    gitLab项目左侧找不到”setting"选项链接
  • 原文地址:https://www.cnblogs.com/seasonsstory/p/3209748.html
Copyright © 2020-2023  润新知