Custom graphics and grafana plotting
Don't panic when there are garbled Chinese characters!
Modify the file on zabbix-server (/html is the code directory displayed by my zabbix-web) (SIMHEI.TTF is the font path that comes with the system: C:\Windows\Fonts, pay attention to looking for Chinese fonts)
cd /html/assets/fonts/
#上传中文字体
[root@zabbix-server fonts]# ls
DejaVuSans.ttf SIMHEI.TTF
mv SIMHEI.TTF DejaVuSans.ttf
Show after success
Custom graphics
Use grafana to graph zabbix
Install grafana (install on both zabbix-server and zabbix-agent)
wget https://mirrors.tuna.tsinghua.edu.cn/grafana/yum/rpm/grafana-7.3.7-1.x86_64.rpm
yum localinstall grafana-7.3.7-1.x86_64.rpm -y
systemctl start grafana-server.service
systemctl enable grafana-server.service
#访问grafana
http://10.0.0.8:3000
默认账号密码:admin/admin
The concept of grafana
a:插件,丰富原有功能plugin
b:数据源 datasource
c:dashboard 效果图
It's useless to see grafana with light! We want to see the picture of zabbix
Install zabbix plugin
grafana-cli plugins install alexanderzobnin-zabbix-app4.1.2
service grafana-server restart
New zabbix data source
effect
Import dashboard
After the completion of the display interface B grid is very high
Custom monitoring template
Template: Defined, some monitoring items, application sets, triggers, graphics and other resources.
Templates can contain sub-templates.
Templates can be imported and exported, and can be shared.
Custom template
#开启nginx监控页面 /etc/nginx/nginx.conf
location = /nginx_status {
stub_status;
access_log off;
}
#测试
[root@web01 ~]# curl http://127.0.0.1/nginx_status
Active connections: 1
server accepts handled requests
7 7 7
Reading: 0 Writing: 1 Waiting: 0
#自定义监控项
[root@web01 zabbix_agent2.d]# cat zbx_nginx.conf
UserParameter=nginx_status,netstat -lntp|grep -c nginx
UserParameter=nginx_accepts,curl http://127.0.0.1/nginx_status 2>/dev/null|awk 'NR==3{print $1}'
UserParameter=nginx_active_con,curl http://127.0.0.1/nginx_status 2>/dev/null|awk 'NR==1{print $NF}'
UserParameter=nginx_Reading,curl http://127.0.0.1/nginx_status 2>/dev/null|awk 'NR==4{print $2}'
UserParameter=nginx_Writing,curl http://127.0.0.1/nginx_status 2>/dev/null|awk 'NR==4{print $4}'
UserParameter=nginx_Waiting,curl http://127.0.0.1/nginx_status 2>/dev/null|awk 'NR==4{print $NF}'
First create a monitoring item and check whether there is data
Make a template
Add monitoring item
Precautions for using the template: #Open
monitoring page
#Import template (compatibility) #Put
the value configuration file of
zabbix into the specified directory /etc/zabbix/zabbix_agentd.d/ #If
there is a value script, you need to get it The value is also placed in the corresponding directory
#zabbix-getDebug取值#link the
newly imported template on the target host
#Verify, view the latest data