linux 服务器客户端的安装
由于 zabbix_server 这台机器我们已经安装好了 zabbix_agentd,所以无需再次安装了。 那么其他需要监控的 linux 机器是如何安装的呢 在安装客户端的时候,软件包和服务器是同一个,只是 configure 的配置参数不同而已。 当然,源码安装,什么 GCC,make 这些命令都得安装,所以客户端不建议源码安装,由于 针对大量机器(成千上万,在互联网公司很常见),推荐 rpm 包安装,下面展示的是用源码安装
下载 zabbix 安装包
1
2
3
4
5
6
7
8
9
|
# wget "http://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.2/zabbix-2.2.2.tar.gz?r=http%3A%2F%2Fwww.zabbix.com%2Fdownload.php&ts=1395066528&use_mirror=jaist"
# groupadd zabbix -g 201
# useradd-g zabbix -u 201 -m zabbix
# tarxf zabbix-2.0.8.tar.gz
# cd zabbix-2.0.8
# ./configure --prefix=/usr --sysconfdir=/etc/zabbix --enable-agent
# make
# make install
|
拷贝 Agent 启动脚本
1
2
3
4
5
|
# mkdir /var/log/zabbix
# chown zabbix.zabbix /var/log/zabbix
# cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
# chmod 755/etc/init.d/zabbix_agentd
# sed -i "s#BASEDIR=/usr/local#BASEDIR=/usr/#g" /etc/init.d/zabbix_agentd
|
添加 zabbix 到系统服务文件
1
2
3
4
5
6
|
# vim /etc/services
zabbix-agent 10050
/tcp
#ZabbixAgent
zabbix-agent 10050
/udp
#ZabbixAgent
zabbix-trapper 10051
/tcp
#ZabbixTrapper
zabbix-trapper 10051
/udp
#ZabbixTrapper
|
修改Agent配置文件
1
2
3
4
5
6
7
|
# sed -i "s/Server\=127.0.0.1/Server\=127.0.0.1,192.168.30.130/g" /etc/zabbix/zabbix_agentd.conf
# sed -i "s/ServerActive\=127.0.0.1/ServerActive\=192.168.30.130:10051/g" /etc/zabbix/zabbix_agentd.conf
# sed -i "s#tmp/zabbix_agentd.log#var/log/zabbix/zabbix_agentd.log#g" /etc/zabbix/zabbix_agentd.conf
# sed -i "#UnsafeUserParameters=0#aUnsafeUserParameters=1\n" /etc/zabbix/zabbix_agentd.conf
|
设置Agent开机启动
1
2
|
# chkconfig zabbix_agentd on
# servicezabbix_agentdstart
|
在Server端使用以下命令测试是否能连接到Agent端:
1
2
|
# /usr/bin/zabbix_get -s 192.168.30.131 -p 10050 -k "system.uptime" (192.169.30.131是Agent端IP)
77177
|
CentOS 6.5 安装部署zabbix(Server端篇):http://zlyang.blog.51cto.com/1196234/1685629
Zabbix显示中文或图片为乱码--解决方法:http://zlyang.blog.51cto.com/1196234/1685863
本文转自yangxuncai110 51CTO博客,原文链接:http://blog.51cto.com/zlyang/1685665,如需转载请自行联系原作者