【运维笔记】zabbix

基础环境

centos、nginx、MySQL、PHP

创建用户、组

group zabbix
user  zabbix

安装依赖

yum install gcc pcre pcre-devel net-snmp curl curl-devel net-snmp net-snmp-devel libxml libxml2-devel

zabbix agent配置文件

Hostname  ### 跟监控主机名一致
Server  ### passive mode 	--10050
ActiveServer  ### active mode  
RefreshActiveChecks  ### 主动监控检查刷新时间
StarAgents:  # 模式选择,设为0关闭被动模式,关闭10050端口
	If set to 0, disables passive checks and the agent will not listen on any TCP port

zabbix proxy配置

## 导入sql文件
	./database/mysql/schema.sql

## 安装
./configure --prefix=/usr/local/zabbix --enable-proxy --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2

## 配置文件
Server
Hostname	--agent proxy
ProxyMode	0主动模式	1被动模式
ConfigFrequency=            # Proxy 向 Zabbix Server请求监控项间隔
DataSenderFrequency=        # Proxy 向 Zabbix Server发送监控数据间隔
10051

zabbix server配置

## 安装
./configure --prefix=/usr/local/zabbix --with-mysql --enable-server --with-net-snmp --with-libcurl --with-libxml

## 数据库配置
	create database zabbix;  #### 创建数据库
	grant all privileges on zabbix.* on 'zabbix'@'%' identified by 'password';  ### 设置权限
	 ./database/mysql/schema.sql  images.sql  data.sql  ### 导入sql文件

## nginx配置
	cp -r ./frontends/php/  /usr/local/nginx/html/zabbix
	FpingLocation=/usr/local/sbin/fping  ## fping路径
	AlertScriptsPath=/usr/local/zabbix/alertscripts  ## 告警脚本路径
	zabbix.conf.php/

zabbix web inteface

Proxies --zabbix proxy
Media types	--Script	--script name	--Script parameters
User groups  --Permissions
User	--Media  -Send to
		--User type
Host groups
Hosts	--Hostname	--Agent interfaces --SNMP interfaces --Monitored by proxy
		--Linked templates	
Items	--type zabbix agent(active)  
SNMPv2 agent	--Key(key自定义)
				--SNMP OID
				--SNMP community
Trigger		--Expression
ACtions		--Conditions	
			--Operations	-Default subject -Default message 
			--Recovery operations
Discovery rule	--SNMPVALUE		--SNMPINDEX

于主机上执行远程命令(EnableRemoteCommands=1)

配置-动作-操作(步奏、明细)
自定义脚本 -- 执行在zabbix客户端

猜你喜欢

转载自blog.csdn.net/wuguifa/article/details/86575370