一、zabbix安装
配置添加zabbix的yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
清除缓存
yum clean all
创建缓存
yum makecache
安装zabbix初始化mysql、zabbix数据库
yum -y install zabbix-server-mysql zabbix-web-mysql mariadb-server zabbix-agent
启动mariadb
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by '123456';
zcat /usr/share/doc/zabbix-server-mysql-4.0.6/create.sql.gz|mysql -uzabbix -p123456 zabbix
配置zabbix
vim /etc/httpd/conf.d/zabbix.conf
修改时间
php_value date.timezone Asia/Shanghai
启动httpd并设置为开机自启
systemctl start httpd
systemctl enable httpd
修改zabbix_server密码
vim /etc/zabbix/zabbix_server.conf
DBPassword=123456
启动zabbix-server并设置为开机自启
systemctl start zabbix-server
systemctl enable zabbix-server
添加server_agent配置文件server的ip
vim /etc/zabbix/zabbix_agentd.conf
Server=zabbix_server的ip
启动zabbix-agent并设置为开机自启
systemctl start zabbix-agent
systemctl enable zabbix-agent
访问zabbix页面 ip/zabbix
修改zabbix server 的ip地址
zabbix+grafana监控_第1张图片
二、安装配置Grafana
下载安装包
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.2.0-1.x86_64.rpm
安装编译环境
yum install initscripts fontconfig
解压安装grafana
rpm -ivh grafana-4.2.0-1.x86_64.rpm
启动并设置为开机自启
systemctl start grafana-server.service
systemctl enable grafana-server.service
访问grafana
(用户名和密码都是admin)
zabbix+grafana监控_第2张图片
安装插件
zabbix+grafana监控_第3张图片
安装grafana-cli
grafana-cli plugins install alexanderzobnin-zabbix-app
重启grafana_server
systemctl restart grafana-server
连接zabbix,写上zabbix的ip
zabbix+grafana监控_第4张图片
添加用户名、密码、版本
zabbix+grafana监控_第5张图片
创建仪表盘
zabbix+grafana监控_第6张图片
监控
zabbix+grafana监控_第7张图片