Chinaunix首页 | 论坛 | 博客
  • 博客访问: 184881
  • 博文数量: 26
  • 博客积分: 215
  • 博客等级: 入伍新兵
  • 技术积分: 346
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-21 15:00
文章分类

全部博文(26)

文章存档

2017年(10)

2016年(1)

2015年(2)

2014年(1)

2013年(7)

2012年(5)

我的朋友

分类: 系统运维

2017-10-24 16:31:00

1、安装grafana
[root@localhost opt]# curl -C - -O https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.5.2-1.x86_64.rpm
** Resuming transfer from byte position 118784
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 47.8M  100 47.8M    0     0   189k      0  0:04:18  0:04:18 --:--:--  356k
[root@localhost opt]# yum install initscripts fontconfig
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.btte.net
 * epel: mirrors.ustc.edu.cn
 * extras: mirrors.btte.net
 * updates: mirrors.btte.net
软件包 initscripts-9.49.39-1.el7.x86_64 已安装并且是最新版本
软件包 fontconfig-2.10.95-11.el7.x86_64 已安装并且是最新版本
无须任何处理
[root@localhost opt]# rpm -Uvh grafana-4.5.2-1.x86_64.rpm
警告:grafana-4.5.2-1.x86_64.rpm: 头V4 RSA/SHA1 Signature, 密钥 ID 24098cb6: NOKEY
错误:依赖检测失败:
        urw-fonts 被 grafana-4.5.2-1.x86_64 需要
[root@localhost opt]# yum install initscripts fontconfig urw-fonts freetype*
[root@localhost opt]# sudo /bin/systemctl enable grafana-server.service
Created symlink from /etc/systemd/system/multi-user.target.wants/grafana-server.service to /usr/lib/systemd/system/grafana-server.service.
[root@localhost opt]# sudo /bin/systemctl daemon-reload
[root@localhost opt]# sudo /bin/systemctl start grafana-server.service
[root@localhost opt]# systemctl status grafana-server
● grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: disabled)
   Active: active (running) since 一 2017-10-23 16:21:52 CST; 22s ago
     Docs: http://docs.grafana.org
 Main PID: 31246 (grafana-server)
   CGroup: /system.slice/grafana-server.service
           └─31246 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.pid cfg:defa...

10月 23 16:21:53 localhost grafana-server[31246]: t=2017-10-23T16:21:53+0800 lvl=info msg="Executing migration" logger=migrat...le v1"
10月 23 16:21:53 localhost grafana-server[31246]: t=2017-10-23T16:21:53+0800 lvl=info msg="Executing migration" logger=migrat...xt v1"
10月 23 16:21:53 localhost grafana-server[31246]: t=2017-10-23T16:21:53+0800 lvl=info msg="Created default admin user: admin"
10月 23 16:21:53 localhost grafana-server[31246]: t=2017-10-23T16:21:53+0800 lvl=info msg="Starting plugin search" logger=plugins
10月 23 16:21:53 localhost grafana-server[31246]: t=2017-10-23T16:21:53+0800 lvl=warn msg="Plugin dir does not exist" logger=...lugins
10月 23 16:21:53 localhost grafana-server[31246]: t=2017-10-23T16:21:53+0800 lvl=info msg="Plugin dir created" logger=plugins...lugins
10月 23 16:21:53 localhost grafana-server[31246]: t=2017-10-23T16:21:53+0800 lvl=info msg="Initializing Alerting" logger=aler...engine
10月 23 16:21:53 localhost grafana-server[31246]: t=2017-10-23T16:21:53+0800 lvl=info msg="Initializing CleanUpService" logger=cleanup
10月 23 16:21:53 localhost grafana-server[31246]: t=2017-10-23T16:21:53+0800 lvl=info msg="Initializing Stream Manager"
10月 23 16:21:53 localhost grafana-server[31246]: t=2017-10-23T16:21:53+0800 lvl=info msg="Initializing HTTP Server" logger=h...ocket=
Hint: Some lines were ellipsized, use -l to show in full.
地址:http://ServerIP:3000
默认登录用户名密码:admin/admin

2、安装zabbix插件,并结合zabbix实现可视化图形监控
获取可用插件列表grafana-cli plugins list-remote
安装grafana-zabbix插件:
grafana-cli plugins install alexanderzobnin-zabbix-app
安装grafana-clock-panel插件:
grafana-cli plugins install grafana-clock-panel
重启grafana服务:
sudo /bin/systemctl restart grafana-server.service
3、在grafana网站管理控制台启用zabbix插件

选择enble
4、配置数据源
首先配置mysql数据源


配置zabbix数据源

5、测试zabbix-server api
[root@localhost alexanderzobnin-zabbix-app]# curl -i -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","method":"user.login","params":{"user":"Admin","password":"zabbix"},"auth":null,"id":0}' http://192.168.1.33/zabbix/api_jsonrpc.php  
HTTP/1.1 200 OK
Date: Tue, 24 Oct 2017 07:24:50 GMT
Server: Apache/2.4.6 (CentOS) PHP/5.4.16
X-Powered-By: PHP/5.4.16
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: POST
Access-Control-Max-Age: 1000
Content-Length: 68
Content-Type: application/json

{"jsonrpc":"2.0","result":"6dbccda358910c4472099c509c5469b1","id":0}
6、配置zabbix的数据源报错“Test Connection连接不上
需要先配置一个mysql数据源

阅读(2468) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~