Skip to content

Instantly share code, notes, and snippets.

@sursir
Last active February 24, 2018 05:54
Show Gist options
  • Select an option

  • Save sursir/a46f1ee9a889b0af17d4408c62c23369 to your computer and use it in GitHub Desktop.

Select an option

Save sursir/a46f1ee9a889b0af17d4408c62c23369 to your computer and use it in GitHub Desktop.
zabbix zabbix-agent zabbix-server

zabbix zabbix-agent zabbix-server

zabbix server

直接使用默认配置,关键用webUI进行配置

LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
SocketDir=/var/run/zabbix
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix_U1
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000

zabbix agent

PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
## 重要配置 <---------
Server=10.27.230.160 # 远端zabbix服务
ServerActive=10.27.230.160 # 远端zabbix服务,并且用active模式,主动上报(支持自动发现)
Hostname=10.153.200.143 # 当前服务器的 hostname
## 重要配置 ---------->
Include=/etc/zabbix/zabbix_agentd.d/*.conf
  • Zabbix Active 客户端主机发现(客户端主动模式) 都要用这类配置
  • 设置主机发现

设置 Discovery 发现规则

先设置 发现

Configuration -> Discovery -> Create discovery rule

Name 设置名字
Discovery by proxy 假如通过了代理
IP range 指定IP范围(重要)
Update interval 轮训时间
Device uniqueness criteria 设置唯一标示,使用IP地址更好些
Enabled 启用
再设置 发现后的行为

Configuration -> Acitons -> Create Action

  1. 设置触发事件: event source 为 Discovery,这样就会使用刚才设置的发现规则
  2. 创建 action:Auto discovery. Linux servers.(可以不用创建,使用现成的模板,见下文)
  3. 设置
Conditions 设置条件
    Received value like Linux
    Discovery status = Up
    Service type = Zabbix agent
Enabled 启用
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment