Centos7下安装部署Zabbix3.4

主要参考官方文档:

https://www.zabbix.com/documentation/3.4/zh/manual/installation/install_from_packages

一、系统基本配置

1.配置IP地址

1)编辑 /etc/sysconfig/network-scripts/ifcfg-eth0文档,修改成如下内容:

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=none

IPADDR=172.17.100.211

NETMASK=255.255.255.0

GATEWAY=172.17.100.1

DNS1=202.106.0.20

DNS2=8.8.8.8

2)重启网络服务

# systemctl restart network.service

3)验证

# ifconfig -a   或 ip a

2.更改主机名称

hostnamectl set-hostname  zabbix

备注:

也可以使用nmtui命令修改网络IP地址和主机名称

3.配置允许root账号远程登录

1)编辑/etc/ssh/sshd_config文档,修改成如下内容:

PermitRootLogin yes

2)重启ssh服务

# systemctl restart sshd.service

4.关闭IPV6

1)修改/etc/sysctl.conf配置文件

# sed -i '$a net.ipv6.conf.all.disable_ipv6 =1\nnet.ipv6.conf.default.disable_ipv6 =1' /etc/sysctl.conf

2)执行下面的命令来使设置生效。

# sysctl -p

5.关闭防火墙

1)使用下列指令关闭防火墙

# systemctl stop firewalld     (关闭防火墙)

# systemctl disable firewalld  (禁止开机启动)

2)查看firewalld 状态

# firewall-cmd --state

not running

6.禁用SElinux(一定要关闭,否则有些功能不能正常使用)

1)修改/etc/selinux/config配置文件

# sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config

2)确认是否修改成功

# cat /etc/selinux/config |grep -v ^# |grep -v ^$

SELINUX=disabled

SELINUXTYPE=targeted

3)重启系统

# reboot

4)重启后,查看SELinux状态

# sestatus

SELinux status:                 disabled

二、安装数据库

1.安装Mariadb数据库(最新版本的linux系统,默认的是 Mariadb。)

# yum install -y mariadb mariadb-server

2.启动mariadb

# systemctl start mariadb

3.设置开机自启动

# systemctl enable mariadb

4.安全初始化,设置root密码等

# mysql_secure_installation

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):       (直接回车)

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB

root user without the proper authorisation.

Set root password? [Y/n] yes

New password:                              (输入:123456)

Re-enter new password:                     (输入:123456)

Password updated successfully!

Reloading privilege tables..

... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] y

... Success!

Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y

... Success!

By default, MariaDB comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] y

- Dropping test database...

... Success!

- Removing privileges on test database...

... Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] y

... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB

installation should now be secure.

Thanks for using MariaDB!

5.测试登录

# mysql -uroot -p123456

三、安装Zabbix

先在网站"http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/"下载“zabbix-release-3.4-2.el7.noarch.rpm”文件,通过xftp软件先将上传到/root/目录下

1.安装 zabbix

# rpm -ivh zabbix-release-3.4-2.el7.noarch.rpm

2.安装 server和web端,基于mysql数据库

# yum install -y zabbix-server-mysql zabbix-web-mysql

3.初始化 zabbix DB

1)登录数据库

# mysql -uroot -p123456

MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;

MariaDB [(none)]> grant all privileges on zabbix.* to [email protected] identified by '123456';

MariaDB [(none)]> grant all privileges on zabbix.* to [email protected] identified by '123456';

MariaDB [(none)]> quit;

Bye

2)测试zabbix帐号能否正常使用

[[email protected] ~]# mysql -uzabbix -p123456

3)导入数据

# cd /usr/share/doc/zabbix-server-mysql-3.4.5/  (由于安装的版本有可能不一样,需要到/usr/share/doc/下确定)

# zcat create.sql.gz | mysql -uroot -p123456 zabbix

4.修改 Zabbix Server 配置,并启动 Zabbix Server 服务

1)修改配置文件

# vi /etc/zabbix/zabbix_server.conf

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=123456

2)检查zabbix_server.conf配置文件修改结果

# cat /etc/zabbix/zabbix_server.conf |grep -v ^# |grep -v ^$

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

LogFileSize=0

PidFile=/var/run/zabbix/zabbix_server.pid

SocketDir=/var/run/zabbix

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=123456

SNMPTrapperFile=/var/log/snmptrap/snmptrap.log

Timeout=4

AlertScriptsPath=/usr/lib/zabbix/alertscripts

ExternalScripts=/usr/lib/zabbix/externalscripts

LogSlowQueries=3000

3)启动zabbix-server服务

# systemctl start zabbix-server

4)开机自启动zabbix-server服务

# systemctl enable zabbix-server

5)查看zabbix-server运行情况

# systemctl status zabbix-server

四、配置zabbix 管理界面

1.编辑PHP配置

# vi /etc/httpd/conf.d/zabbix.conf

php_value max_execution_time 300

php_value memory_limit 128M

php_value post_max_size 16M

php_value upload_max_filesize 2M

php_value max_input_time 300

php_value always_populate_raw_post_data -1

php_value date.timezone Asia/Shanghai

2.查看修改结果

# cat /etc/httpd/conf.d/zabbix.conf |grep -v ^# |grep -v ^$

Alias /zabbix /usr/share/zabbix

<Directory "/usr/share/zabbix">

Options FollowSymLinks

