CentOS 下zabbix_agent 的安装配置_落英缤纷

CentOS zabbix_agent 的安装配置_落英缤纷

1.下载

http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.0.0//zabbix-2.0.0.tar.gz

http://www.zabbix.com/documentation/2.0/manual/installation

2.安装

创建用户

#groupadd zabbix

#useradd -g zabbix zabbix

1)解压

#tar -zxvf zabbix-2.0.0.tar.gz

2)安装

#cd zabbix-2.0.0

#./configure --prefix=/usr/local/zabbix_agent --enable-agent

提示gcc,make错误,安装gcc 和make

#yum install gcc make

#make install

3)安装服务

#cat >>/etc/services<<EOF

zabbix-agent 10050/tcp #zabbix agent

zabbix-agent 10050/udp #zabbix agent

zabbix-trapper 10051/tcp #zabbix trapper

zabbix-trapper 10051/udp #zabbix trapper

EOF

4)修改配置文件

#vi /usr/local/zabbix_agent/etc/zabbix_agentd.conf

Server=127.0.0.1 #若本机不是server,则修改,如192.168.2.118

Hostname=CentOS-6.3-cacti 修改为被监控主机主机名或者被监控主机IP

#/usr/local/zabbix_agent/sbin/zabbix_agentd -c #/usr/local/zabbix_agent/etc/zabbix_agentd.conf

5)创建服务

#cp /usr/local/zabbix_agent/sbin/abbix_agentd /etc/init.d/

#chmod a+x /etc/init.d/zabbix_*

6)启动

#service zabbix_agentd start

#ps ax|grep zabbix_agentd

#netstat -utlnp | grep zabbix

7)添加到系统目录

#ln -s /usr/local/zabbix_agent/sbin/* /usr/local/sbin/

#ln -s /usr/local/zabbix_agent/bin/* /usr/local/bin/

开机运行:

#vi /etc/rc.local

加入:

#/usr/local/zabbix_agent/sbin/zabbix_agentd -c #/usr/local/zabbix_agent/etc/zabbix_agentd.conf

8)测试,下面的命令需要在server端执行,其中127.0.0.1是agent的ip

#zabbix_get -s192.168.2.118 -p10050 -k"system.uptime"

image

最后在zabbix web管理界面添加linux 主机:

image

image

image

--------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------

直接下载安装zabbix_agent

(备注:zabbix_agents_2.0.0.linux2_6_23.i386.tar.gz,低版本的可能有问题,zabbix_agentd -c运行错误)

1.下载

http://www.zabbix.com/downloads/2.0.4/zabbix_agents_2.0.4.linux2_6_23.i386.tar.gz

http://www.zabbix.com/documentation/2.0/manual/installation

2.安装

创建用户

#groupadd zabbix

#useradd -g zabbix zabbix

1)解压

#tar -zxvf zabbix_agents_2.0.4.linux2_6_23.i386.tar.gz

2)安装

#mv bin sbin conf /usr/local/zabbix

#cp /usr/local/zabbix/conf/zabbix_agentd.conf /usr/local/zabbix

3)安装服务

#vi /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

4)修改配置文件

#vi /usr/local/zabbix /etc/zabbix_agentd.conf

Server=127.0.0.1 #若本机不是server,则修改,192.168.2.115

Hostname=CentOS-6.3-cacti 修改为被监控主机主机名或者被监控主机IP

/usr/local/zabbix/sbin/zabbix_agentd -c /usr/local/zabbix/zabbix_agentd.conf

5)创建服务

#cp /usr/local/zabbix/sbin/abbix_agentd /etc/init.d/

#chmod a+x /etc/init.d/zabbix_*

6)启动

#service zabbix_agentd start

#ps ax|grep zabbix_agentd

#netstat -utlnp | grep zabbix

7)添加到系统目录

#ln -s /usr/local/zabbix_agent/sbin/* /usr/local/sbin/

#ln -s /usr/local/zabbix_agent/bin/* /usr/local/bin/

开机运行:

#vi /etc/rc.local

加入:

/usr/local/zabbix_agent/sbin/zabbix_agentd -c /usr/local/zabbix_agent/etc/zabbix_agentd.conf

8)测试,下面的命令需要在server端执行,其中127.0.0.1是agent的ip

#zabbix_get -s192.168.2.115 -p10050 -k"system.uptime"

image

image

你可能感兴趣的:(centos,zabbix)