1.编译安装zabbix
进入zabbix-2.4.3
# ./configure --prefix=/usr/local/zabbix --enable-server --with-mysql --with-net-snmp --with-jabber --with-libcurl --with-openipmi --enable-agent
报错checking for IKSEMEL... No
configure: error: Jabber library not found
需要安装iksemel和iksemel-devel
下载安装iksemel-1.4-2.el6.x86_64.rpm和iksemel-devel-1.4-2.el6.x86_64.rpm
# rpm -ivh iksemel-1.4-2.el6.x86_64.rpm
# rpm -ivh iksemel-devel-1.4-2.el6.x86_64.rpm
报错 error: Failed dependencies:
gnutls-devel is needed by iksemel-devel-1.4-2.el6.x86_64
# yum install gnutls-devel
# rpm -ivh iksemel-devel-1.4-2.el6.x86_64.rpm
2.再次编译安装zabbix
# ./configure --prefix=/usr/local/zabbix --enable-server --with-mysql --with-net-snmp --with-jabber --with-libcurl --with-openipmi --enable-agent
报错checking for OPENIPMI support... no
configure: error: Invalid OPENIPMI directory - unable to find ipmiif.h
需要安装OpenIPMI和OpenIPMI-devel
Yum安装OpenIPMI并下载OpenIPMI-devel-2.0.16-14.el6.x86_64.rpm
# yum install OpenIPMI
# rpm -ivh OpenIPMI-devel-2.0.16-14.el6.x86_64.rpm
报错 error: Failed dependencies:
pkgconfig(ncurses) is needed by OpenIPMI-devel-2.0.16-14.el6.x86_64
# yum install ncurses-devel
# rpm -ivh OpenIPMI-devel-2.0.16-14.el6.x86_64.rpm
3.继续编译安装zabbix
# ./configure --prefix=/usr/local/zabbix --enable-server --with-mysql --with-net-snmp --with-jabber --with-libcurl --with-openipmi --enable-agent
***********************************************************
* Now run ‘make install‘ *
* *
* Thank you for using Zabbix! *
* <http://www.zabbix.com> *
***********************************************************
依赖环境ok
# make && make install
拷贝zabbix web 文件到html目录下并改名
# cp -rf /root/zabbix-2.4.3/frontends/php /var/www/html/
# cd /var/www/html/ && mv php zabbix
# chown zabbix:zabbix /var/www/html/zabbix/
配置php相关参数
# vim /etc/php.ini
max_execution_time = 300
date.timezone = Asia/Shanghai
max_input_time = 600
启动apache
# service httpd start
配置zabbix server端
# vim /usr/local/zabbix/etc/zabbix_server.conf
DBHost=localhost ---数据库本机
DBName=zabbix ---数据库库名
DBUser=zabbix ---数据库账号
DBPassword=123 ---数据库密码
DBSocket=/var/lib/mysql/mysql.sock ---指定sock路径
ListenPort=10051 ---服务端监听端口
ListenIP=0.0.0.0 ---监听IP范围
启动服务
# cp /root/zabbix-2.4.3/misc/init.d/fedora/core/zabbix_server /etc/init.d/
# vim /etc/init.d/zabbix_server
BASEDIR=/usr/local/zabbix
# service zabbix_server start
查看启动端口
# lsof -i:10051
添加开机启动
# chkconfig --add zabbix_server
# chkconfig --level zabbix_server on
配置zabbix agent端
# vim /usr/local/zabbix/etc/zabbix_agentd.conf
Server=127.0.0.1 ---填写server端IP,server链接agent获取数据
ServerActive=127.0.0.1 ---填写server端IP,agent主动提交数据
Hostname=Zabbix server ---给agent设定一个名字,默认为Zabbix server
启动服务
#cp /root/zabbix-2.4.3/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
# vim /etc/init.d/zabbix_agentd
BASEDIR=/usr/local/zabbix
# service zabbix_agentd start
添加开机启动
# chkconfig --add zabbix_agentd
# chkconfig --level zabbix_agentd on
输入本机IP/zabbix地址进入web界面,点击next>>
http://192.168.1.238/zabbix
确认信息,点击next>>
点击下载配置文件,然后拷贝到提示目录下,点击retry,点击finish
登陆界面输入账号admin,密码zabbix进入
将zabbix-2.4.3.tar.gz拷贝到需要安装agent端的主机解压
# tar zxvf zabbix-2.4.3.tar.gz
编制安装agent端
# ./configure --prefix=/usr/local/zabbix --enable-agent
# make && make install
配置zabbix agent端
# vim /usr/local/zabbix/etc/zabbix_agentd.conf
Server=192.168.1.238 ---server端IP
ListenPort=10050 ---agent端端口
ServerActive=192.168.1.238 ---server端IP
Hostname=test237 ---定义agent端主机名字
启动服务
#cp /root/zabbix-2.4.3/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
# vim /etc/init.d/zabbix_agentd
BASEDIR=/usr/local/zabbix
# service zabbix_agentd start
查看启动端口添加开机启动
# lsof -i:10050
# chkconfig --add zabbix_agentd
# chkconfig --level zabbix_agentd on
zabbix server添加监控agent,点击configuration---host---create host
host name填写之前agent端配置文件设定的名字test237,groups选择
linux servers,IP地址填写agent端的IP 192.168.1.237,然后点击update
在templates项目选择添加template os linux模块,然后点击update
完成test237主机的监控,后续根据需求添加监控模块或自定义扩展