1.服务器安装lamp环境

[root@monitor ~]# yum  install gcc gcc-c++ autoconf httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmath mysql-connector-odbc  mysql-devel libdbi-dbd-mysql net-snmp-devel curl-devel -y

2.配置lamp环境

[root@monitor ~]# vim /etc/php.ini

date.timezone = Asia/Shanghai

max_execution_time = 300

max_input_time = 300

memory_limit = 128M

post_max_size = 32M

mbstring.func_overload = 2

启动服务

[root@monitor ~]# service mysqld start

[root@monitor ~]# service httpd start

添加到开机启动

[root@monitor ~]# chkconfig mysqld on
[root@monitor ~]# chkconfig httpd on

3.下载并安装zabbix服务端

[root@monitor tools]# wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.0.9/zabbix-2.0.9.tar.gz/download

[root@monitor tools]# groupadd zabbix -g 201
[root@monitor tools]# useradd -g zabbix -u 201 -m zabbix
[root@monitor tools]# tar zxf zabbix-2.0.9.tar.gz

[root@monitor tools]# cd zabbix-2.0.9
[root@monitor zabbix-2.0.9]#

[root@monitor zabbix-2.0.9]# ./configure --prefix=/usr/local/zabbix --enable-se
rver --enable-proxy --enable-agent --with-mysql=/usr/bin/mysql_config --with-ne
t-snmp --with-libcurl

[root@monitor zabbix-2.0.9]# make && make install

[root@monitor zabbix-2.0.9]# echo $?
0
[root@monitor zabbix-2.0.9]#

3.1添加zabbix到系统服务

[root@monitor ~]# vim /etc/services

zabbix-agent    10050/tcp                       #zabbix agent
zabbix-agent    10050/udp                       #zabbix agent
zabbix-trapper  10051/tcp                       #zabbix trapper
zabbix-trapper  10051/udp                       #zabbix trapper

[root@monitor tools]# cd zabbix-2.0.9

[root@monitor zabbix-2.0.9]# mysqladmin -uroot password 'redhat'

[root@monitor zabbix-2.0.9]# mysql -uroot -p

Enter password:

Welcome to the MySQL monitor.

Commands end with ; or \g.

Your MySQL connection id is 3 Server version: 5.0.95 Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

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

mysql> create database zabbix character set utf8;

Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabb ix';

Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql>

3.2 导入数据库

[root@monitor zabbix-2.0.9]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/schema.sql
[root@monitor zabbix-2.0.9]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/images.sql
[root@monitor zabbix-2.0.9]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/data.sql

3.3 创建软链接

[root@monitor zabbix-2.0.9]# mkdir /var/log/zabbix
[root@monitor zabbix-2.0.9]# chown zabbix.zabbix /var/log/zabbix/
[root@monitor zabbix-2.0.9]# ln -s /usr/local/zabbix/etc/ /etc/zabbix
[root@monitor zabbix-2.0.9]# ln -s /usr/local/zabbix/bin/* /usr/bin/
[root@monitor zabbix-2.0.9]# ln -s /usr/local/zabbix/sbin/* /usr/sbin/

修改配置文件中的数据库用户名和密码

[root@monitor ~]# vim /etc/zabbix/zabbix_server.conf

DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

拷贝web程序到html目录下

[root@monitor ~]# cp -r /root/tools/zabbix-2.0.9/frontends/php/ /var/www/html/z
abbix
[root@monitor ~]# chown -R zabbix.zabbix /var/www/html/zabbix/

[root@monitor ~]# cp /root/tools/zabbix-2.0.9/misc/init.d/fedora/core5/zabbix_s
erver /etc/init.d/
[root@monitor ~]# cp /root/tools/zabbix-2.0.9/misc/init.d/fedora/core5/zabbix_a
gentd /etc/init.d/
[root@monitor ~]#

注:这个地方存放脚本的目录结构也有变化,没有redhat这个目录,只有cp的fedora目录里的启动脚本

修改zabbix_server和zabbix_agentd文件

[root@monitor ~]# vim /etc/init.d/zabbix_server

ZABBIX_BIN="/usr/sbin/zabbix_server"

[root@monitor ~]# vim /etc/init.d/zabbix_agentd

ZABBIX_BIN="/usr/sbin/zabbix_agentd"

启动

[root@monitor ~]# service zabbix_server start  
Starting Zabbix Server: [  OK  ]
[root@monitor ~]# service zabbix_agentd start
Starting Zabbix Agent: [  OK  ]
[root@monitor ~]#

[root@monitor html]# chown -R apache:zabbix /var/www/html/zabbix/

