Zabbix:grafana-zabbix
2016-07-23 00:00
369 查看
摘要: 请大伙一起分享学习
参考链接(感谢分享):
http://docs.grafana.org/v2.0/installation/
https://github.com/alexanderzobnin/grafana-zabbix/wiki/Installation
http://itnihao.blog.51cto.com/1741976/1675178
需求:
· grafana版本要和grafana-zabbix版本对应,避免异常
· 更新时,需要两者同步更新
1. CentOS安装grafana(rpm)
参考链接(感谢分享):
http://docs.grafana.org/v2.0/installation/
https://github.com/alexanderzobnin/grafana-zabbix/wiki/Installation
http://itnihao.blog.51cto.com/1741976/1675178
需求:
· grafana版本要和grafana-zabbix版本对应,避免异常
· 更新时,需要两者同步更新
1. CentOS安装grafana(rpm)
# wget https://grafanarel.s3.amazonaws.com/builds/grafana-2.5.0-1.x86_64.rpm # rpm -ivh grafana-2.5.0-1.x86_64.rpm #或者直接使用 # yum install https://grafanarel.s3.amazonaws.com/builds/grafana-2.5.0-1.x86_64.rpm[/code] · 环境变量:/etc/sysconfig/grafana-server
· 配置文件:/etc/grafana/grafana.ini
· 日志文件:/var/log/grafana/grafana.log
· systemd服务:grafana-server.service
· sqlite3数据库:/var/lib/grafana/grafana.db
· grafana安装目录:/usr/share/grafana
服务详情
· 启动用户:grafana
· 服务名称:grafana-server
· 默认端口:3000
· 账号:admin
· 密码:admin
1.1 yum安装# vim /etc/yum.repos.d/grafana.repo [grafana] name=grafana baseurl=https://packagecloud.io/grafana/stable/el/6/$basearch #稳定版 #baseurl=https://packagecloud.io/grafana/testing/el/6/$basearch #最新版(beta) repo_gpgcheck=1 enabled=1 gpgcheck=1 gpgkey=https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt
启动服务/开机自启C6# service grafana-server start C6# chkconfig --add grafana-server C6# chkconfig grafana-server on C7# systemctl daemon-reload C7# systemctl start grafana-server C7# systemctl enable grafana-server.service
查看状态C7# systemctl status grafana-server
1.2 升级# yum install initscripts fontconfig # rpm -Uvh grafana-3.1.0-1468321182.x86_64.rpm
2. 安装grafana-zabbix插件# wget https://github.com/alexanderzobnin/grafana-zabbix/archive/v2.5.1.tar.gz # tar xzf v2.5.1.tar.gz # cp -r grafana-zabbix-2.5.1/zabbix /usr/share/grafana/public/app/plugins/datasource/ # cd /usr/share/grafana/public/app/plugins/datasource/zabbix # vim plugin.json { "pluginType": "datasource", "name": "Zabbix", "type": "zabbix", "serviceName": "ZabbixAPIDatasource", "module": "app/plugins/datasource/zabbix/datasource", "partials": { "config": "app/plugins/datasource/zabbix/partials/config.html" }, # 追加"username"和"password"内容。用户并非一定是管理员,只要有可读权限即可。 "username": "Admin", "password": "zabbix", "metrics": true, "annotations": true }
测试用户/密码是否正确# curl -i -X POST -H 'Content-Type:application/json' -d '{"jsonrpc": "2.0","method":"user.authenticate","params":{"user":"Admin","password":"zabbix"},"auth": null,"id":0}' http://127.0.0.1/api_jsonrpc.php[/code]
修改Zabbix的API文件,由于Zabbix2.2不支持跨域的问题,故添加以下配置:(2.4以后无需配置)require_once dirname(__FILE__).'/include/func.inc.php'; require_once dirname(__FILE__).'/include/classes/core/CHttpRequest.php';
在上面两行前新增# vim <wwwroot>/zabbix/api_jsonrpc.php header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Headers: Content-Type'); header('Access-Control-Allow-Methods: POST'); header('Access-Control-Max-Age: 1000'); if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') { return; }
相关文章推荐
- Python 实现Zabbix自动发送报表
- Zabbix安装详解
- 用zabbix监控nginx_status状态
- Zabbix监控Linux主机设置方法
- Zabbix监控交换机设置方法
- 使用zabbix监控mongodb的方法
- 集群运维自动化工具ansible之使用playbook安装zabbix客户端
- Windows 安装配置 Zabbix Agentd
- zabbix进行数据库备份以及表分区的方法
- Zabbix客户端安装 for windows server
- 部署企业级zabbix+Orabbix监控Oracle数据库
- zabbix 触发器 Triggers
- zabbix 分布式部署
- zabbix event事件
- StatsD+InfluxDB+Grafana 打造应用性能监控平台--01背景知识
- openstack开发之--zabbix被坑的地方
- 关于Zabbix3版本发送微信报警配置
- RedHat6(CentOS6)下Zabbix2安装
- Zabbix配置文件详解之服务端zabbix_server
- zabbix配置指南