zabbix源码安装

发布时间:2020-08-17 18:01:07 作者:dbasdk
来源:ITPUB博客 阅读:145

zabbix 介绍

zabbix由2部分构成,zabbix server与可选组件zabbix agent。

zabbix 安装

安装zabbix依赖包
shell> yum install net-snmp-devel curl-devel

创建zabbix用户
shell> groupadd zabbix
shell> useradd -r -g zabbix zabbix

解压zabbix安装包
shell> tar zxvf zabbix-2.4.5.tar.gz 
shell> cd zabbix-2.4.5/

创建zabbix数据库库并导入初始化数据
mysql> create database zabbix character set utf8;
Query OK, 1 row affected (0.02 sec)

mysql> grant all on zabbix.* to zabbix@localhost identified by '123@qwe';
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

shell> mysql -u zabbix -p zabbix < database/mysql/schema.sql
shell> mysql -u zabbix -p zabbix < database/mysql/images.sql
shell> mysql -u zabbix -p zabbix < database/mysql/data.sql

编译安装zabbix
shell> ./configure --prefix=/usr/local/zabbix --enable-server --enable-proxy --enable-agent \
--with-mysql=/db/mysql/bin/mysql_config --with-net-snmp --with-libcurl

shell> make && make install

shell> ln -s /usr/local/zabbix/sbin/* /usr/local/sbin/
shell> ln -s /usr/local/zabbix/bin/* /usr/local/bin/

zabbix 配置

添加zabbix server端口
shell> grep zabbix /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

更改zabbix-server.conf配置文件中关于数据库部分。
shell> vi /usr/local/zabbix/etc/zabbix_server.conf
==============================================================
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=123@qwe
DBSocket=/tmp/mysql.sock
DBPort=3306
ListenIP=127.0.0.1
AlertScriptsPath=/usr/local/zabbix/share/zabbix/alertscripts
==============================================================

更改zabbix_agent.conf配置文件中关于数据库部分
shell> vi /usr/local/zabbix/etc/zabbix_agentd.conf
==============================================================
Include=/usr/local/etc/zabbix_agentd.conf.d/
UnsafeUserParameters=1
==============================================================

启动运行zabbix

拷贝zabbix前端到web目录下
shell> cp -a frontends/php/* /usr/local/nginx/html/zabbix/
shell> chown -R nginx.nginx /usr/local/nginx/html/

添加zabbix到开机启动脚本并修改
shell> cp misc/init.d/fedora/zabbix_agentd /etc/init.d/
shell> cp misc/init.d/fedora/zabbix_server /etc/init.d/
修改/etc/init.d/zabbix_server、/etc/init.d/zabbix_agentd中BASEDIR=/usr/local/zabbix

shell> /etc/init.d/zabbix_agentd start
Starting zabbix_agentd:                                    [确定]

shell> /etc/init.d/zabbix_server start
Starting zabbix_server:                                    [确定]

配置web站点

修改php配置文件参数
shell> vi /usr/local/php/lib/php.ini
==============================================================
date.timezone = Asia/Shanghai
post_max_size =32M
max_execution_time =300
max_input_time =300
==============================================================

启动php-fpm、nginx
shell> /usr/local/php/sbin/php-fpm 
shell> /usr/local/nginx/nginx

通过web页面配置zabbix

在浏览器中输入http:///zabbix/setup.php,会显示

  1. Welcome ---> next
  2. Check of pre-requisites ---> next,如检查不通过可能需要修改php配置文件或动态扩展编译php
  3. Configure DB connection ---> 输入数据库用户信息,Test connection, nest
  4. Zabbix server details ---> next
  5. Pre-Installation summary ---> next
  6. Install ---> Finish

使用默认账号:admin 密码:zabbix 登录

参考:
https://www.zabbix.com/documentation/2.4/manual/installation/install
http://coolnull.com/217.html
http://www.osyunwei.com/archives/7984.html

整理自网络

Svoid
2015-07-02

推荐阅读:
  1. 源码安装php
  2. nginx源码安装

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

zabbix 安装 源码

上一篇:centos 8定制安装

下一篇:JS类库管理

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》