1. 下载 zatree
git clone https://github.com/BillWang139967/zatree.git
cd zatree/zabbix-3.0.x/
WEB_DIR=/usr/share/zabbix/
3. 执行 start.sh
chmod +x start.sh
./start.sh
4. 删除无用语句
cd /usr/share/zabbix
vim zatree/graph.php
删除410行语句
<h1>Bill is very happy</h1>
5. 修改链接错误
修改 header.php
原代码
<ul class="menu" id="menu">
<li><a href="/index.php" target="xiaFrame" rel="index.php">首页</a></li>
<li><a href="/zabbix_tree.php" target="xiaFrame" rel="zabbix.php">HostGraph</a></li>
<li><a href="peckvalue.php" target="xiaFrame" rel="peckvalue.php">Peckvalue-Table</a></li>
<li><a href="echart.php" target="xiaFrame" rel="echart.php">Peckvalue-Echart</a></li>
</ul>
修改为
<ul class="menu" id="menu">
<li><a href="/zabbix/index.php" target="xiaFrame" rel="index.php">首页</a></li>
<li><a href="/zabbix/zabbix_tree.php" target="xiaFrame" rel="zabbix_tree.php">HostGraph</a></li>
<li><a href="peckvalue.php" target="xiaFrame" rel="peckvalue.php">Peckvalue-Table</a></li>
<li><a href="echart.php" target="xiaFrame" rel="echart.php">Peckvalue-Echart</a></li>
</ul>
修改 echart.php
原代码
<frame src="/zatree/echart_left.php" name="leftFrame" id="leftFrame" title="leftFrame" />
<frame src="/zatree/echart_zabbix.php" name="rightFrame" id="rightFrame" title="rightFrame" />
修改为
<frame src="echart_left.php" name="leftFrame" id="leftFrame" title="leftFrame" />
<frame src="echart_zabbix.php" name="rightFrame" id="rightFrame" title="rightFrame" />
修改 peckvalue.php
原代码
<frame src="/zatree/peckvalue_left.php" name="leftFrame" id="leftFrame" title="leftFrame" />
<frame src="/zatree/peckvalue_zabbix.php" name="rightFrame" id="rightFrame" title="rightFrame" />
修改为
<frame src="peckvalue_left.php" name="leftFrame" id="leftFrame" title="leftFrame" />
<frame src="peckvalue_zabbix.php" name="rightFrame" id="rightFrame" title="rightFrame" />
修改 zabbix.php
原代码
<frame src="/zatree/left.php" name="leftFrame" id="leftFrame" title="leftFrame" />
<frame src="/zatree/graph.php" name="rightFrame" id="rightFrame" title="rightFrame" />
修改成
<frame src="left.php" name="leftFrame" id="leftFrame" title="leftFrame" />
<frame src="graph.php" name="rightFrame" id="rightFrame" title="rightFrame" />
6. 如果出现下面的警告,修改 /etc/php.ini
vim /etc/php.ini
output_buffering = on
7. 重启服务
service httpd restart
service zabbix-server restart
8. 完成
链接:https://github.com/BillWang139967/zatree/tree/master/zabbix-3.0.x