linux系统监控之zabbix agentd安装

系统环境:

[root@zabbix-agentd ~]# cat /etc/redhat-release
CentOS release 5.9 (Final)
[root@zabbix-agentd ~]# uname -a
Linux zabbix-agentd 2.6.18-348.el5 #1 SMP Tue Jan 8 17:53:53 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@zabbix-agentd ~]# lsb_release -a
LSB Version:    :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 5.9 (Final)
Release:    5.9
Codename:   Final
[root@zabbix-agentd ~]# cd /etc/yum.repos.d/
[root@zabbix-agentd yum.repos.d]# rm -rf *
[root@zabbix-agentd yum.repos.d]# wget http://mirrors.163.com/.help/CentOS5-Base-163.repo
[root@zabbix-agentd yum.repos.d]# cd ~

开始安装

[root@zabbix-agentd ~]# mkdir soft
[root@zabbix-agentd ~]# cd soft
[root@zabbix-agentd soft]# wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.2.2/zabbix-2.2.2.tar.gz/download
[root@zabbix-agentd soft]# tar xf zabbix-2.2.2.tar.gz
[root@zabbix-agentd soft]# cd zabbix-2.2.2
[root@zabbix-agentd zabbix-2.2.2]# groupadd zabbix
[root@zabbix-agentd zabbix-2.2.2]# useradd -g zabbix -u 201 -m zabbix
[root@zabbix-agentd zabbix-2.2.2]# ./configure --prefix=/usr/local/zabbix --enable-agent
[root@zabbix-agentd zabbix-2.2.2]# make -j 2 && make install
[root@zabbix-agentd zabbix-2.2.2]# cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
[root@zabbix-agentd zabbix-2.2.2]# chmod +x /etc/init.d/zabbix_agentd
[root@zabbix-agentd zabbix-2.2.2]# vim /etc/init.d/zabbix_agentd
BASEDIR=/usr/local/zabbix
[root@zabbix-agentd zabbix-2.2.2]# vim /usr/local/zabbix/etc/zabbix_agentd.conf
LogFile=/tmp/zabbix_agentd.log
EnableRemoteCommands=0
Server=172.16.10.10
StartAgents=8
ServerActive=172.16.10.10
Hostname=Zabbix server
Timeout=30
Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
UnsafeUserParameters=1
[root@zabbix-agentd zabbix-2.2.2]# chkconfig zabbix_agentd on
[root@zabbix-agentd zabbix-2.2.2]# /etc/init.d/zabbix_agentd start
Starting zabbix_agentd:                                    [  OK  ]

客户端安装完成


在zabbix server里添加主机

打开zabbix 在浏览器中

Configuration-->Hosts-->Create host

Host name : web-server

Groups In groups : Linux servers

Groups In groups

IP address:172.16.10.1

好了 我们切换到Templates选项卡里

Link new templates 输入linux 选择Template OS Linux

然后点击save


至此agentd端监控就完成了


本文出自 “devops” 博客,谢绝转载!

你可能感兴趣的:(linux系统监控之zabbix agentd安装)