由于zabbix的图像显示一块不太友好,图像没法集中显示,而我们对这一功能的需求又比较高,所以就出现了zatree,graphtree,这些插件。

在网上找了很多zatree插件的资料,但是好像没有找到支持zabbix3.2.1版本的插件。后发现graphtree 。


Graphtree由OneOaaS开发并开源出来,OneOaaS专注于国内Zabbix监控技术(包括二次开发)服务,为Zabbix官方中国区合作伙伴。 

OneOaaS官方网站为http://www.oneoaas.com


一、Graphtree功能概述
1、集中展示所有分组设备
2、集中展示一个分组图像
3、集中展示一个设备图像
4、展示设备下的Application
5、展示每个Application下的图像
6、展示每个Application下的日志

7、对原生无图的监控项进行绘图

二:安装和配置

1.环境:ubuntu:14.04  

zabbix3.2.6  

graphtree3.0.4

2、graphtree安装及下载

下载graphtree3.0.4.patch到zabbix页面目录

cd  /usr/share/nginx/html/zabbix

wget --no-check-certificate  https://raw.githubusercontent.com/OneOaaS/graphtrees/master/graphtree3.0.4.patch

sudo apt-get  install -y patch #安装patch命令

sudo patch  -Np0 < graphtree3.0.4.patch

chown -R apache:apache oneoaas/
#注意此处的权限,必须和nginx或者apache的用户一致,如用的是apache,则此处为chown -R apache:apache oneoaas

3.重启nginx

sudo /etc/init.d/nginx  restart

4.删除广告信息:

vi /usr/share/nginx/html/zabbix/oneoaas/templates/graphtree/graphtree.tpl

ububtu下zabbix3.2.6安装graphtree3.0.4

删除广告信息

5. 修改func.inc.php文件

vi /usr/share/nginx/html/zabbix/oneoaas/inc/func.inc.php

将function _ex这个函数注释掉。段落注释符号/* */

/*
function _ex($obj = null, $exit = true) {
    static $cnt = 1;

    $type = gettype($obj);.........

    if($exit) {
        exit();
    }


    $cnt++;
}
*/


6.正常访问页面

ububtu下zabbix3.2.6安装graphtree3.0.4

ububtu下zabbix3.2.6安装graphtree3.0.4三:配置过程中遇到的问题

1.最初配置修改完成后访问页面失败,提示500

查看nignx错误日志,错误信息如下:

ububtu下zabbix3.2.6安装graphtree3.0.4

2018/02/26 11:24:28 [error] 15104#0: *267 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught  --> Smarty: unable to write file /usr/share/nginx/html/zabbix/oneoaas/templates_c/wrt5a937dec27b1d9_59108231 <-- 

不能写入文件templates_c

于是手动创建templates_c文件夹,并赋予777的权限:

sudo chmod  777 templates_c

2.在查找自己问题的同时,发现其他同仁遇到的问题,记录下来,以备不时之需:

nginx打开网站提示 500错误解决方案 ([error] 1824#100074: *6 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 13

查看一下 nginx 日志
# cat /var/log/nginx/error.log
2016/10/19 09:21:13 [error] 1824#100074: *6 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 4194337 bytes) in /usr/local/www/nginx-dist/mydoop.com/wp-includes/wp-db.php on line 1321" while reading response header from upstream, client: 123.157.210.26, server: mydoop.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.mydoop.com"
2016/10/19 09:22:39 [error] 1824#100074: *11 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 4194337 bytes) in /usr/local/www/nginx-dist/mydoop.com/wp-includes/wp-db.php on line 1321" while reading response header from upstream, client: 123.157.210.26, server: mydoop.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.mydoop.com"
大概的意思是 wordpress 的 wp-db.php 把php默认设置的 128M内存用完了
编辑php.ini
把 memory_limit = 128M 修改成 memory_limit = 256M
然后重起一下nginx 解决


相关文章:

  • 2021-11-25
  • 2021-05-22
  • 2021-05-13
  • 2021-06-02
  • 2021-08-12
  • 2021-12-26
  • 2022-12-23
  • 2021-10-15
猜你喜欢
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2021-04-17
  • 2021-09-29
  • 2021-07-03
相关资源
相似解决方案