Zabbix Agent 配置
在Linux上创建zabbix账户
- view plaincopy to clipboardprint?
- 01.groupadd zabbix
- 02.useradd zabbix -g zabbix
- groupadd zabbix
- useradd zabbix -g zabbix
解压文件
- view plaincopy to clipboardprint?
- 01.tar zxvf zabbix.tar.gz
- tar zxvf zabbix.tar.gz
配置
- view plaincopy to clipboardprint?
- 01../configure --enable-agent
- ./configure --enable-agent
编译agent
- view plaincopy to clipboardprint?
- 01.make
- make
配置 /etc/services
这步并不是必须的,但推荐这样做。
添加下面两行到 /etc/services:
- view plaincopy to clipboardprint?
- 01.zabbix_agent 10050/tcp
- 02.zabbix_trap 10051/tcp
- zabbix_agent 10050/tcp
- zabbix_trap 10051/tcp
配置/etc/inetd.conf
- view plaincopy to clipboardprint?
- 01.cp misc/init.d/redhat/zabbix_agentd_ctl /etc/init.d/zabbix-agentd
- 02.chmod +x /etc/init.d/zabbix-agentd
- cp misc/init.d/redhat/zabbix_agentd_ctl /etc/init.d/zabbix-agentd
- chmod +x /etc/init.d/zabbix-agentd
拷贝zabbix_agentd.conf
- view plaincopy to clipboardprint?
- 01.mkdir /etc/zabbix
- 02.cp misc/conf/zabbix_agent.conf /etc/zabbix/
- 03.cp misc/conf/zabbix_agentd.conf /etc/zabbix/
- mkdir /etc/zabbix
- cp misc/conf/zabbix_agent.conf /etc/zabbix/
- cp misc/conf/zabbix_agentd.conf /etc/zabbix/
修改 zabbix-agentd 头部变量定义:
- view plaincopy to clipboardprint?
- 01.BASEDIR= /usr/local
- 02.ZABBIX_AGENTD=$BASEDIR/sbin/zabbix_agentd
- BASEDIR= /usr/local
- ZABBIX_AGENTD=$BASEDIR/sbin/zabbix_agentd
配置/etc/zabbix/zabbix_agentd.conf
- view plaincopy to clipboardprint?
- 01.LogFile=/tmp/zabbix_agentd.log //日志保存位置
- 02.EnableRemoteCommands=1 //允许执行远程命令
- 03.Server=xx.xx.xx.xx //agent端的ip
- 04.Hostname=abc //必须与zabbix创建的host name相同
- LogFile=/tmp/zabbix_agentd.log //日志保存位置
- EnableRemoteCommands=1 //允许执行远程命令
- Server=xx.xx.xx.xx //agent端的ip
- Hostname=abc //必须与zabbix创建的host name相同
参考: misc/conf/zabbix_agentd.conf
启动代理端服务
view plaincopy to clipboardprint?
- sudo /etc/init.d/zabbix-agentd start
以上就是Zabbix Agent的配置。
【编辑推荐】