zabbix server

前提环境:

CentOS 6

Lnmp

php需要的包(bcmath,mbstring,sockets,gd,libxml,xmlwriter,xmlreader,ctype,session,gettext)  # gettext多语言支持

版本:Zabbix-3.2.3

server安装

yum install -y net-snmp \
net-snmp-devel
cd /usr/local/src/zabbix-3.2.
./configure --prefix=/usr/local/zabbix \
--enable-server \
--enable-agent \
--with-mysql=/usr/local/mysql/bin/mysql_config \
--with-net-snmp \
--with-libcurl \
--with-libxml2 \
--with-openssl
make && make install

--enable-server zabbix服务端

--enable-agent zabbix客户端

修改php配置文件(php.ini)

memory_limit=128M
post_max_size=16M
upload_max_filesize=2M
max_execution_time=
max_input_size=
session.auto_start = 0
mbstring.func_overload = 0
always_populate_raw_post_data = -1

创建用户(服务器端 客户端都需要创建 默认运行用户是zabbix)

useradd -M -s /sbin/nologin zabbix

初始化数据库
zabbix server,proxy需要数据库
agent不需要
proxy只需要导入一个sql文件,server需要导入三个sql文件
proxy:
database/mysql/schema.sql
server:
database/mysql/schema.sql
database/mysql/images.sql
database/mysql/data.sql

配置zabbix server

/usr/local/zabbix/etc/zabbix_server.conf

LogFile=/tmp/zabbix_server.log
DBHost=localhost
DBName=zabbix
DBUser=root
DBPassword=
DBSocket=/tmp/mysql.sock

启动zabbix server

/usr/local/zabbix/sbin/zabbix_server

配置zabbix server访问站点

