zabbix源码安装
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了zabbix源码安装相关的知识,希望对你有一定的参考价值。
1.安装LAMP并启动服务
yum install -y httpd mysql mysql-libs php php-mysql mysql-server php-bcmath php-gd php-mbstrin /etc/init.d/httpd start; /etc/init.d/mysqld start
2.JDK的安装
cd /usr/local/src wget http://download.oracle.com/otn-pub/java/jdk/8u71-b15/jdk-8u71-linux-x64.tar.gz?AuthParam=1454065245_effef4fdba5a5d5835208809705435d4 tar xf jdk-8u71-linux-x64.tar.gz mv jdk1.8.0_71/ /usr/local/
vim /etc/profile.d/java.sh #java环境变量的设置 JAVA_HOME=/usr/local/jdk1.8.0_71 JAVA_BIN=/usr/local/jdk1.8.0_71/bin JRE_HOME=/usr/local/jdk1.8.0._71/jre PATH=$PATH:/usr/local/jdk1.8.0_71/bin:/usr/local/jdk1.8.0.71/jre/bin CLASSPATH=/usr/local/jdk1.8.0_71/jre/lib:/usr/local/jdk1.8.0_71/lib:/usr/local/jdk1.8.0_71/jre/lib/charsets.jar
. /etc/profile.d/java.sh #初始化文件 java -version #测试是否安装成功 java version "1.8.0_71" Java(TM) SE Runtime Environment (build 1.8.0_71-b15) Java HotSpot(TM) 64-Bit Server VM (build 25.71-b15, mixed mode)
3.新建zabbix用户和组
groupadd zabbix useradd -g zabbix -s /sbin/nologin -m zabbix
4.安装zabbix的一些依赖包
yum -y install mysql-devel libcurl-devel net-snmp-devel php-pecl-ssh2.x86_64 libssh2-devel.x86_64 php-mbstring php-xml
5.创建数据库,并授权账号
create database zabbix character set utf8; grant all privileges on zabbix.* to [email protected] identified by ‘zabbix‘;
6.编译安装zabbix
wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.0/zabbix-2.2.0.tar.gz tar xf zabbix-2.2.0.tar.gz cd zabbix-2.2.0 ./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-ssh2 --enable-java make && make install echo $?
7.导入数据库
mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/schema.sql mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/images.sql mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/data.sql
8.配置zabbix
a.复制zabbix_server启动文件
cp misc/init.d/fedora/core/zabbix_server /etc/init.d chmod +x /etc/init.d/zabbix_server chkconfig --add zabbix_server chkconfig zabbix_server on
b.复制zabbix_agent启动文件
cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d chmod +x /etc/init.d/zabbix_agentd chkconfig --add zabbix_agentd chkconfig zabbix_server on
c.复制zabbix网页文件到httpd目录下
mkdir /var/www/html/zabbix cp -a frontends/php/* /var/www/zabbix/
d.修改zabbix_server.conf中的数据库连接相关信息
sed -i ‘s/^DBUser=.*$/DBUser=zabbix/g‘ /usr/local/etc/zabbix_server.conf sed -i ‘s/^DBPassword=.*$/DBPassword=zabbix/g‘ /usr/local/etc/zabbix_server.conf
e.添加服务端口
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
f.启动服务:
/etc/init.d/zabbix_server start /etc/init.d/zabbix_agentd start
9.网页安装
vim /etc/php.ini #找到以下关键字,更改为后面的数值,并取消注释 date.timezone=“Asia/Shanghai” post_max_size = 16M max_execution_time = 300 max_input_time = 300 mbstring.func_overload = 2 #解决相关的报错信息 service httpd restart #重启HTTP,点retry
10.错误点:
这时会遇到“zabbix server is not running”这样的错误
需要编辑一下 /etc/zabbix/zabbix_server.conf ,配置DBUser, DBPassword
本文出自 “卫斯理” 博客,请务必保留此出处http://szk5043.blog.51cto.com/8456440/1845129
以上是关于zabbix源码安装的主要内容,如果未能解决你的问题,请参考以下文章
Android 插件化VirtualApp 源码分析 ( 目前的 API 现状 | 安装应用源码分析 | 安装按钮执行的操作 | 返回到 HomeActivity 执行的操作 )(代码片段