前提要求(optional)

安装Zabbix监控工具前,先安装必要的执行工具包

yum install gcc gcc-c++ make openssl-devel curl wget net-snmp net-snmp-utils net-snmp-libs net-snmp-devel gnutls gnutls-devel libxml2 libxml2-devel

安装httpd

yum install httpd -y
#启动apache
systemctl start httpd

浏览你的安装主机http://{httpd_ip}/

Install MariaDB

yum install -y mariadb-server mariadb 

启动MariaDB。即MySQL服务。

systemctl start mariadb

设在MySQL的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] y ## Enter Y and press Enter
New password: ## Enter new password
Re-enter new password: ## Enter password again
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 ## Enter Y and press Enter
... 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 ## Enter Y and press Enter
... 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 ## Enter Y and press Enter
- 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 ## Enter Y and press Enter
... 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!

安装PHP

安装php命令:

#最简单方法,假设想了解php构建过程。推荐手工打包安装
yum install -y php php-mysql php-gd php-pear

測试是否成功安装:

    vi /var/www/html/testphp.php

<?php
phpinfo();
? >

浏览php測试文件

http://{httpd_ip}/testphp.php

设置php配置属性:

post_max_size = 16M

max_execution_time = 300

max_input_time = 300

date.timezone = Asia/Shanghai

always_populate_raw_post_data = -1

详细的时区,能够參考 日期时区

安装Zabbix

#Configure the ZabbixZone package repository
rpm --import http://repo.zabbix.com/RPM-GPG-KEY-ZABBIX
rpm -Uv http://repo.zabbix.com/zabbix/2.4/rhel/7/x86_64/zabbix-release-2.4-1.el7.noarch.rpm #Install the necessary server packages
yum install mysql-server zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-java-gateway

设置zabbix

vi /etc/httpd/conf.d/zabbix.conf
#设置zabbix的时区
php_value date.timezone **Asia/Shanghai** systemctl restart httpd

创建MySQL的Zabbix数据已经导入数据库结构与数据

