nagios下用grafana绘图(二)
来源:互联网 发布:linux双系统升级win10 编辑:程序博客网 时间:2024/05/15 23:46
现在不需要安装elasticsearch了,所以省去了很多步骤.
使用如下工具:
graphitegrafana-3.1.1-1470047149.x86_64graphios
部署环境:
Centos 6.5python 2.6nagios 4.1.1
一.安装graphite
1.关闭selinux
2.安装依赖工具
yum install epel-release -yyum install bitmap bitmap-fonts-compat Django django-tagging fontconfig cairo python-devel python-memcached python-twisted pycairo mod_python python-ldap python-simplejson memcached python-zope-interface mod_wsgi python-sqlite2 Django MySQL-python -y
安装pytz
pip install pytz
carbon依赖Twisted,如果是python2.6,新版的Twisted不支持python2.6,需手动安装支持2.6的版本,这里用Twisted-15
wget https://pypi.python.org/packages/76/9a/ed7a9cabefd919c861249d39d11111d5d8fba2e8d0b2a1bce7ee8933a8fd/Twisted-15.0.0.tar.bz2#md5=f52bfe112a3aa33dd1d323c7c1e99f16tar jxvf Twisted-15.0.0.tar.bz2cd Twisted-15.0.0python setup.py install
3.安装graphite
使用pip安装
pip install whisperpip install carbonpip install graphite-web
添加配置文件
cd /opt/graphite/conf/cp carbon.conf.example carbon.confcp storage-schemas.conf.example storage-schemas.confcp graphite.wsgi.example graphite.wsgi
4.配置apache
cat /opt/graphite/examples/example-graphite-vhost.conf >> /etc/httpd/conf/httpd.confvim /etc/httpd/conf/httpd.conf添加 Listen 8081修改端口为8081<VirtualHost *:8081>修改WSGISocketPrefix 为 WSGISocketPrefix /var/run/httpd/wsgi初始化数据库cd /opt/graphite/webapp/graphite/cp local_settings.py.example local_settings.pypython manage.py syncdbchown -R apache:apache /opt/graphite
5.启动graphite
/opt/graphite/bin/carbon-cache.py startservice httpd restart
访问http://ip:8081 即可进入graphite
二.安装配置graphios
1.安装
git clone https://github.com/shawn-sterling/graphios.gitcd graphiospython setup.py installmkdir -p /var/spool/nagios/graphioschown nagios:nagios -R /var/spool/nagios
2.配置
安装完成后,会自动在/usr/local/nagios/etc/nagios.cfg中添加graphios的配置
注释掉这行,避免配置冲突
cfg_dir=/usr/local/nagios/etc/objects
手动添加command的配置
vim /usr/local/nagios/etc/objects/commands.cfgdefine command { command_name graphite_perf_host command_line /bin/mv /var/spool/nagios/graphios/host-perfdata /var/spool/nagios/graphios/host-perfdata.$TIMET$ }define command { command_name graphite_perf_service command_line /bin/mv /var/spool/nagios/graphios/service-perfdata /var/spool/nagios/graphios/service-perfdata.$TIMET$ }在nagios对应的主机或服务中,添加 _graphiteprefix 值如define host { host_name gzimg110 check_command check_ping _graphiteprefix ping}
3.配置graphios
vim /etc/graphios/graphios.cfg
修改如下内容
debug = Falseenable_carbon = Truesleep_max = 3
vim /usr/bin/graphios.py
将对应值修改为如下内容
config_file = '/etc/graphios/graphios.cfg'debug = False
启动graphios
service graphios startservice nagios restart
可以查看日志,看是否正常
tail /usr/local/nagios/var/graphios.log
查看/opt/graphite/storage/whisper/下是否有对应的文件产生
三.安装配置grafana
1.安装
可以访问官网获取最新的版本
http://docs.grafana.org/
本次使用3.1.1
wget https://grafanarel.s3.amazonaws.com/builds/grafana-3.1.1-1470047149.x86_64.rpmrpm -ivh grafana-3.1.1-1470047149.x86_64.rpm
2.配置
grafana默认使用3000端口
vim /etc/grafana/grafana.ini
开启如下选项
protocol = httphttp_port = 3000admin_user = adminadmin_password = admin
3.使用
启动grafana
service grafana-server start
打开浏览器,访问grafana
http://ip:3000
按如下步骤,添加graphite数据源
添加完成后,点开dashborads,即可添加对应的服务了.
最终效果:
- nagios下用grafana绘图(二)
- nagios下用grafana绘图
- Nagios 绘图(pnp4nagios插件)
- grafana
- grafana
- nagios全攻略(二)----基本安装和配置(下)
- CentOS6.6下的Nagios安装配置详解(二)
- prometheus+grafana构建应用监控(二)
- NAGIOS (二)
- 构建nagios监控(二)
- nagios(二)配置
- ubuntu下搭建nagios
- linux下nagios安装
- Nginx下搭建Nagios
- 使用GDI在windows下绘图(二)——GDI绘图方法
- Win32下绘图程序(二)保存绘图信息至文件
- C#用鼠标绘图笔记(二)
- nagios全攻略一、二
- Jenkins安装与配置
- 51Nod-1138-连续整数的和
- 二维码的生成与解析
- <LeetCode> 题247:线段树的查询(2)
- z最短路合集(贝尔曼福德算法+迪杰斯克拉算法+弗洛伊德算法)
- nagios下用grafana绘图(二)
- 利用Office 365 定制企业合同管理平台之测试系统完整性!
- mysql保存数据提示:Out of range value for column
- 985的红绿灯难题
- 1896: 985的买饮料难题
- POJ 1106 Transmitters(计算几何:叉积)
- js画一个随着系统时间变动的钟表
- 美团 拜访
- gcc编译出错