housekeeper oracle,安装zabbix2.2.3

系统版本:CentOS 6.3_x86_64

zabbix版本:zabbix-2.2.3

zabbix服务端IP:172.16.10.72

1.yum安装LAMP环境

# yum -y install gcc gcc-c++ autoconf httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-mbstringphp-ldap php-pear php-xmlrpc php-bcmath mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp-devel curl-devel unixODBC-devel OpenIPMI-devel ja va-devel

2.配置LAMP使用环境

编辑/etc/php.ini文件,修改以下内容

date.timezone = Asia/Shanghai

max_execution_time= 300post_max_size=32M

max_input_time= 300memory_limit=128M

mbstring.func_overload= 2

启动httpd、mysqld服务

# chkconfig mysqld on

# chkconfig httpd on

# service mysqld start

# service httpd start

3.下载并安装zabbix服务端

下载页面:http://www.zabbix.com/download.php

# wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.3/zabbix-2.2.3.tar.gz

创建zabbix用户

# groupadd zabbix# useraddzabbix -g zabbix

安装zabbix

# tar xf zabbix-2.2.3.tar.gz

# cd zabbix-2.2.3# ./configure --prefix=/usr --sysconfdir=/etc/zabbix --enable-server --enable-proxy --enable-agent --enable-ipv6 --with-mysql=/usr/bin/mysql_config --with-net-snmp --with-libcurl --with-openipmi --with-unixodbc --with-ldap --with-ssh2 --enable-java

报错如下:

checking for SSH2 support... no

configure: error: SSH2 library not found

解决办法:

yum -y install libssh2-devel

上面一个报错解决了,继续./configure,又出现如下错误:

checking for LDAP support... no

configure: error: Invalid LDAP directory - unable to find ldap.h

解决办法:

yum -y install openldap openldap-devel

# make#make install

4.添加zabbix 到系统服务文件

# vi /etc/services(在rhel/centos系列中,下面的服务参数可以不用添加,默认已经有了)

zabbix-agent 10050/tcp # Zabbix Agent

zabbix-agent 10050/udp # Zabbix Agent

zabbix-trapper 10051/tcp # Zabbix Trapper

zabbix-trapper 10051/udp # Zabbix Trapper

5.导入zabbix数据库

[[email protected] zabbix-2.2.3]# mysqladmin -uroot password ‘abc123,‘2.2.3]# mysqladmin -uroot password ‘abc123,‘2.2.3]# mysql -uroot -p

mysql>create database zabbix character set utf8;

mysql> grant all privileges on zabbix.* to [email protected] identified by ‘zabbix‘;

mysql> flush privileges;

测试下连接是否正常

[[email protected] zabbix-2.2.3]# mysql -uzabbix -pzabbix zabbix

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connectionid is 4Server version:5.1.73Source distribution

Copyright (c)2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clearthe current input statement.

mysql>

导入数据库文件

[[email protected] zabbix-2.2.3]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/schema.sql

[[email protected] zabbix-2.2.3]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/images.sql

[[email protected] zabbix-2.2.3]# mysql -uzabbix -pzabbix zabbix < ./database/mysql/data.sql

6.创建zabbix日志目录

# mkdir /var/log/zabbix

#chown zabbix.zabbix /var/log/zabbix

7.设置zabbix启动脚本

[[email protected] zabbix-2.2.3]# cp misc/init.d/fedora/core/zabbix_* /etc/init.d/2.2.3]# chmod 755 /etc/init.d/zabbix_*2.2.3]# sed -i "s#BASEDIR=/usr/local#BASEDIR=/usr/#" /etc/init.d/zabbix_server

[[email protected] zabbix-2.2.3]# sed -i "s#BASEDIR=/usr/local#BASEDIR=/usr/#" /etc/init.d/zabbix_agentd

8.编辑/etc/zabbix/zabbix_server.conf文件,修改以下参数

LogFile=/var/log/zabbix/zabbix_server.log

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix

DBSocket=/var/lib/mysql/mysql.sock

DBPort=3306StartPollers=160(测试环境默认值即可)

StartTrappers=20(测试环境默认值即可)

StartPingers=100(测试环境默认值即可)

StartDiscoverers=120(测试环境默认值即可)

MaxHousekeeperDelete=5000(测试环境默认值即可)

CacheSize=1024M (测试环境默认值即可)

StartDBSyncers=16(测试环境默认值即可)

HistoryCacheSize=1024M (测试环境默认值即可)

TrendCacheSize=1024M (测试环境默认值即可)

HistoryTextCacheSize=512M (测试环境默认值即可)

AlertScriptsPath=/etc/zabbix/alertscripts

LogSlowQueries=1000

修改完成后可通过以下命令进行查看:

grep -Ev "(#|^$)" /etc/zabbix/zabbix_server.conf

9.编辑/etc/zabbix/zabbix_agentd.conf文件,修改以下参数

LogFile=/var/log/zabbix/zabbix_agentd.log

EnableRemoteCommands=0Server=127.0.0.1,172.16.10.72#zabbix服务端IP

StartAgents=8ServerActive=172.16.10.72:10051Hostname=Zabbix server

Timeout=30Include=/etc/zabbix/zabbix_agentd.conf.d/UnsafeUserParameters=1

修改完成后可通过以下命令进行查看:

grep -Ev "(#|^$)" /etc/zabbix/zabbix_agentd.conf

10.拷贝zabbix网页文件到apache目录

[[email protected] zabbix-2.2.3]# cp -r ./frontends/php/ /var/www/html/2.2.3]# chown -R apache.apache /var/www/html/zabbix

11.开启zabbix服务

[email protected] zabbix-2.2.3]# chkconfig zabbix_server on

[[email protected] zabbix-2.2.3]# chkconfig zabbix_agentd on

[[email protected] zabbix-2.2.3]# service zabbix_server start

Starting zabbix_server: [ OK ]

[[email protected] zabbix-2.2.3]# service zabbix_agentd start

Starting zabbix_agentd: [ OK ]

#查看zabbix服务是否启动

[[email protected] zabbix-2.2.3]# netstat -antpl|grepzabbix

tcp0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 22542/zabbix_agentd

tcp0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 22473/zabbix_server

tcp0 0 :::10050 :::* LISTEN 22542/zabbix_agentd

tcp0 0 :::10051 :::* LISTEN 22473/zabbix_server

12.通过web页面配置zabbix

# service iptables stop #暂时关闭防火墙

打开浏览器,访问:http://172.16.10.72/zabbix,不出意外,会看到如下页面

d4e477c7f64875d053b3157c1b42dff4.png

点击next,进入下一步

23035bda4831abd6550542a751ef14b3.png

9b23a199409b2a0db13b658d3a08c344.png

3c049fd36d95fd161fe01f9cd37bcecc.png

3ef88c53516fc7c41a0c04a56c08631e.png

cb30179fb35fedab5cf1637c33e69529.png

到此web页面配置完毕,已经到了登陆界面,zabbix的默认登陆账号是admin,密码是zabbix

239313e008f8401191ae39c43675fff5.png

登录后发现一个报错:zabbbix server is not  running:the information displayed may not be current

f34bf350698aeb649a860cfe7e75afad.png

经过排查,发现是selinux惹的祸

解决办法:关闭selinux

setenforce 0

再刷新页面看看,已经正常

0371373662460593970335305f91d47f.png

zabbix 2.2.3安装到此结束。

原文:http://www.cnblogs.com/Eivll0m/p/3807604.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值