AllowOverride None

Require all granted

<IfModule mod_php5.c>

php_value max_execution_time 300

php_value memory_limit 128M

php_value post_max_size 16M

php_value upload_max_filesize 2M

php_value max_input_time 300

php_value always_populate_raw_post_data -1

php_value date.timezone Asia/Shanghai

</IfModule>

</Directory>

3.配置开启zh_CN语言显示(默认是开启的)

# vi /usr/share/zabbix/include/locales.inc.php

如果参数是:    'zh_CN' => ['name' => _('Chinese (zh_CN)'),    'display' => false],

需要修改为:    'zh_CN' => ['name' => _('Chinese (zh_CN)'),    'display' => true],

4.启动Apache服务

# systemctl start httpd

5.开机启动Apache服务

# systemctl enable httpd

6.查看Apache服务运行情况

# systemctl status httpd

五、登陆 Zabbix 管理页面,显示Zabbix安装向导。

1.登录管理页面

http://172.17.100.211/zabbix/  (IP:172.17.100.211,需要更换成你自己的IP地址)

2.输入密码:123456

3.zabbix web用户名及密码分别是:Admin/zabbix

原文地址:http://blog.51cto.com/435263/2058228

时间: 2024-10-13 05:10:16

Centos7下安装部署Zabbix3.4的相关文章

一次在CentOS7上安装部署Zabbix3.0版本及快速进行基本配置的实例

Zabbix3.0的安装.部署.配置,必须基于LAMP环境或是是LNMP环境. 关于LAMP环境的简单快速搭建,见博客:http://afterdawn.blog.51cto.com/7503144/1923139 注意:以下步骤都是在LAMP配置之后进行的. 本文不会再对zabbix-server和zabbix-agent理论知识再进行介绍,建议看完http://afterdawn.blog.51cto.com/7503144/1922502再进行zabbix实战. Zabbix3.0对软硬件

centos7下安装部署tensorflow GPU 版本

系统环境:centos7 1. 安装 Python 2.7 # yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc gcc-c++ make # download and extract Python 2.7 su hdfs cd  ~/Downloads curl -O https://www.python.org/ftp/pytho

Centos7下安装部署MXNET

Centos下安装MXNET(类似于Amazon Linux下安装MXNET),参考官方文档http://mxnet.io/get_started/setup.html#prerequisites, 安装步骤如下: ###################################################################### # This script installs MXNet for Python along with all required depende

CentOS7下安装部署LAMP环境

(1)配置概要:  1. 172.16.100.31主机运行httpd+php服务(php为模块工作模式)  配置两台虚拟主机:wordpress个人博客系统.PHPmyadmin远程控制mysql 2.172.16.100.31主机运行mariadb服务(mysql) (2)配置流程:  首先配置172.16.100.31主机:http服务              1.安装程序:[[email protected]'s linux ~]# yum install httpd php php-

ubuntu16.04下安装部署zabbix3.0

查看系统版本:lab_release -a 一. 配置zabbix软件下载源 #  wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-1+trusty_all.deb #  dpkg -i zabbix-release_3.0-1+trusty_all.deb #  apt-get update 二. 安装Server端 需要安装如下组件: apache2 php

CentOS 7下安装部署Zabbix3.4

Zabbix安装: 环境: 系统环境:CentOS 7Zabbix版本:Zabbix 3.4 安装步骤: 关闭防火墙和SELINUXsystemctl stop firewalld && setenforce 0 安装zabbix相关软件包rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm &&\yum i

Centos7下安装及配置Zabbix3.0

说到Zabbix相信很多管理员都使用过,因为zabbix所提供的功能给广大管理员们及时得知自己所管理的服务器的服务状态,当然有很多软件服务(cacti.ngios等)都可以实现zabbix类似的功能,但是对于zabbix的功能相对更强大一点,具体就不细说了,今天我们主要介绍一下,Centos7下安装及配置Zabbix3.0的介绍,具体见下: 在安装服务器的时候我们需要注意一些问题:比如服务器的防火墙.selinux等都会影响到Zabbix的正常通信 环境介绍: OS:Centos7 Servic

Centos7下安装及配置PPTP VPN

说到VPN服务,我们大家都知道,VPN是虚拟专用网络(Virtual Private Network)的缩写,VPN有多种分类方式,包括PPTP.L2TP.IPSec等,本文配置的VPN服务器是采用PPTP协议的,PPTP是在PPP协议基础上开发的一种新的增强型安全协议.当然在windows上和linux上都可以部署服务,我们今天主要介绍一下在Centos7下安装及配置PPTP VPN. 因为PPTP是基于PPP协议基础上的,因此需要系统支持PPP,使用 rpm -qa ppp 检查是否安装了P

CentOS 7安装部署zabbix3.4

一.zabbix安装配置1.zabbix简介基于Web界面的分布式系统监控的企业级开源软件.可以监控各种系统与设备,网络参数,保证服务器设备安全运营:提供灵活的通知机制.1.1. zabbix的逻辑图1.2. zabbix的组件zabbix-server:Zabbix监控端组件,它是一个服务器端组件zabbix-agent:被监控端组件,它是一个客户端组件,它主要是监控由Agent所支持的操作系统(简单说如果你要监控OS,就需要在对应的OS上安装Agent程序),而如果要监控一些其他设备,通常需