iis服务器助手广告广告
返回顶部
首页 > 资讯 > 操作系统 >[Linux7] zabbix 3.2.11安装
  • 148
分享到

[Linux7] zabbix 3.2.11安装

2023-06-06 05:06:40 148人浏览 安东尼
摘要

zabbix 3.2.11关闭selinux[root@vm4 ~]$ vi /etc/selinux/config SELINUX=disabled1.安装lamp[root@vm4 ~]$ yum install -y mariadb[

zabbix 3.2.11

关闭selinux
[root@vm4 ~]$ vi /etc/selinux/config
SELINUX=disabled

1.安装lamp
[root@vm4 ~]$ yum install -y mariadb
[root@vm4 ~]$ rpm -qa | grep mariadb
[root@vm4 ~]$ yum install -y PHP-mysql
[root@vm4 ~]$ yum install -y Httpd

[root@vm4 ~]$ systemctl enable mariadb
[root@vm4 ~]$ systemctl start mariadb
[root@vm4 ~]$ Mysql_secure_installation    ->初始化mysql

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
passWord for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

You already have a root password set, so you can safely answer 'n'.

Change the root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!
Remove anonymous users? [Y/n] y
 ... Success!
Disallow root login remotely? [Y/n] y
 ... Success!
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
 ... Success!
Thanks for using MariaDB!


[root@vm4 ~]$ mysql -uroot -pmysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 5.5.52-MariaDB MariaDB Server

Copyright (c) 2000, 2016, oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create user 'zabbix'@'%' identified by 'zabbix';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> create database zabbix;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on zabbix.* to 'zabbix'@'%';
Query OK, 0 rows affected (0.00 sec)


[root@vm4 ~]$ systemctl enable httpd
[root@vm4 ~]$ systemctl start httpd

[root@vm4 ~]$ firewall-cmd --permanent --zone=public --add-service=http
success
[root@vm4 ~]$ firewall-cmd --reload
success
现在在IE,firefox上可以打开 http://vm4    的网页了.


2.zabbix 源码安装
[root@vm4 /opt/u1]$ tar -xvf zabbix-3.2.11.tar.gz
[root@vm4 /opt/u1]$ cd zabbix-3.2.11/
[root@vm4 /opt/u1/zabbix-3.2.11]$ ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
会提示
...
configure: error: MySQL library not found

[root@vm4 /opt/u1/zabbix-3.2.11]$ yum install mysql-devel
再次执行./configure命令,提示
configure: error: LIBXML2 library not found

[root@vm4 /opt/u1/zabbix-3.2.11]$ yum install -y libxml2-devel
再次执行./configure命令,提示如下,话说怎么这么多报错呢.
configure: error: Invalid Net-SNMP directory - unable to find net-snmp-config

[root@vm4 /opt/u1/zabbix-3.2.11]$ yum install -y net-snmp-devel
再次执行./configure命令,提示
configure: error: Curl library not found

[root@vm4 /opt/u1/zabbix-3.2.11]$ yum install -y curl-devel
执行.configure , 终于成功了

[root@vm4 /opt/u1/zabbix-3.2.11]$ make
[root@vm4 /opt/u1/zabbix-3.2.11]$ make install


3.导入zabbix数据库结构.
[root@vm4 /opt/u1/zabbix-3.2.11/database/mysql]$ cat schema.sql | mysql -uzabbix -pzabbix zabbix
[root@vm4 /opt/u1/zabbix-3.2.11/database/mysql]$ cat images.sql | mysql -uzabbix -pzabbix zabbix
[root@vm4 /opt/u1/zabbix-3.2.11/database/mysql]$ cat data.sql | mysql -uzabbix -pzabbix zabbix

4.配置Zabbix server参数
[root@vm4 ~]$ more /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000

5.修改zabbix_agentd.conf
[root@vm4 /usr/local/zabbix/etc]$ more zabbix_agentd.conf
LogFile=/tmp/zabbix_agentd.log
Server=127.0.0.1                    ##agent端的ip
ServerActive=127.0.0.1
Hostname=vm4                        ##安装了zabbix的hostname

[root@vm4 /usr/local/zabbix/etc]$ /usr/local/zabbix/sbin/zabbix_agentd
zabbix_agentd [27401]: user zabbix does not exist
zabbix_agentd [27401]: cannot run as root!
[root@vm4 /usr/local/zabbix/etc]$
[root@vm4 /usr/local/zabbix/etc]$ useradd zabbix
[root@vm4 /usr/local/zabbix/etc]$ /usr/local/zabbix/sbin/zabbix_agentd


6.修改php设置
vi /etc/php.ini             ->加入如下内容
max_execution_time = 600
max_input_time = 600
memory_limit = 256M
post_max_size = 32M
upload_max_filesize = 16M
date.timezone = Asia/Shanghai
extension=bcmath.so
always_populate_raw_post_data = 1


7、添加Zabbix的PHP文件到Apache
[root@vm4 /opt/u1/zabbix-3.2.11]$ cp -r ./frontends/php/ /var/www/html/zabbix
[root@vm4 /opt/u1/zabbix-3.2.11]$ systemctl restart httpd


8.通过IE打开zabbix,配置zabbix
http://192.168.32.10/zabbix/setup.php             -->vm4 的ip是192.168.32.10

[root@vm4 ~]$ yum install php-xml
页面next时,一直报错.

=======默认安装的php是5.4的版本,需要安装高一点的版本5.6
http://cn2.php.net/distributions/php-5.6.0.tar.xz     ->连接
[root@vm4 /opt/u1]$ tar -xvf php-5.6.0.tar.xz
[root@vm4 /opt/u1]$ cd php-5.6.0/

[root@vm4 /opt/u1/php-5.6.0]$./configure  --prefix=/usr/local/php5.6 --with-apxs2=/usr/bin/apxs --enable-bcmath --enable-Sockets --with-libxml-dir --with-zlib --with-curl --with-gd --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --with-gettext --enable-mbstring --with-mcrypt --with-mysql=/usr --with-pdo-mysql=/usr/bin/mysql_config --with-mysqli=/usr/bin/mysql_config --enable-zip --with-bz2 --enable-soap --with-pear --with-pcre-dir --with-openssl --with-config-file-path=/usr/local/php5.6/etc --enable-shmop --enable-intl
configure: error: Please reinstall the BZip2 distribution
[root@vm4 /opt/u1/php-5.6.0]$ yum install bzip2-devel
再次执行./configure命令.

configure: error: jpeglib.h not found.
[root@vm4 /opt/u1/php-5.6.0]$ yum install libjpeg-devel

configure: error: png.h not found.
[root@vm4 /opt/u1/php-5.6.0]$ yum install libpng-devel

configure: error: freetype-config not found.
[root@vm4 /opt/u1/php-5.6.0]$ yum install freetype-devel

configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.
[root@vm4 /opt/u1/php-5.6.0]$ yum install libicu-devel

configure: error: mcrypt.h not found. Please reinstall libmcrypt.
ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
[root@vm4 /opt/u1]$ tar zxf libmcrypt-2.5.7.tar.gz
[root@vm4 /opt/u1]$ cd libmcrypt-2.5.7
[root@vm4 /opt/u1/libmcrypt-2.5.7]$./configure
[root@vm4 /opt/u1/libmcrypt-2.5.7]$ make && make install

configure: error: Cannot find libmysqlclient under /usr.
[root@vm4 /opt/u1/php-5.6.0]$ ln -s /usr/lib64/mysql/libmysqlclient.so.18.0.0 /usr/lib/libmysqlclient.so
终于成功了.....可以make,make install了.
[root@vm4 /opt/u1/php-5.6.0]$ make && make install


PHP option "always_populate_raw_post_data" must be set to "-1"   类似于这种报错.
[root@vm4 /etc/httpd/conf.d]$ vi php.conf          -->加入如下内容.
php_value date.timezone Asia/Shanghai
php_value max_execution_time 300
php_value post_max_size 16M
php_value always_populate_raw_post_data -1


Unable to create the configuration file.  -->最后一步会出现这种错误.需要在/var/www/html/zabbix/conf   创建zabbix.conf.php文件,并加入如下内容.
zabbix.conf.php  的权限赋予777
<?php
// Zabbix GUI configuration file.
global $DB;

$DB['TYPE']     = 'MYSQL';
$DB['SERVER']   = 'localhost';
$DB['PORT']     = '3306';
$DB['DATABASE'] = 'zabbix';
$DB['USER']     = 'zabbix';
$DB['PASSWORD'] = 'zabbix';

// Schema name. Used for IBM DB2 and postgresql.
$DB['SCHEMA'] = '';

$ZBX_SERVER      = 'localhost';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = 'vm4';

$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;

--结束END--

本文标题: [Linux7] zabbix 3.2.11安装

本文链接: https://www.lsjlt.com/news/246109.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • [Linux7] zabbix 3.2.11安装
    zabbix 3.2.11关闭selinux[root@vm4 ~]$ vi /etc/selinux/config SELINUX=disabled1.安装lamp[root@vm4 ~]$ yum install -y mariadb[...
    99+
    2023-06-06
  • linux7安装oracle 19c rac
    一.准备工作 1.1 系统硬件和软件环境 物理内存: swap:物理内存在4-16GB范围则配置与物理内存相等,物理内存大于16GB则配置为16GB(注意:如果在linux中启动了Huge...
    99+
    2024-04-02
  • linux7系统怎么安装oracle12C R2
    这篇文章主要介绍“linux7系统怎么安装oracle12C R2”,在日常操作中,相信很多人在linux7系统怎么安装oracle12C R2问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,...
    99+
    2024-04-02
  • zabbix 2.0.X安装
    file /sbin/init #查看32/64位机器uname -r#查看linxu版本yum -y install gcc gcc-c++ autoconf httpd php mysql lrzsz ...
    99+
    2024-04-02
  • 如何安装zabbix
    小编给大家分享一下如何安装zabbix,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!Zabbix是一款能够监控各种网络参数以及服务器健康性和完整性的软件。Zabb...
    99+
    2023-06-27
  • Linux7安装和配置phpmyadmin的步骤
    这篇文章主要讲解了“Linux7安装和配置phpmyadmin的步骤”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Linux7安装和配置phpmyadmin的步骤”吧!1.在https://...
    99+
    2023-06-06
  • Zabbix 3.0 安装部署
    zabbix软件包下载zabbix-3.0.1.tar.gzhttp://heanet.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/...
    99+
    2024-04-02
  • zabbix如何安装agent
    这篇文章主要介绍了zabbix如何安装agent,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。创建zabbix用户和组# groupadd zabbix# useradd -...
    99+
    2023-06-05
  • zabbix如何安装php
    这篇文章给大家分享的是有关zabbix如何安装php的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。1,安装php可通过官网进行下(wget http://www.php.net/...
    99+
    2024-04-02
  • centos 6.5安装zabbix 4.4
    本环境,使用单机部署。操作系统:centos 7.5 x64zabbix-server,Mysql,php,nginx都在同一台服务器。都是使用Yum安装的! 官方安装文档:https://www.zabbix.com/downl...
    99+
    2023-01-31
    centos zabbix
  • Debian10安装Zabbix教程
    Debian10安装Zabbix教程 ​ zabbix分为server端和agent端,本文分为两个部分分别讨论其安装方法。对于zabbix的agent端的不同环境也做了详细阐述。 Zabbix-se...
    99+
    2023-09-02
    zabbix php apache
  • linux7安装rac11.2.0.4 安装数据库软件选择不到节点
    解决方式如下: [root@ora02std ContentsXML]# pwd /u01/app/oraInventory/ContentsXML [root@ora02std ContentsXML]#...
    99+
    2024-04-02
  • Cent OS 7.x 安装Zabbix
    系统环境:     VMware Workstation 12 Pro 12.5.0Cent OS 7.3_1611Zabbix 3.2---以下操作均以root身份操作---1:设置网卡为开机启动Shell>ifconfig1.  ...
    99+
    2023-01-31
    OS Cent Zabbix
  • 如何编译安装zabbix
    这篇文章主要为大家展示了“如何编译安装zabbix”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“如何编译安装zabbix”这篇文章吧。1.下载资源下载安装包(自行去网上搜索)获取包zabbix-...
    99+
    2023-06-04
  • Zabbix怎么安装配置
    今天小编给大家分享一下Zabbix怎么安装配置的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。Zabbix是一款能够监控各种网...
    99+
    2023-06-27
  • Zabbix的详细安装部署
    目录 1.架构 2.安装  1)所有机器关闭防火墙和selinux  2)准备两台机器,一台用做server,一台用做agent,mysql部署在server端的机器上。  3)在10.8.156.38 安装zabbix的存储库  4)安装...
    99+
    2023-08-31
    zabbix 数据库 服务器 linux
  • linux7静默安装11GR2 RAC的方法是什么
    这篇文章主要介绍“linux7静默安装11GR2 RAC的方法是什么”,在日常操作中,相信很多人在linux7静默安装11GR2 RAC的方法是什么问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方...
    99+
    2024-04-02
  • 【Oracle】Linux7安装11g Error in invoking target 'agent nmhs' of makefile
    【Oracle】Linux7安装11g 86%报错:Error in invoking target 'agent nmhs' of makefile ...
    99+
    2024-04-02
  • Linux下zabbix的安装步骤
    如果你需要安装zabbix的机器可以联网,那么你可以按照我下方的步骤来安装配置zabbix所需的环境。众所周知,在Linux下安装zabbix,所需的底层环境是LAMP=linux+apache+mysql...
    99+
    2024-04-02
  • CentOS 7.3安装Zabbix 3.2.6记录
    1. 安装zabbix准备本文采用操作系统:CentOS7.3 x64   需要epel源    wget https://mirrors.tuna.tsinghua.edu....
    99+
    2024-04-02
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作