码迷,mamicode.com
首页 > 其他好文 > 详细

Icinga2使用graphite显示图像

时间:2016-02-03 22:39:14      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:graphite   icinga2+graphite   


Icinga2使用graphite显示图像


下载地址:https://github.com/findmypast/icingaweb2-module-graphite


需要下载安装的软件:Django、django-tagging、pyparsing、python-whisper、pytz、mod_wsgi、python-carbon、python-twisted-core、python-zope-interface、python-zope-filesystem



软件安装略(rpm -i)


# unzip icingaweb2-module-graphite-master.zip


# mv icingaweb2-module-graphite /usr/share/icingaweb2/modules/graphite


# icinga2 feature enable graphite


icinga2页面——Configuration——Modules——graphite——enable


# mysql -u root -p‘*******‘


> create database graphite;

> grant all on graphite.* to graphite@‘localhost‘ identified by ‘graphite‘;

> flush privileges;

> quit


# vi /etc/graphite-web/local_settings.py


SECRET_KEY = ‘jksjflsjfk‘     (此处乱码随便敲)


TIME_ZONE = ‘Asia/Shanghai‘


DATABASES= {

    ‘default‘: {

      ‘NAME‘: ‘graphite‘,

      ‘ENGINE‘: ‘django.db.backends.mysql‘,

      ‘USER‘: ‘graphite‘,

      ‘PASSWORD‘:‘graphite‘,

      ‘HOST‘: ‘127.0.0.1‘,

      ‘PORT‘: ‘3306‘

    }

}


:wq


# /usr/lib/python2.6/site-packages/graphite/manage.py syncdb 


中间输入个账号、邮箱、密码 (后面登录用的,不登录也行)


# service carbon-cache start


# mkdir /etc/icingaweb2/modules/graphite


# vi /etc/icingaweb2/modules/graphite/config.ini (此处内容可从icinga2页面enable graphite处的configuration复制)


[graphite]

metric_prefix = icinga2

base_url = http://zlinux3.ming.com/render?

legacy_mode = false

;if legacy mode is false (2.4 and newer):

service_name_template = "icinga2.$host.name$.services.$service.name$.$service.check_command$.perfdata.$metric$.value"

host_name_template = "icinga2.$host.name$.host.$host.check_command$.perfdata.$metric$.value"

;if legacy mode is true (pre 2.4):

;service_name_template = "icinga.$host.name$.services.$service.name$.$service.check_command$"

;host_name_template = "icinga.$host.name$.host.$host.check_command$"

;this template is used for the small image, macro $target$ can used.

graphite_args_template = "&target=$target$&source=0&width=300&height=120&hideAxes=true&lineWidth=2&hideLegend=true&colorList=049BAF"

;this template is used for the large image, macro $target$ can used.


:wq


# service httpd restart


# service icinga2 restart



此时到icinga2页面上看图像已经是graphite在显示了






本文出自 “linux” 博客,请务必保留此出处http://yangzhiming.blog.51cto.com/4849999/1740959

Icinga2使用graphite显示图像

标签:graphite   icinga2+graphite   

原文地址:http://yangzhiming.blog.51cto.com/4849999/1740959

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!