zabbix3.0源码安装 亲测

zabbix3.0安装注意:

1、PHP要5.4版本以上
2、防火墙关闭
3、selinux关闭
 
安装服务端:
一、安装PHP
添加 epel 源
# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
添加 remi 源
复制代码
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
安装 PHP数据库及其他插件
# yum --enablerepo=remi,remi-php55 install php-fpm php-common php-devel php-mysqlnd php-mbstring php-mcrypt httpd php mysql mysql-server php-mysql php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmath mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp-devel curl-devel mod_ssl mod_perl mod_auth_mysql net-snmp

或者:
访问zabbix需要php5.4及以上版本 yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64  这是5.6安装命令
查看 PHP 版本
# php -v
PHP 5.5.9 (cli) (built: Feb 11 2014 08:25:33) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
二、mysql配置
创建zabbix库
create database zabbix
创建用户并授权
grant all on zabbix.* to zabbix@“%” identified by ‘zabbix’;
flush privileges;
三、安装zabbix
安装插件
yum --enablerepo=remi,remi-php55 install mysql-devel libxml2-devel net-snmp-devel libcurl-devel
1、下载zabbix 3.0包
wget https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.0.1/zabbix-3.0.1.tar.gz/download --no-check-certificate
tar xf zabbix-3.0.1.tar.gz
cd zabbix-3.0.1
groupadd zabbix
useradd -g zabbix zabbix
./configure --prefix=/usr/local/zabbix-server --enable-server --with-mysql --with-net-snmp --with-libcurl --with-libxml2
make install

导入数据文件
cd /opt/zabbix-3.0.1/database/mysql
mysql -uroot -p zabbix  < schema.sql          //导入顺序不能错
mysql -uroot -p zabbix  < images.sql
mysql -uroot -p zabbix  < data.sql

2.编辑配置文件并启动:

日志默认在/tmp目录下

vim /usr/local/zabbix-server/etc/zabbix_server.conf
------------------------------------------------------------->
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
ListenIP=127.0.0.1
<-------------------------------------------------------------
/usr/local/zabbix-server/sbin/zabbix_server -c /usr/local/zabbix-server/etc/zabbix_server.conf      //启动服务