mysql -u root -p
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.41-MariaDB MariaDB Server
Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database zabbix character set utf8;
Query OK, 1 row affected (0.05 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'password';
Query OK, 0 rows affected (0.21 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit
Bye

导入数据

#download zabbix source code
wget http://sourceforge.net/projects/zabbix/files/ZABBIX\ Latest\ \Stable/2.4.5/zabbix-2.4.5.tar.gz #
tar xvf zabbix-2.4.5.tar.gz
cd zabbix-2.4.5
#导入数据
mysql -u zabbix -p zabbix < database/mysql/schema.sql
mysql -u zabbix -p zabbix < database/mysql/images.sql
mysql -u zabbix -p zabbix < database/mysql/data.sql

启动Zabbix

#If you use SELinux, run the following command to allow #Apache to communicate with Zabbix.
setsebool -P httpd_can_connect_zabbix=1 systemctl start zabbix-server
systemctl start zabbix-agent
systemctl restart httpd
systemctl restart mariadb

加入zabbix用户为Apache的www-data的系统用户组

# set the user
usermod -aG apache zabbix cd /opt/zabbix-2.4.5
#setup the zabbix frontend php files
cp -rf frontends/php/* /var/www/html/
# restart apache
systemctl restart httpd.service

在浏览器上,设置Zabbix。

下载相应的文件或者改动相应文件夹下的模板文件。

登陆zabbix

NOTES: 设置系统默认启动:

systemctl enable httpd
systemctl enable mariadb
systemctl enable zabbix-server
systemctl enable zabbix-agent

欢迎加入我的微信公众号

CentOS 7上安装Zabbix(高速安装监控工具Zabbix)的更多相关文章

  1. 在CentOS 7上使用Yum源安装和卸载 MongoDB 3.4

    在CentOS 7上使用Yum源安装和卸载 MongoDB 3.4 1.配置Yum源 vim /etc/yum.repos.d/mongodb-org-3.4.repo [mongodb-org-3. ...

  2. CentOS 7上源码编译安装和配置LNMP Web+phpMyAdmin服务器环境

    CentOS 7上源码编译安装和配置LNMP Web+phpMyAdmin服务器环境 什么是LNMP? LNMP(别名LEMP)是指由Linux, Nginx, MySQL/MariaDB, PHP/ ...

  3. CentOS 5 上使用yum同时安装32位和64位包的解决方法

    在centos上使用yum在线安装软件包的时候,有时候会同时安装32位和64位的包.并且在update的时候也会更新双份. 其实让yum只安装64位的包,只要在 /etc/yum.conf 中加个 e ...

  4. 如何在CentOS 7上安装Percona服务器

    在这篇文章中我们将了解关于 Percona 服务器,一个开源的MySQL,MariaDB的替代品.InnoDB的数据库引擎使得Percona 服务器非常有吸引力,如果你需要的高性能,高可靠性和高性价比 ...

  5. Linux Centos 系统上安装BT客户端 Transmission

    Linux Centos 系统上安装BT客户端 Transmission   Transmission是一种BitTorrent客户端,特点是一个跨平台的后端和其上的简洁的用户界面,以MIT许可证和G ...

  6. 如何在 CentOS 7 上安装 Percona Server

    在这篇文章中我们将了解关于 Percona 服务器,一个开源的MySQL,MariaDB的替代品.InnoDB的数据库引擎使得Percona 服务器非常有吸引力,如果你需要的高性能,高可靠性和高性价比 ...

  7. 【zabbix教程系列】三、zabbix 3.4 在centos 7 上安装详细步骤

    一.环境准备 [root@ltt01 ~]# ip a : lo: <LOOPBACK,UP,LOWER_UP> mtu qdisc noqueue state UNKNOWN qlen ...

  8. centos 7 上zabbix 3.0 服务端安装

    zabbix服务端安装 安装完毕mysql-5.6.php5.6 mysql-5.6安装:https://www.cnblogs.com/xzlive/p/9771642.html  创建zabbix ...

  9. CentOS 7上的程序管理:rpm、yum和源码编译安装

    简介 在Linux的早期时代(也许吧?我猜的.也可能是Unix.),想要在系统上安装一款应用程序,是比较复杂的.需要专业的人员自行获取程序的源代码,并且编译安装,这是非常的复杂且需要一定的专业功底的, ...

  10. zabbix服务器性能监控工具的安装二

    上一篇完成了lnmp的安装,本篇则可以继续完成zabbix的安装 目录 1.下载 2.安装 1.下载 下载链接:http://jaist.dl.sourceforge.net/project/zabb ...

随机推荐

  1. js处理富文本编辑器转义、去除转义、去除HTML标签

    富文本编辑器生成的HTML标签,进行转义,然后写入数据库,防止脚本注入: function htmlEncode(value){ return $('<div/>').text(value ...

  2. python os用法精简版

    import os print(os.getcwd()) #返回当前路径,无参数 print(os.listdir('E:\zsfile')) #该路径下所有文件名 os.remove('E:\zsf ...

  3. D - Interesting Calculator 【数值型BFS+优先队列】

    There is an interesting calculator. It has 3 rows of buttons. Row 1: button 0, 1, 2, 3, ..., 9. Pres ...

  4. 链表学习二:链表反转与查找倒数第K个

    //单链表反转 ListNode* RevertList(ListNode* m_pHead){ ListNode* pCurrent = m_pHead; ListNode* pPrev=NULL; ...

  5. 洛谷—— P1775 古代人的难题_NOI导刊2010提高(02)

    P1775 古代人的难题_NOI导刊2010提高(02) 题目描述 门打开了,里面果然是个很大的厅堂.但可惜厅堂内除了中央的一张羊皮纸和一支精致的石笔,周围几具骷髅外什么也没有.难道这就是王室的遗产? ...

  6. [BZOJ 1912] patrol 巡逻

    Link:https://www.lydsy.com/JudgeOnline/problem.php?id=1912 Algorithm: K=0:res=(n-1)*2   每条边恰好走2遍 K=1 ...

  7. [Contest20180116]随机游走

    题意:给一棵树,多次询问$a$到$b$期望步数,每一步都是随机的 对期望DP了解更深入了一些 先预处理$up_x$表示从$x$走到$fa_x$的期望步数 可以直接往上走,也可以先去儿子再回来,设$x$ ...

  8. 【线性基】【贪心】【独立环】bzoj2115 [Wc2011] Xor

    网上到处都是题解,自己画个图也很好理解.虽然环的个数很多,但是都可以通过独立环之间异或出来,不用管. 独立环求法:生成树之后,每次向图里添加非树边(u,v),则这个独立环的异或和为sum[u]^sum ...

  9. 10.1(java学习笔记)JDBC基本操作(连接,执行SQL语句,获取结果集)

    一.JDBC JDBC的全称是java database connection java数据库连接. 在java中需要对数据库进行一系列的操作,这时就需要使用JDBC. sun公司制定了关于数据库操作 ...

  10. TZOJ 5396: 集五福过大年

    描述 又是一年春来到,伴随着春节,支付宝的“集五福”活动又开始了,五福分别是“爱国福”.“富强福”.“和谐福”.“友善福”和“敬业福”,五张不同的福卡可以合成一张“五福到”,crq也扫了不少福,这么多 ...