功能说明:
自动发现:
zabbix Server主动发现所有客户端,然后将客户端登记自己的小本本上,缺点zabbix server压力山大(网段大,客户端多),时间消耗多。
自动注册:
zabbix Server 上配置好注册模板,zabbix agent主动到zabbix Server上报到,登记;缺点agent有可能找不到Server(配置出错)
被动模式:默认 agent被server抓取数据 (都是在agent的立场上说)
主动模式:agent主动将数据发到server端 (都是在agent的立场上说)
注意: 两种模式都是在agent上进行配置
zabbix 的使用要在hosts文件中预先做好主机名的解析
1、Zabbix服务器配置自动注册:
配置–动作–事件源–自动注册–创建动作
2、linux客户端
setenforce 0
vi /etc/zabbix_agent.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=1
EnableRemoteCommands=1
LogRemoteCommands=1
Server=10.0.102.123
ServerActive=10.0.102.123
HostnameItem=system.hostname
#Hostname=kingdee-easapp
HostMetadata=aiit_linux
UnsafeUserParameters=1
启动agent
service zabbix-agent start
chkconfig zabbix-agent on
注:在自动注册时 需要更改主机名,有重复的主机名无法注册上,例如locathost
3、windows客户端
编辑windows agent zabbix_agent.conf文件:
# This is a configuration file for Zabbix agent service (Windows)
############ GENERAL PARAMETERS #################
LogFile=c:\zabbix_agentd.log
LogFileSize=1
Server=zabbix.etransfar.com
ServerActive=zabbix.etransfar.com
HostnameItem=system.hostname
HostMetadata=transfar_400
#首次安装
C:\Windows\system32>C:\zabbix\zabbix_agentd.exe -i -c C:\zabbix\zabbix_agentd.win.conf
C:\Windows\system32>C:\zabbix\zabbix_agentd.exe -s -c C:\zabbix\zabbix_agentd.win.conf
#重启服务
C:\Users\Administrator>c:\zabbix\zabbix_agentd.exe –stop
C:\Users\Administrator>c:\zabbix\zabbix_agentd.exe –start