官网:http://grafana.org/
下载(下载地址:http://down.51cto.com/data/2332836)
[root@monitoring-45 ~]# wget https://grafanarel.s3.amazonaws.com/builds/grafana-3.1.1-1470047149.x86_64.rpm
创建grafana库
mysql> create database grafana character set utf8collate utf8_bin;
Query OK, 1 row affected(0.00 sec)
mysql> use grafana;
Database changed
mysql> CREATE TABLE`session` ( `key` CHAR(16) NOT NULL, `data` BLOB, `expiry` INT(11) UNSIGNED NOT NULL, PRIMARY KEY (`key`) ) ENGINE=MyISAMDEFAULT CHARSET=utf8;
Query OK, 0 rows affected(0.02 sec)
mysql> grant allprivileges on grafana.* to grafana@'localhost' identified by '密码';
Query OK, 0 rows affected(0.03 sec)
2.安装granfana
[root@monitoring-45 install]# rpm -Uvh grafana-3.1.1-1470047149.x86_64.rpm
warning: grafana-3.1.1-1470047149.x86_64.rpm:Header V4 RSA/SHA1 Signature, key ID 3dd18bdd: NOKEY
Preparing... ########################################### [100%]
1:grafana ########################################### [100%]
### NOT starting grafana-server by default onbootup, please execute
sudo/sbin/chkconfig --add grafana-server
### In order to start grafana-server, execute
sudo servicegrafana-server start
[root@monitoring-45 install]# /sbin/chkconfig --add grafana-server
3.配置grafana,将数据库改为mysql
[root@monitoring-45 ~]# vim /etc/grafana/grafana.ini
设置初始管理员帐号密码
allow_sign_up:是否允许普通用户登录,如果设置为false,则禁止用户登录,默认是true
allow_org_create:如果设置为false,则禁止用户创建新组织,默认是true
auto_assign_org:设置为true时,会把新增用户加到id为1的组织中;设置为false的时候,新建用户会新增一个组织,这时不可以访问其他id的组织内容。
auto_assign_org_role:新建用户附加的规则,默认是Viewer,还可以是Admin和Editor
4.修改防火墙允许访问
Iptables -A INPUT -s 允许的ip -p tcp-m state --state NEW -m tcp --dport 3000 -j ACCEPT
登陆地址:
5.下拉可以安装的模块:
[root@monitoring-45 ~]# grafana-cli pluginslist-remote
id: abhisant-druid-datasource version: 0.0.2
id: alexanderzobnin-zabbix-app version: 3.0.0
id: bosun-app version: 0.0.25
id: bosun-datasource version: 0.0.5
id: crate-datasource version: 0.0.1
6.安装zabbix模块
[root@monitoring-45 ~]# grafana-cli plugins installalexanderzobnin-zabbix-app
安装percona模块
[root@monitoring-45 alexanderzobnin-zabbix-app]#grafana-cli plugins install percona-percona-app
[root@monitoring-45 alexanderzobnin-zabbix-app]# grafana-cliplugins install grafana-piechart-panel
下载和介绍地址:
7.添加zabbix源:
安装(grafana-cli plugins install alexanderzobnin-zabbix-app)后需要重启服务
登录页面
上面的URl填写:http://<zabbix地址>/api_jsonrpc.php
Zabbix上需要添加用户,或使用默认账号
8.开始配置图形
以后再写