zabbix 5.0标准安装

本文详细介绍了在CentOS 7环境下,如何关闭防火墙与Selinux,安装Zabbix 5.0及其依赖,包括LAMP架构,启用RedHat软件集合,配置Zabbix Server和Agent,安装Mysql数据库并设置安全。接着,通过Yum安装Grafana稳定版,并配置Zabbix插件以实现可视化监控。最后,提供了设置Zabbix前端语言为中文的步骤,以及Grafana的安装与基础设置。
摘要由CSDN通过智能技术生成

系统环境

系统环境:CentOS-7-x86_64-Minimal-1708

关闭防火墙与selinux

关闭防火墙

systemctl stop firewalld && systemctl disable firewalld

关闭selinux

 sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

然后重启reboot

替换阿里云Zabbix源

shell脚本zabbix_aliyun.sh

vi zabbix_aliyun.sh

复制下面脚本

#!/bin/bash

echo -e "请给出要安装的zabbix版本号,建议使用4.x的版本  \033[31musage:./zabbix_aliyun.sh 4.0|4.4|4.5|5.0 \033[0m"

echo "例如要安装4.4版本,在命令行写上 ./zabbix_aliyun.sh 4.4"

if [ -z $1 ];then

    exit

fi

VERSION=$1

if [ -f /etc/yum.repos.d/zabbix.repo ];then

    rm -rf /etc/repos.d/zabbix.repo

fi

rpm -qa | grep zabbix-release && rpm -e zabbix-release

rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/$VERSION/rhel/7/x86_64/zabbix-release-$VERSION-1.el7.noarch.rpm

sed -i "s@zabbix/.*/rhel@zabbix/$VERSION/rhel@g" /etc/yum.repos.d/zabbix.repo

sed -i 's@repo.zabbix.com@mirrors.aliyun.com/zabbix@g' /etc/yum.repos.d/zabbix.repo

[ $? -eq 0 ] && echo "阿里云的zabbix源替换成功" || exit 1

yum clean all

yum makecache fast

然后执行命令:

bash zabbix_aliyun.sh 5.0

https://i-blog.csdnimg.cn/blog_migrate/80f54042cac02498d399c48b6a8033fd.png

由于zabbix提供集中的web监控管理界面,因此服务在web界面的呈现需要LAMP架构支持。安装httpd php

yum install -y httpd  php php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mhash

安装常用的开发软件

yum groups install "Development Tools"

查看工具包

yum groups info "Development Tools"

安装zabbix5.0仓库

wget  --no-check-certificate https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm

rpm -ivh zabbix-release-5.0-1.el7.noarch.rpm

yum clean all

https://i-blog.csdnimg.cn/blog_migrate/d1364eb45999be518950fa48e26858f6.png

安装zabbix server 和agent

yum install zabbix-server-mysql zabbix-agent -y

https://i-blog.csdnimg.cn/blog_migrate/abb56bf1fc817b3e5cd77220fc123df8.png

启用Red Hat软件集合

SCL(Software Collections)可以让你在同一个操作系统上安装和使用多个版本的软件,而不会影响整个系统的安装包。

yum install centos-release-scl -y

 https://i-blog.csdnimg.cn/blog_migrate/9df4105c48576a2d2fc9997216116019.png

启用zabbix-deprecated repository

vi /etc/yum.repos.d/zabbix.repo  [zabbix-frontend] enabled=1

安装zabbix前端

yum install -y zabbix-web-mysql-scl zabbix-apache-conf-scl

安装mysql数据库

yum -y install mariadb-server mariadb

https://i-blog.csdnimg.cn/blog_migrate/b86c11882db961f37c2f413e555c2f9d.png

启动mariadb

systemctl start mariadb&&systemctl enable mariadb

启动mysql后执行初始化安全设置

 #设置mysql密码为123456

mysqladmin -u root password "123456"   

创建数据库

#进入mysql

mysql -uroot -p                        #输入密码123456

#创建数据库,格式为utf8

create database zabbix character set utf8 collate utf8_bin;

#创建用户

create user zabbix@localhost identified by 'password';          #密码是password,导入Zabbix数据库结构和数据输入这个密码

#给zabbix用户权限

grant all privileges on zabbix.* to zabbix@localhost;

#退出

quit;                                                          

https://i-blog.csdnimg.cn/blog_migrate/ccbcd8f3ff3ee8a14cb028f6c96d5977.png

在Zabbix服务器主机上,导入初始架构和数据。系统将提示您输入新创建的密码

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix                 #回车密码是password

为zabbix服务器配置数据库