copy前端文件
mkdir /storage/www/zabbix
cp -rp frontends/php/* /storage/www/zabbix

/usr/local/nginx/conf/nginx.conf

server
{
listen ;
server_name monitor.zabbix.com;
#access_log off;
root /storage/www/;
error_page /50x.html;
location = /50x.html {
root html;
}
location /
{
     index index.php index.html;
}
location ~ .*\.(php|php5)?$
{
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
}

配置访问zabbix

一、在线配置(图形界面形式 最终程序也是写入参数到zabbix.conf.php 会有各模块错误检查)

用户zabbix需要对zabbix.conf.php的写权限

monitor.zabbix.com

二、直接手动修改zabbix.conf.php配置文件

/storage/www/zabbix/conf/zabbix.conf.php

<?php
// Zabbix GUI configuration file.
global $DB; $DB['TYPE'] = 'MYSQL';    # 数据库类型
$DB['SERVER'] = 'localhost'; # mysql host
$DB['PORT'] = '';       # mysql port 我们设置的是unix socket访问方式 所以不需要修改为3306
$DB['DATABASE'] = 'zabbix';    # 具体数据库
$DB['USER'] = 'root'; # mysql user
$DB['PASSWORD'] = '123456'; # mysql pass ?>

登录语言选择

查看配置中是否开启了中文

include/locales.inc.php

  'zh_CN' => ['name' => _('Chinese (zh_CN)'), 'display' => true],

中文乱码解决

找到本地C:\Windows\Fonts\simkai.ttf(楷体)上传到服务器zabbix网站目录fonts目录下

修改配置文件

cd /storage/www/zabbix && sed -i 's/DejaVuSans/simkai/g' ./include/defines.inc.php

zabbix agent

agent安装

cd /usr/local/src/zabbix-3.2.3
./configure --prefix=/usr/local/zabbix-agent \
--enable-agent
make && make install

创建用户(服务器端 客户端都需要创建 默认运行用户是zabbix)

useradd -M -s /sbin/nologin zabbix

配置zabbix agent

/usr/local/zabbix-agent/etc/zabbix_agentd.conf

LogFile=/tmp/zabbix_agentd.log
Server=172.18.2.196 # zabbix server ip
#ServerActive=172.18.2.196 # 主动模式
Hostname=test6 # 客户端主机名(执行hostname命令所得)
Include=/usr/local/zabbix-agent/etc/zabbix_agentd.conf.d/ # 其它监控模块的路径

启动zabbix agent

/usr/local/zabbix-agent/sbin/zabbix_agentd

ALL(server,agent)

启动脚本

misc/init.d  有多个linux发行版的init脚本(需要自行修改程序路径)

测试

server(zabbix_get 获取客户端item值)

zabbix_get -s (agent ip) -p (agent port) -k "item-key"

example:  zabbix_get -s 127.0.0.1 -p 10050 -k "system.uname"

agent(zabbix_agentd 获取item值)

zabbix_agentd -t "item-key"

example: zabbix_agentd -t "system.uname"

ps:本文所有的相对路径以源码解压缩路径(/usr/local/src/zabbix-3.2.3)为起点

参考:https://www.zabbix.com/documentation/3.2/manual/installation/install

Zabbix server 3.2安装部署的更多相关文章

  1. SQL Server Compact免安装部署

    原文:SQL Server Compact免安装部署 情况 应用程序中的EF使用了SQL Server Compact,打包部署到客户机器上后提示数据库连接异常,信息类似”配置节“.”Provider ...

  2. Entity Framework6使用SQL Server Compact免安装部署

    原文:Entity Framework6使用SQL Server Compact免安装部署 使用Nuget安装以下包: EntityFramework.6.0.2 EntityFramework.Sq ...

  3. 原创:CentOS 环境中 Zabbix 3.4 的安装部署实践

    IT管理工作中,如果没有对服务器.网络设备.服务.进程.应用等的监控,往往是用户发送问题报告后才知道出了问题.事后救火显得被动,不能从容面对问题. 才有了部署一套网络监控系统的想法,机缘巧合下结识了Z ...

  4. WIN中SharePoint Server 2010 入门安装部署详解

    目前流行的原始安装文件基本都是这样的:Windows Server 2008 R2+SQL Server 2008R2+SharePoint Server 2010     这个初始环境原本也无可厚非 ...

  5. zabbix server源码安装

    一.准备工作 yum -y install net-snmp-devel php-bcmath php-ctype php-xml php-xmlreader php-xmlwriter php-se ...

  6. Zabbix server(离线版)安装手册

    由于zabbix server需要依赖MySQL及PHP的相关依赖,因此需要先安装好MySQL及PHP的相关依赖后方可安装zabbixserver. 安装MySQL 目录mysql下的rpm 1.新建 ...

  7. zabbix server、agent安装及使用

    先准备yum源,当然你有打好的rpm包那更好 [root@linux-node1 ~]# cat /etc/yum.repos.d/zabbix.repo [zabbix] name=Zabbix O ...

  8. Windows Server 2012 R2安装部署Office Web Apps Server

    微软官方参考地址https://technet.microsoft.com/zh-cn/library/jj219455.aspx,建议参考官方说明. 注意:每一步进行完成后重启服务器!!! 一.   ...

  9. Vcenter server 5.5安装部署

    1.安装VMware ESXi Server 虚拟主机安装方法请看本人博客 "实践记忆": http://www.cnblogs.com/zoulongbin/p/5896836. ...

随机推荐

  1. LeetCode——Counting Bits

    Question Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calcu ...

  2. windows下Redis主从复制配置(报错:Invalid argument during startup: unknown conf file parameter : slaveof)

    主从复制配置中的遇到的异常: Invalid argument during startup: unknown conf file parameter :  slaveof 把Redis文件夹复制两份 ...

  3. caohaha's stuff

    2017-08-20 11:12:29 writer:pprpCCPC预选赛水平太菜了,去不了了 这个是一个找规律的题目,题意一开始也很难理解 题意描述: 给你一个数,比如说1,在一个坐标系中你需要用 ...

  4. 虚拟机中的Linux安装VMware Tools的方法

    先检查虚拟机是否能上网 一:安装VMware Tools的之前必装的工具套件方法如下: Centos安装VMware Tools: [root@piaoyun-vm vmware-tools-dist ...

  5. CSP(Content Security Policy) 入门教程

    参考: http://www.ruanyifeng.com/blog/2016/09/csp.html https://developer.mozilla.org/en-US/docs/Web/HTT ...

  6. 数据库原理及应用-用户接口及SQL查询语言(Query Language)

    2018-02-07 20:41:39 一.DBMS的用户接口 查询语言 访问DBMS的访问工具(GUI) API 相关类库 二.SQL语言 SQL语言可以细分为四种: 1.Data Definiti ...

  7. 解决silk-v3-decoder-master转换wav时,百度语音解析问题

    $cur_dir/silk/decoder >& if [ ! -f "$1.pcm" ]; then /usr/local/ffmpeg/bin/ffmpeg -y ...

  8. HTML 参考手册- (HTML5 标准)

    HTML 参考手册- (HTML5 标准) 功能排序 New : HTML5 新标签 标签 描述 基础   <!DOCTYPE>  定义文档类型. <html> 定义一个 HT ...

  9. python脚本11_求10万以内所有素数

    #求10万以内所有素数 num = int(input(">>>")) strs = '' for i in range(2,num): for c in ran ...

  10. centos7&redhat 之 firewalld 详细介绍配置

    firewalld和iptables的关系 firewalld自身并不具备防火墙的功能,而是和iptables一样需要通过内核的netfilter来实现,也就是说firewalld和iptables一 ...