Zabbix結合Grafana 監控
一,安裝zabbix-release包,關閉防火墻;
rpm -ivh zabbix-release-3.4-2.el7.noarch.rpm
systemctl stop firewalld
setenforce 0
二,安裝zabbix環境;
yum -y install zabbix-web-mysql zabbix-agent zabbix-server-mysql mariadb-server
三,啟動mysql,進入msyql,創建zabbix庫,和用戶以及密碼;
systemctl restart mariadb
systemctl enable mariadb
Mysql
create database zabbix charset utf8;
grant all on zabbix.* to [email protected]‘localhost‘ identified by ‘123456‘;
flush privileges;
exit;
四,建立zabbix和數據庫的連接;
zcat /usr/share/doc/zabbix-server-mysql-3.4.15/create.sql.gz | mysql -uzabbix -p123456 zabbix
五,修改時區,並啟動;
vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
systemctl restart httpd
systemctl enable httpd
六,修改zabbix-server配置文件,並啟動;
vim /etc/zabbix/zabbix_server.conf
DBPassword=123456
systemctl restart zabbix-server
systemctl enable zabbix-server
七,修改zabbix-agent配置文件,並啟動;
vim /etc/zabbix/zabbix_agentd.conf
Server=192.168.40.111
#ServerActive=127.0.0.1 註釋掉
systemctl restart zabbix-agent
systemctl enable zabbix-agent
八,訪問頁面:
九,安裝grafana,並啟動;
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.4.3-1.x86_64.rpm
rpm -ivh grafana-4.4.3-1.x86_64.rpm
報錯
解決
yum install -y urw-fonts
再次安裝啟動
rpm -ivh grafana-4.4.3-1.x86_64.rpm
十,測試訪問頁面是否成功:
十一,登錄grafana 用戶:admin,密碼:admin,下載zabbix插件
grafana-cli plugins install alexanderzobnin-zabbix-app
在啟動grafana
systemctl restart grafana-server
再次訪問frafana,並設置啟動zabbix
添加數據源
添加信息
進入zabbix頁面:成功監控數據(修改監控IP)
刷新連接數據成功
訪問zabbix數據
至此一個簡單的監控搭建完成!
Zabbix結合Grafana 監控