第十六章 第三方应用扩展
16.1 graphtrees
当Zabbix中监控设备的数量比较多时,查看监控图形是一个比较痛苦的事情。Zabbix 2.x版本中有个插件叫Zatree(https://github.com/spide4k/zatree),主要功能是提供Host group的树形展示和在item中指定关键字查询及数据排序。Zabbix 3.0发布后,Zatree一直没有更新。好消息是OneOaaS公司开源了graphtrees,项目托管在github上,目前支持Zabbix 3.0.1、3.0.2和3.0.3版本,你可以访问https://github.com/OneOaaS/graphtrees获得最新的项目信息。
近日完成《深入浅出 zabbix 4.0》视频教程的录制并正式发布,该教程基于 zabbix 4.2 ,对Zabbix进行全面讲解。欢迎大家围观。课程链接:https://edu.csdn.net/course/detail/24870
Graphtrees的主要功能有:
-
集中展示所有分组设备
-
集中展示一个分组图像
-
集中展示一个设备图像
-
展示设备下的Application
-
展示每个Application下的图像
-
展示每个Application下的日志
-
对原生无图的监控项进行绘图
-
安装及使用
步骤如下:
1、 备份现有Zabbix web 页面程序,假设安装目录为 /usr/share/zabbix。
# cd /usr/share/
# tar -czf zabbix_web.tar.gz zabbix
# cd zabbix
2、 收集补丁文件。
# wget https://raw.githubusercontent.com/OneOaaS/graphtrees/master/graphtree3-0-1.patch
3、 安装patch工具并执行补丁命令。
# yum install -y patch
# patch -Np0 <graphtree3-0-1.patch
patching file ./README.md
patching file ./biggraph.php
patching file ./graphtree.left.php
The next patch would delete the file graphtree/graphtree.patch,
which does not exist! Skipping patch.
1 out of 1 hunk ignored
patching file ./graphtree.right.php
patching file ./graphtrees.php
patching file ./hosts.php
patching file ./img/icon-sprite.svg
patching file ./img/oneoaas-wechat.jpg
patching file ./include/func.inc.php
patching file ./include/menu.inc.php
patching file ./include/page_header.php
patching file ./js/vendors/highlight.min.js
patching file ./js/vendors/jquery.ztree.core-3.5.js
patching file ./jsLoader.php
patching file ./locale/lt/LC_MESSAGES/frontend.po
patching file ./locale/lv/LC_MESSAGES/frontend.po
patching file ./locale/pt_BR/LC_MESSAGES/frontend.po
patching file ./styles/ztree/line_conn.gif
patching file ./styles/ztree/loading.gif
patching file ./styles/ztree/zTreeStandard.gif
patching file ./styles/ztree/zTreeStandard.png
patching file ./styles/ztree/zTreeStyle.css
从上面的输出信息可以看到除了graphtree.patch这个补丁文件报错外,其他文件都没有问题。接下来在Zabbix 前端页面的Monitoring菜单会有一个Graphtrees子菜单,如下图16-1所示。
图 16-1
点击Grap