vi /etc/zabbix/zabbix_server.conf

DBPassword=password

为Zabbix前端配置PHP

编辑文件/etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf,取消注释并为您设置正确的时区。

#进入zabbix配置

vi /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf

#找到这行配置地区

php_value[date.timezone] = Asia/Shanghai

直接使用IP地址访问

 vim /etc/httpd/conf/httpd.conf

 操作步骤:

1、修改httpd.conf配置

vi /etc/httpd/conf/httpd.conf

2、找到DocumentRoot那一行,将其注释掉,新增一行指向zabbix。

#DocumentRoot "/var/www/html"

DocumentRoot "/usr/share/zabbix"

3、重启服务

systemctl restart httpd

systemctl restart zabbix-server

启动zabbix服务

systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm&&systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm

配置Zabbix Web前端

浏览器输入http://ip/zabbix,Zabbix

初始用户名:Admin,初始密码为:zabbix

点next step下一步

配置mysql数据库账号和密码, 输入zabbix帐户的密码,点next step下一步

Name那里起一个名, 点next step下一步

至此zabbix前端配置完成

输入账号Admin密码zabbix

进入zabbix页面

 后续配置zabbix页面语言为中文

1.Zabbix前端界面设置成中文

选择User settings,语言选择中文,点击update

就修改成功了,同时zabbix也就部署完成了。

grafana稳定版_grafana的安装与设置

初酿乖乖

于 2021-01-26 23:56:58 发布

900

 收藏 1

文章标签: grafana稳定版

版权

zabbix3.4.9和grafana5.1.3的整合

本次介绍两种安装方法,其他的方法请查看官方文档:

第一种:直接rpm下载安装稳定版

sudo yum install https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.3-1.x86_64.rpm

第二种:可以安装到最新稳定版(CentOS7)

$ wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.1.3-1.x86_64.rpm

$ sudo yum install initscripts fontconfig

$ sudo rpm-Uvh grafana-5.1.3-1.x86_64.rpm

2、安装服务端图像呈现组件

yum install fontconfig

yum install freetype*yum install urw-fonts

3、启动服务

systemctl daemon-reload

systemctl start grafana-server

systemctl status grafana-server

systemctl enable grafana-server.service

或/etc/init.d/grafana-server start

方式启动服务

安装信息

安装二进制文件 /usr/sbin/grafana-server

init.d脚本/etc/init.d/grafana-server

默认文件(环境变量)/etc/sysconfig/grafana-server

配置文件/etc/grafana/grafana.ini

systemd服务(如果systemd可用)名称 grafana-server.service

默认配置使用一个日志文件/var/log/grafana/grafana.log

默认配置指定一个sqlite3数据库/var/lib/grafana/grafana.db

4、结果测试:

地址:http://ServerIP:3000(默认端口)        默认登录用户名密码:admin/admin

https://i-blog.csdnimg.cn/blog_migrate/9c11238d34d6c55df9e064c25499d655.png

基本设置:

1、结合zabbix实现可视化图形监控

1.1、获取可用插件列表

grafana-cli plugins list-remote

[root@zabbix-server ~]#grafana-cli plugins list-remote

id: abhisant-druid-datasource version: 0.0.5id: alexanderzobnin-zabbix-app version: 3.9.1id: ayoungprogrammer-finance-datasource version: 1.0.0id: belugacdn-app version: 1.2.0id: bessler-pictureit-panel version: 1.0.0id: blackmirror1-singlestat-math-panel version: 1.0.0id: blackmirror1-statusbygroup-panel version: 1.1.1id: bosun-app version: 0.0.28id: briangann-datatable-panel version: 0.0.6id: briangann-gauge-panel version: 0.0.6id: btplc-alarm-box-panel version: 1.0.6id: btplc-peak-report-panel version: 0.2.3id: btplc-status-dot-panel version: 0.2.3id: btplc-trend-box-panel version: 0.1.8id: camptocamp-prometheus-alertmanager-datasource version: 0.0.5......

1.2、安装grafana-zabbix、grafana-clock-panel插件

grafana-cli plugins install alexanderzobnin-zabbix-app

grafana-cli plugins install grafana-clock-panel

1.3、重启grafana服务

/etc/init.d/grafana-server restart

2、网站管理控制台启用zabbix插件

https://i-blog.csdnimg.cn/blog_migrate/569ba8f8f8e81e06fdcc5d3d924aece2.png

2.1、设置源数据

https://i-blog.csdnimg.cn/blog_migrate/26bdde62a717c715f1975d5ebde5489a.png

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

IT摆渡者

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值