监控本机:configuration——hosts——enable

zabbix监控服务器部署的更多相关文章

  1. linux zabbix监控服务器搭建

    搭建Zabbix监控服务器 准备运行环境(lamp) [root@zhuji1 ~]# yum -y install httpd [root@zhuji1 ~]# yum -y install php ...

  2. 自学Zabbix9.4 zabbix low-level discover底层发现(zabbix批量部署必备)

    点击返回:自学Zabbix之路 点击返回:自学Zabbix4.0之路 点击返回:自学zabbix集锦 自学Zabbix9.4 zabbix low-level discover底层发现(zabbix批 ...

  3. Zabbix安装部署实践

    操作系统: [root@mysql ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) Mysql :     版本5.7 ...

  4. Zabbix监控服务器磁盘I/O

    一.场景说明: 需要使用Zabbix监控服务器上各个磁盘的I/O使用率,当zabbix自身带的item无法满足我们的时候,则需自定义item.     包括: 磁盘读的次数 磁盘读的毫秒数 磁盘写的次 ...

  5. zabbix监控部署

    zabbix是一款开源的监控软件,下面来一起学习一下zabbix监控的部署吧 环境: 主机名 地址 系统 角色 tiandong 192.168.209.3 centos6.5 服务端 winter ...

  6. 企业级监控软件zabbix搭建部署之zabbix server的安装

    企业级监控软件zabbix搭建部署之zabbix server的安装 zabbix线上已经应用半年多了,关于zabbix在生产环境中的使用心得,以及一些经验写下来,希望让大家少走弯路,共同学习! 环境 ...

  7. 企业级监控软件Zabbix搭建部署之zabbix在WEB页面中的配置

    企业级监控软件zabbix搭建部署之zabbix在WEB页面中的配置 企业级监控软件zabbix搭建部署之zabbix在WEB页面中的配置 关于安装请看 http://www.linuxidc.com ...

  8. Zabbix 一键部署

    #!/bin/bash #Zabbix 一键部署脚本 #安装zabbix3. src_home=`pwd` echo -n "正在配置iptables防火墙……" /etc/ini ...

  9. 部署zabbix监控服务器,部署主动监控

    1.1部署服务运行环境 LNMP#yum -y  install gcc  pcre-devel zlib-devel openssl-devel #tar -zxvf nginx-1.12.2.ta ...

随机推荐

  1. UIButton 设置字体大小

    btn.frame = CGRectMake(x, y, width, height); [btn setTitle: @"search" forState: UIControlS ...

  2. JQ调用后台方法

    首先,先在页面上创建一个asp按钮,添加点击事件,把要在前台调用的后台方法写在这个按钮的点击事件中: <span style="display:none;"><a ...

  3. 如何调教Android Studio-Windows安装AS后的必备工作

    未完待续... 工欲善其事必先利其器,你已经抛弃被大众诟病的Eclipse投入Google亲儿子Android Studio的怀抱,可是不了解As的脾气,怎么让它服服帖帖的为提高开发效率做贡献呢. 关 ...

  4. c#创建带参数的线程

    1.无参数线程的创建 Thread thread = new Thread(new ThreadStart(getpic)); thread.Start(); private void showmes ...

  5. 绝对好文C#调用C++DLL传递结构体数组的终极解决方案

    C#调用C++DLL传递结构体数组的终极解决方案 时间 2013-09-17 18:40:56 CSDN博客相似文章 (0) 原文  http://blog.csdn.net/xxdddail/art ...

  6. eclipse 使用maven 创建web3.1项目

    最近刚刚开始学java, 在框架搭建的过程中, 遭遇了诸多的坑, 和各种各样的不解与困惑, 由于没有什么java的相关基础, 看到各种xml的配置文件, 当真是一个头两个大. 并且并不知道那个配置到底 ...

  7. 【JQ学习笔记】提示的效果

    <p><a href="#" class="tooltip" title="这是我的超链接提示1.">提示1.< ...

  8. Sublime_调试PHP编译系统设置.

    工具->编译系统->新建编译系统 {         "cmd": ["C:\\wampserver\\bin\\php\\php5.3.13\\php.ex ...

  9. Looper、Hander、HandlerThread

    一.Message .Looper.Handler之间的关系 1.系统发送的Message消息传送给Handler,Handler将Message放入自己的looper队列的底部   然后再从Loop ...

  10. [转]Hibernate中property-ref的应用,常用来解决遗留数据库One To Many关系

    [转]Hibernate中property-ref的使用,常用来解决遗留数据库One To Many关系 1.如表Class(ClassID,Class_No,ClassName)与Student(S ...