安装环境:
centos6.5 2.6.32-358.el6.x86_64
ip:192.168.75.130
zabbix_server 这台机器我们已经安装好了 zabbix_agentd,所以无需再次安装了。
那么其他需要监控的 linux 机器是如何安装的呢?
在安装客户端的时候,软件包和服务器是同一个,只是 configure 的配置参数不同而已。
当然,源码安装,什么 GCC,make 这些命令都得安装,所以客户端不建议源码安装,由于针对大量机器(成千上万,在互联网公司很常见),推荐 rpm 包安装。
使用用源码安装:
1.创建用户和组
[[email protected] ~]# groupadd zabbix -g 201
[[email protected] ~]# useradd -g zabbix -u 201 -m zabbix
2.编译安装zabbix
[[email protected] ~]# groupadd zabbix -g 201
[[email protected] ~]# useradd -g zabbix -u 201 -m zabbix
[[email protected] ~]# rz (这里我下好了,上传)
rz waiting to receive.
Starting zmodem transfer. Press Ctrl+C to cancel.
Transferring zabbix-2.0.8.tar.gz...
100% 13142 KB 13142 KB/sec 00:00:01 0 Errors
[[email protected] ~]# tar xf zabbix-2.0.8.tar.gz
[[email protected] ~]# cd zabbix-2.0.8
[[email protected] zabbix-2.0.8]# ./configure --prefix=/usr --sysconfdir=/etc//zabbix --enable-agent
[[email protected] zabbix-2.0.8]# make && make install
3.开始授权并配置启动服务项
[[email protected] zabbix-2.0.8]# mkdir /var/log/zabbix (创建日记文件目录)
[[email protected] zabbix-2.0.8]# chown zabbix.zabbix /var/log/zabbix (授权给zabbix)
[[email protected] zabbix-2.0.8]# ls
aclocal.m4 compile config.sub depcomp m4 misc upgrades
AUTHORS conf configure frontends Makefile missing
bin config.guess configure.in include Makefile.am NEWS
build config.log COPYING INSTALL Makefile.in README
ChangeLog config.status database install-sh man src
[[email protected] zabbix-2.0.8]# cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/ (配置启动项)
[[email protected] zabbix-2.0.8]# chmod 755 /etc/init.d/zabbix_agentd
[[email protected] zabbix-2.0.8]# sed -i "s#BASEDIR=/usr/local#BASEDIR=/usr/#g" /etc/init.d/zabbix_agentd
4.配置服务端口 (默认已经配置好)
[[email protected] zabbix-2.0.8]# vim /etc/services
zabbix-agent 10050/tcp # Zabbix Agent
zabbix-agent 10050/udp # Zabbix Agent
zabbix-trapper 10051/tcp # Zabbix Trapper
zabbix-trapper 10051/udp # Zabbix Trapper
5.配置zabbix_agentd.conf
[[email protected] zabbix-2.0.8]# vim /etc/zabbix/zabbix_agentd.conf
[[email protected] zabbix-2.0.8]# cat /etc/zabbix/zabbix_agentd.conf | egrep -v "^#|^$"
LogFile=/var/log/zabbix/zabbix_agentd.log
Server=127.0.0.1,192.168.75.128
ServerActive=192.168.75.128:10051
Hostname=Zabbix server
UnsafeUserParameters=1
6.启动服务
[[email protected] zabbix-2.0.8]# chkconfig zabbix_agentd on
[[email protected] zabbix-2.0.8]# service zabbix_agentd start
Starting zabbix_agentd: [ OK ]
7.snmp监控方式
[[email protected] zabbix-2.0.8]# yum -y install net-snmp
[[email protected] zabbix-2.0.8]#cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak
[[email protected] etc]# cat /etc/snmp/snmpd.conf
com2sec mynetwork 192.168.75.128 public_monitor
com2sec mynetwork 127.0.0.1 public
group MyROGroup v2c mynetwork
access MyROGroup "" any noauth prefix all none none
view all included .1 80
[[email protected] snmp]# chkconfig snmpd on
[[email protected] snmp]# service snmpd restart
Stopping snmpd: [FAILED]
Starting snmpd: [ OK ]
windows 客户端的安装
下载地址 http://www.zabbix.com/downloads/2.0.8/zabbix_agents_2.0.8.win.zip
下载解压,我是解压到 C:\Program Files\的,大家也可以解压到其他路径去
注册服务程序,注意路径中有空格,应该用双引号
C:\Program Files\zabbix_agents_2.0.8.win\bin\win32>zabbix_agentd.exe --install -c
"C:\Program Files\zabbix_agents_2.0.8.win\conf\zabbix_agentd.win.conf"
如果是 64 位系统,请选择 64 位程序
去服务管理里面看看,已经添加上
关于 zabbix_agentd.conf 和 linux 一样,此处不再重复
最后启动服务,完成安装。