zabbix-3.2.6之agent自动注册

一、zabbix-agent端配置

#zabbix-server服务器地址
Server=192.168.30.155

#zabbix-server服务器地址
ServerActive=192.168.30.155 

#注释掉这行,不需要配置
# Hostname=  

#配置自动注册,system.uname获取系统名称 
HostMetadataItem=system.uname

#重启zabbix-agent服务

[root@comput2 tools]# systemctl restart zabbix-agent

#查看状态
[root@comput2 tools]# systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
   Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2017-07-06 00:55:39 CST; 18s ago
  Process: 4912 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
 Main PID: 4914 (zabbix_agentd)
    Tasks: 6 (limit: 4915)
   CGroup: /system.slice/zabbix-agent.service
           ├─4914 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
           ├─4915 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
           ├─4916 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
           ├─4917 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
           ├─4918 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
           └─4919 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]

Jul 06 00:55:39 comput2 systemd[1]: Starting Zabbix Agent...
Jul 06 00:55:39 comput2 systemd[1]: zabbix-agent.service: PID file /run/zabbix/zabbix_agentd.pid not readable (yet?) after start: No such file or directory
Jul 06 00:55:39 comput2 systemd[1]: zabbix-agent.service: Supervising process 4914 which is not our child. We'll most likely not notice when it exits.
Jul 06 00:55:39 comput2 systemd[1]: Started Zabbix Agent.

#设置为开机自启动

 [root@comput2 tools]# systemctl enable zabbix-agent
 Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-agent.service → /usr/lib/systemd/system/zabbix-agent.service.

二、查看系统名称

[root@comput2 tools]# hostname
comput2

 

三、配置自动注册

主机名称似(客户端名称)

添加主机

添加到主机群组

添加:与模板关联

 

四、查看效果

 

在zabbix-server服务端查看日志

[root@zabbix-server ~]# tail -f /var/log/zabbix/zabbix_server.log
 23761:20170705:115704.235 item "comput1:net.if.out[virbr0-nic]" became not supported: Cannot find information for this network interface in /proc/net/dev.
 23749:20170705:123545.715 executing housekeeper
 23749:20170705:123545.833 housekeeper [deleted 5653 hist/trends, 0 items, 0 events, 4 problems, 0 sessions, 0 alarms, 0 audit items in 0.117358 sec, idle for 1 hour(s)]
 23740:20170705:130511.927 enabling Zabbix agent checks on host "comput2": host became available
 23764:20170705:130512.161 item "comput2:net.if.in[virbr0-nic]" became not supported: Cannot find information for this network interface in /proc/net/dev.
 23764:20170705:130512.161 item "comput2:net.if.in[virbr0]" became not supported: Cannot find information for this network interface in /proc/net/dev.
 23764:20170705:130512.161 item "comput2:net.if.out[virbr0-nic]" became not supported: Cannot find information for this network interface in /proc/net/dev.
 23764:20170705:130512.161 item "comput2:net.if.out[virbr0]" became not supported: Cannot find information for this network interface in /proc/net/dev.
 23749:20170705:133546.293 executing housekeeper
 23749:20170705:133546.410 housekeeper [deleted 6482 hist/trends, 0 items, 0 events, 2 problems, 0 sessions, 0 alarms, 0 audit items in 0.115685 sec, idle for 1 hour(s)]

  

 

posted @ 2017-07-05 13:59  努力哥  阅读(3609)  评论(0编辑  收藏  举报