您的位置:首页 > 运维架构 > Linux

linux客户端配置zabbix_agentd服务

2017-02-24 00:00 316 查看
[root@localhost zabbix-2.4.6]# yum install -y curl curl-devel net-snmp net-snmp-devel perl-DBI

创建用户账号

useradd -s /sbin/nologin zabbix

安装zabbix客户端

tar xvf /home/white/zabbix-2.4.6.tar.gz
cd zabbix-2.4.6/
[root@localhost zabbix-2.4.6]# ./configure --prefix=/usr/local/zabbix-2.4.6 --enable-agent
[root@localhost zabbix-2.4.6]# make install

创建服务管理脚本

[root@localhost zabbix-2.4.6]# cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/

不知道那个脚本的话可通过以下脚本查找:

[root@localhost zabbix-2.4.6]# grep "chkconfig" ./* -R --color

修改脚本文件:

[root@localhost ~]# vim /etc/init.d/zabbix_agentd
改BASEDIR=/usr/local/为BASEDIR=/usr/local/zabbix-2.4.6
chmod +x /etc/init.d/zabbix_agentd
chkconfig --add zabbix_agentd
chkconfig zabbix_agentd on

配置客户端

[root@localhost ~]# vim /usr/local/zabbix-2.4.6/etc/zabbix_agentd.conf(注意配置文件不要和zabbix_agent.conf弄混)

改Server=192.168.1.95  #zabbix server的ip地址或主机名,可多个,用逗号隔开
ServerActive=127.0.0.1(默认不用改,这个是开启主动检查)
Hostname=lin239
UnsafeUserParameters=1
查看是否配置正确
[root@localhost ~]# grep ^[^#] /usr/local/zabbix-2.4.6/etc/zabbix_agentd.conf
启动[root@localhost ~]# /etc/init.d/zabbix_agentd start
测试服务端与客户端通信
[root@monitor ~]# /usr/local/zabbix/bin/zabbix_get -s 192.168.1.239 -p10050 -k "net.if.in[eth0,bytes]"
232381295(可以得到网卡信息说明客户端与服务端可以正常通信)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: