Chinaunix首页 | 论坛 | 博客
  • 博客访问: 181226
  • 博文数量: 26
  • 博客积分: 215
  • 博客等级: 入伍新兵
  • 技术积分: 346
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-21 15:00
文章分类

全部博文(26)

文章存档

2017年(10)

2016年(1)

2015年(2)

2014年(1)

2013年(7)

2012年(5)

我的朋友

分类: 系统运维

2017-10-10 15:03:33

server端:  192.168.1.33    centos7.1(虚拟机)
agent端:  192.168.1.240   centos6.7( 虚拟机)
一、安装agent
安装文件路径,请根据自己实际情况自行选择。
# rpm -ivh 3.4/rhel/6/x86_64/zabbix-agent-3.4.2-1.el6.x86_64.rpm
Retrieving 3.4/rhel/6/x86_64/zabbix-agent-3.4.2-1.el6.x86_64.rpm
warning: /var/tmp/rpm-tmp.AmbpFZ: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY
Preparing...                ########################################### [100%]
   1:zabbix-agent           ########################################### [100%]

采用rpm包的安装好处是不用创建账户了
# grep zabbix /etc/passwd
zabbix:x:498:499:Zabbix Monitoring System:/var/lib/zabbix:/sbin/nologin

二、修改配置
设定/etc/zabbix/zabbix_agentd.conf文件,修改下面几个地方:
Server=127.0.0.1 ← ZABBIX服务器的IP地址(192.168.1.33)
Hostname=192.168.1.240 ← ZABBIX agentd的host名字(192.168.1.240),不用用localhost或者127.0.0.1
ServerActive=192.168.1.33 ← 主动收集服务器IP地址(192.168.1.33)

三、设置自启动
启动agent服务
#/etc/init.d/zabbix_agentd start 
设置该启动agent服务为守候service(自启动)
#chkconfig zabbix_agentd on 

四、修改iptables防火墙
开启zabbix要用的端口, 也可以关闭服务器的防火墙
#vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m udp -p udp --dport 10050 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 10051 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10051 -j ACCEPT
#service iptables restart
查看修改后的iptables是否生效
[root@ovf ~]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:zabbix-agent
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:zabbix-agent
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:zabbix-trapper
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:zabbix-trapper

或关闭服务器防火墙
#service iptables stop

五、zabbix中添加监控项



这里添加的linux监测模板

阅读(2115) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~