agent安装和server基本相同,也使用同样的软件包。只是在编译的时候只启用agent组件。
新建用户/用户组
groupadd zabbix
useradd -g zabbix zabbix
编译安装zabbix agent
tar -xvf zabbix-2.4.3.tar.gz
cd zabbix-2.4.3
./configure --prefix=/opt/zabbix_agent --enable-agent
make install
修改agentd.conf配置文件,设置zabbix_server信息。
vi /opt/zabbix_agent/etc/zabbix_agentd.conf
....
Server=*** #zabbix server IP Address
ServerActive=*** #zabbix server IP Address
Hostname=*** #Local IP Address
....
创建zabbix_agentd服务:
cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
chmod a+x /etc/init.d/zabbix_*
修改zabbix_agentd服务变量:
vi /etc/init.d/zabbix_agentd
....
BASEDIR=/opt/zabbix_agent
FULLPATH=$BASEDIR/sbin/$BINARY_NAME
#configuration file
CONF_FILE=$BASEDIR/etc/zabbix_agentd.conf
action $"Starting $BINARY_NAME: " $FULLPATH -c $CONF_FILE
....
启动zabbix_agentd服务,并加入到开机启动:
service zabbix_agentd start
chkconfig zabbix_agentd on