- 11. zabbix 图形
- 11.1 解决乱码问题
- 11.2 自定义图形监控
- 11.3 查看自定义图形
- 11.4 使用 grafana 定义图形
- 11.4.1 下载 grafana
- 11.4.2 访问 grafana
- 11.4.3 安装 zabbix 插件
- 11.4.4 创建数据源
- 11.4.5 查看数据源
监测 --> 图形
这两个地方图形对于同一台机器是一样的
11.1 解决乱码问题找到字体配置文件 /usr/share/zabbix/assets/fonts 或者在配置文件中查找字体文件目录 /etc/httpd/conf.d/zabbix.conf
解决方法: 在 Windows 中找到 Windows 的字体,路径 C:WindowsFonts 将字体文件复制到 zabbix 目录下 修改文件名称,或者直接替换,刷新页面即可11.2 自定义图形监控
- 创建图形
配置 --> 主机 --> 图形 --> 创建图形
11.3 查看自定义图形监测 --> 图形
11.4 使用 grafana 定义图形 11.4.1 下载 grafanawget https://mirrors.tuna.tsinghua.edu.cn/grafana/yum/rpm/grafana-8.5.2-1.x86_64.rpm --no-check-certificate grafana-8.5.2-1.x86_64.rpm # yum localinstall 解决本地rpm包的依赖问题 yum localinstall grafana-8.5.2-1.x86_64.rpm -y systemctl start grafana-server.service systemctl enable grafana-server.service11.4.2 访问 grafana
[root@zabbix ~]# netstat -lnatp | grep grafana tcp6 0 0 :::3000 :::* LISTEN 29336/grafana-serve
# 浏览器访问地址 http://192.168.169.129:3000/login username:admin password: admin
提示修改密码,可以修改密码,也可以选择跳过
修改页面样式
11.4.3 安装 zabbix 插件grafana 默认不支持 zabbix 解决方案: 1)安装 zabbix 插件 2)新建 zabbix 数据源 3)导入 dashboard 模板(网上下载) 如下图,默认没有 zabbix 插件,可以使用命令行安装,或者 grafana 官网下载
# 这里使用命令行安装 zabbix 插件 [root@zabbix ~]# grafana-cli -h NAME: Grafana CLI - A new cli application USAGE: grafana-cli [global options] command [command options] [arguments...] VERSION: 8.5.2 AUTHOR: Grafana ProjectCOMMANDS: plugins Manage plugins for grafana admin Grafana admin commands cue Cue validation commands help, h Shows a list of commands or help for one command GLOBAL OPTIONS: --pluginsDir value Path to the Grafana plugin directory (default: "/var/lib/grafana/plugins") [$GF_PLUGIN_DIR] --repo value URL to the plugin repository (default: "https://grafana.com/api/plugins") [$GF_PLUGIN_REPO] --pluginUrl value Full url to the plugin zip file instead of downloading the plugin from grafana.com/api [$GF_PLUGIN_URL] --insecure Skip TLS verification (insecure) (default: false) --debug Enable debug logging (default: false) --configOverrides value Configuration options to override defaults as a string. e.g. cfg:default.paths.log=/dev/null --homepath value Path to Grafana install/home path, defaults to working directory --config value Path to config file --help, -h show help (default: false) --version, -v print the version (default: false) [root@zabbix ~]# grafana-cli plugins -h NAME: Grafana CLI plugins - Manage plugins for grafana USAGE: Grafana CLI plugins command [command options] [arguments...] COMMANDS: install install list-remote list remote available plugins list-versions list-versions update, upgrade update update-all, upgrade-all update all your installed plugins ls list all installed plugins uninstall, remove uninstall help, h Shows a list of commands or help for one command OPTIONS: --help, -h show help (default: false) # 查看 zabbix 的 ID 及版本 [root@zabbix ~]# grafana-cli plugins list-remote | grep zabbix id: alexanderzobnin-zabbix-app version: 4.2.8 # 使用命令下载 [root@zabbix ~]# grafana-cli plugins install alexanderzobnin-zabbix-app # 使用命令下载很慢,或者没有反应下载不了,可以使用网站下载 https://grafana.com/grafana/plugins/alexanderzobnin-zabbix-app/?tab=installation alexanderzobnin-zabbix-app-4.2.8.zip # 默认下载到 /var/lib/grafana/plugins [root@zabbix plugins]# pwd /var/lib/grafana/plugins [root@zabbix plugins]# ls alexanderzobnin-zabbix-app alexanderzobnin-zabbix-app-4.2.8.zip # 解压完成直接重启 grafana [root@zabbix plugins]# systemctl restart grafana-server.service [root@zabbix plugins]#
启用 zabbix
11.4.4 创建数据源填写 zabbix URL 地址:http://localhost/zabbix/api_jsonrpc.php localhost:zabbix-server 地址,其他不用改动 填写 zabbix username zabbix password 保存11.4.5 查看数据源
选择查看图形
具体如何使用后期在看



