centos7下zabbix的安装

 

下载zabbix软件

官方地址:http://www.zabbix.com/download

我下载好了存到了CSDN:http://download.csdn.net/detail/ssrmygod/9815155

 

配置本地源

[root@mygod media]# tar -zxvf zabbix.tar.gz zabbix

[root@mygod media]# ls
zabbix  zabbix.tar.gz

 

[root@mygod ~]# cd /etc/yum.repos.d/
[root@mygod yum.repos.d]# ls
CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo    CentOS-Vault.repo
CentOS-CR.repo    CentOS-fasttrack.repo  CentOS-Sources.repo
[root@mygod yum.repos.d]# rm -rf *
[root@mygod yum.repos.d]# ls
[root@mygod yum.repos.d]# vi mygod.repo
[root@mygod yum.repos.d]# cat mygod.repo
[mygod]
name=mygod
baseurl=file:///media/zabbix
gpgcheck=0
enabled=1
[root@mygod yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: mygod
Cleaning up everything
[root@mygod yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, langpacks
mygod                                                                       | 2.9 kB  00:00:00     
mygod/primary_db                                                            |  44 kB  00:00:00     
Determining fastest mirrors
repo id                                        repo name                                     status
mygod                                          mygod                                         50
repolist: 50
[root@mygod yum.repos.d]# 

 

安装相关的包

[root@mygod ~]# yum -y install  zabbix-agent zabbix-server-mysql zabbix-web-mysql mariadb-server
 
 

关闭selinux和防火墙

 
[root@mygod ~]# vi /etc/selinux/config 
[root@mygod ~]# cat /etc/selinux/config


# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 


[root@mygod ~]# systemctl stop firewalld
[root@mygod ~]# systemctl disable firewalld
[root@mygod ~]# reboot
 
 

配置数据库

启动mariadb
[root@mygod ~]# systemctl start mariadb.service 
[root@mygod ~]# systemctl enable mariadb.service 
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
[root@mygod ~]# 
 
配置密码
[root@mygod ~]# 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] y
New password: 
Re-enter new password: 
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] 
 ... 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] 
 ... 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] 
 - 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] 
 ... 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!
[root@mygod ~]# 
 
新建数据库
[root@mygod ~]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
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 database zabbixdb character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)


MariaDB [(none)]> grant all privileges on zabbixdb.* to zabbixuser@localhost identified by 'redhat';
Query OK, 0 rows affected (0.00 sec)


MariaDB [(none)]> quit;
Bye
[root@mygod ~]# 
 
导入zabbix数据库表
[root@mygod ~]# zcat /usr/share/doc/zabbix-server-mysql-3.0.*/create.sql.gz | mysql -u zabbixuser -p zabbixdb
Enter password: redhat
[root@mygod ~]# ls /usr/share/doc/zabbix-server-mysql-3.0.*/create.sql.gz
/usr/share/doc/zabbix-server-mysql-3.0.7/create.sql.gz
[root@mygod ~]# 

 

配置zabbix

修改Zabbix 服务端配置

[root@mygod ~]# vi /etc/zabbix/zabbix_server.conf 

确保配置正确

DBHost=localhost
DBName=zabbixdb
DBUser=zabbixuser
DBPassword=redhat

 

 

修改PHP配置

[root@mygod ~]# vi /etc/httpd/conf.d/zabbix.conf
[root@mygod ~]# cat /etc/httpd/conf.d/zabbix.conf
确保时区配置
php_value date.timezone Asia/Shanghai

 

开启http、zabbix服务端和客户端

[root@mygod ~]# systemctl start httpd zabbix-server zabbix-agent
[root@mygod ~]# systemctl enable httpd zabbix-server zabbix-agent
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.
[root@mygod ~]# 

 

WEB界面配置zabbix

 
设置支持中文

下载中文字体:http://download.csdn.net/detail/ssrmygod/9815183

[root@mygod ~]# ls /usr/share/zabbix/fonts/
graphfont.ttf
[root@mygod ~]# 

 

默认账户密码Admin  zabbix

 

设置中文显示

 

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值