A custom chart, integration Grafana :
1, self- defined chart:
(1) create a chart:
Configuration --> Hosts --> Graphs --> Create graph --> Add
(2) view the chart:
Monitoring --> Graphs --> Host --> Graph
2, of ZABBIX Server integration Grafana :
(1) Grafana Description:
Grafana is a visual panel has a very nice graphics and layout display, full-featured metrics dashboards and graphics editor that supports Graphite , of ZABBIX , InfluxDB , Prometheus , OpenTSDB , elasticsearch etc. as a data source, optimized to show the graphic, you can used for large-screen monitor, function is more flexible and powerful, has a wealth of plug-ins, support for user authentication, but Grafana itself does not store data.
(2)zabbix-server节点安装Grafana:
# vim /etc/yum.repos.d/grafana.repo
[tsinghua-grafana]
name=tsinghua grafana
baseurl=https://mirrors.tuna.tsinghua.edu.cn/grafana/yum/rpm/
enabled=1
gpgcheck=0
# yum -y install grafana
备注:安装的grafana版本为6.4.4
# rpm -ql grafana | less
配置文件目录:/etc/grafana
配置文件:/etc/grafana/grafana.ini,修改如下参数
a、;http_addr = --> http_addr = 192.168.0.120
b、如果使用默认的3000端口,则不必修改:;http_port = 3000
日志文件:/var/log/grafana/grafana.log
sqlite3数据库文件:/var/lib/grafana/grafana.db
备注:参考文档https://grafana.com/docs/installation/rpm/
(3)启动Grafana:
# systemctl start grafana-server
# systemctl status grafana-server
# ps aux | grep grafana-server
# ss -tunlp | grep -w 3000
# tail -100 /var/log/grafana/grafana.log
# grafana-server -v
# grafana-server -h
(4)配置开机自启:
# systemctl daemon-reload
# systemctl enable grafana-server
(5)浏览器中访问http://192.168.0.120:3000,默认用户名密码均为admin
新密码root@123
(6)Grafana安装启用Zabbix插件:
数据源中默认没有Zabbix:Add data source
# grafana-cli -v
# grafana-cli -h
显示Grafana所有可用插件:
# grafana-cli plugins list-remote
# grafana-cli plugins list-remote | grep -i zabbix
安装Zabbix插件(以下方法二选一):
a、执行命令# grafana-cli plugins install alexanderzobnin-zabbix-app,可能由于网络原因比较慢
b、下载插件https://grafana.com/api/plugins/alexanderzobnin-zabbix-app/versions/3.10.4/download,alexanderzobnin-grafana-zabbix-v3.10.4-1-g29a98f5.zip,上传至/var/lib/grafana/plugins目录,然后unzip解压
重启Grafana:# systemctl restart grafana-server
Grafana启用Zabbix插件:
Configuration --> Plugins --> Zabbix --> Enable
数据源中多了Zabbix:
(7)配置Zabbix数据源:
URL:http://192.168.0.120/zabbix/api_jsonrpc.php,Zabbix Server的IP
Zabbix API details中配置Zabbix Web的用户名Admin和密码root@123,Zabbix version选择4.x:
(8)导入仪表盘:
(9)查看默认图表:
(10)修改默认的System load面板,新增1分钟和5分钟的CPU负载:
保存修改:
(11)自定义面板:
安装支持饼图的插件:
# grafana-cli plugins list-remote | grep pie
# grafana-cli plugins install grafana-piechart-panel
# systemctl restart grafana-server
刷新页面:Configuration --> Plugins
该插件安装后默认已启用
修改标题后保存:
(12)设置数据最近显示的时间段和网页自动刷新时间间隔:
(13) Grafana add Zabbix warning:
Stop node-122 on vsftpd trigger an alarm:
(14) Grafana variables:
(15) Grafana big-screen mode:
Press Esc to exit
Note: Chrome browser press F11 to enter full-screen mode