查看端口,已经开始监听了:
3、拷贝zabbix应用到WEB根目录下
cd zabbix-3.0.1/frontends/php/
cp -a . /var/www/html/zabbix/
chown -R apache.apache /var/www/html/zabbix/*
4、配置php并启动httpd:

vim /etc/php.ini
----------------------------------------->
date.timezone = Asia/Shanghai
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
----------------------------------------->
service httpd start

用浏览器访问http://192.168.19.76/zabbix,并按照提示安装:
访问zabbix需要php5.4及以上版本 yum install php56w.x86_64 php56w-cli.x86_64 php56w-common.x86_64 php56w-gd.x86_64 php56w-ldap.x86_64 php56w-mbstring.x86_64 php56w-mcrypt.x86_64 php56w-mysql.x86_64 php56w-pdo.x86_64  这是5.6安装命令

以下是网页端安装zabbix前的一些问题解决方法
yum install *bcmath* --skip-broken
yum install php-xmlwriter
vim /目录/zabbix/ include /classes/setup/CFrontendSetup.php
找到下面代码、关于always-populate-raw-post-data;
 
添加  $current   = -1;
 
public   function   checkPhpAlwaysPopulateRawPostData() {
                 $current   ini_get ( 'always_populate_raw_post_data' );
                 $current   = -1;
                 return   array (
                         'name'   => _( 'PHP always_populate_raw_post_data' ),
                         'current'   => ( $current   != -1) ? _( 'on' ) : _( 'off' ),
                         'required'   => _( 'off' ),
                         'result'   => ( $current   != -1) ? self::CHECK_FATAL : self::CHECK_OK,
                         'error'   => _( 'PHP always_populate_raw_post_data must be set to -1.' )
                 );
        }

Linux上zabbix客户端安装

yum -y install unixODBC

然后再执行

rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-agent-3.0.3-1.el6.x86_64.rpm

Windows上安装zabbix客户端:
解压到 D:\zabbix

Conf目录下存放的是agent的配置文件,更改如下:

LogFile=d:\zabbix\zabbix_agentd.log

Server=192.168.0.18

ServerActive=192.168.0.18

Hostname=Windows client_1

cd d:\zabbix\bin\win64
zabbix_agentd.exe -i -c "D:\zabbix\conf\zabbix_agentd.win.conf"
然后启动客户端服务

开启zabbix对中文的支持

原来zabbix默认把对中文的支持给关闭了,我们需要修改zabbix的php源文件. 修改站点根目录下include/locales.inc.php文件.

1
2
3
4
5
6
7
8
9
10
11
# vim include/locales.inc.php
function getLocales ( ) {
        return array (
                'en_GB' = > array ( 'name' = > _ ( 'English (en_GB)' ) ,        'display' = > true ) ,
                'en_US' = > array ( 'name' = > _ ( 'English (en_US)' ) ,        'display' = > true ) ,
                'bg_BG' = > array ( 'name' = > _ ( 'Bulgarian (bg_BG)' ) ,      'display' = > true ) ,
                'zh_CN' = > array ( 'name' = > _ ( 'Chinese (zh_CN)' ) ,        'display' = > true ) ,
                 //原本这里为false,请改为true
                 . . . . . . . . . . .代码省略掉 . . . . . . . .
        ) ;
}
zabbix图形界面会出现一些乱码的情况,解决办法是将windows机器中的字体包上传到系统中:
找到本地 C:\Windows\Fonts\ simkai.ttf(楷体)上传到服务器 zabbix 网站目录 fonts 目录下。
zabbix字体目录为:/usr/share/zabbix/fonts/
将字体包改名:
 mv MSYH.ttf msyh.ttf
 mv MSYHBD.ttf msyhbd.ttf
然后在配置文件中改边字体包名字:
# pwd
/var/www/html/zabbix/include
# vi defines.inc.php
#修改第93行
define('ZBX_FONT_NAME','msyh'); 
#修改第45行改为
define('ZBX_GRAPH_FONT_NAME','msyh')
修改完后修改所属人,组为Apache:Apache 并修改权限!!!
然后重启httpd


linux中Zabbix邮件报警设置配置步骤-linux-操作系统-壹聚教程网 
http://www.111cn.net/sys/linux/68096.htm





























  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要进行Zabbix 6.0源码安装,可以按照以下步骤进行操作: 1. 首先,运行`make install`命令来安装守护进程二进制文件(zabbix_server、zabbix_agentd、zabbix_proxy)到`/usr/local/sbin`目录,并将客户端二进制文件(zabbix_get、zabbix_sender)安装到`/usr/local/bin`目录。\[1\] 2. 接下来,需要配置Zabbix Server。创建`/usr/lib/systemd/system/zabbix-server.service`文件,并将相应的配置内容添加进去。这个文件可以用来设置Zabbix Server的启动参数、环境变量等。\[2\] 3. 在配置完Zabbix Server后,可以运行以下命令来重载系统服务:`systemctl daemon-reload`。然后,使用`systemctl enable zabbix-server.service`命令设置Zabbix Server开机启动,并使用`systemctl start zabbix-server.service`命令启动服务。\[2\] 4. 最后,如果你还需要使用Zabbix的Web界面,可以将Zabbix的UI文件复制到Nginx的HTML目录中。可以使用`cp -r /home/install/zabbix-6.0.6/ui/* /usr/local/nginx/html/zabbix/`命令来完成复制。\[2\] 5. 如果你是在基于RedHat的系统上进行安装,可以运行以下命令来创建Zabbix用户和组:`groupadd --system zabbix`和`useradd --system -g zabbix -d /usr/lib/zabbix -s /sbin/nologin -c "Zabbix Monitoring System" zabbix`。\[3\] 这样,你就可以完成Zabbix 6.0源码安装了。请根据你的系统和需求进行相应的调整和配置。 #### 引用[.reference_title] - *1* *3* [Zabbix6.0使用教程 (四)—zabbix6.0从源代码安装](https://blog.csdn.net/weixin_43631631/article/details/128221464)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [zabbix6.0 源码安装](https://blog.csdn.net/weixin_47647077/article/details/125909075)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值