From 2ccde3f29de1de0db55bdf9fe5e8d894dca67884 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Tue, 23 Jun 2015 20:16:54 +0300 Subject: [PATCH] Update README.md --- README.md | 103 +++++++----------------------------------------------- 1 file changed, 13 insertions(+), 90 deletions(-) diff --git a/README.md b/README.md index 30b002a..dc52daf 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,19 @@ Display your Zabbix data directly in [Grafana](http://grafana.org) dashboards! ![Dashboard](https://cloud.githubusercontent.com/assets/4932851/8269101/9e6ee67e-17a3-11e5-85de-fe9dcc2dd375.png) -#### Content -- [**Features**](#features) -- [**Installation**](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Installation) -- [**Troubleshooting**](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Troubleshooting) -- [**User's Guide**](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Usage) -Read more in [wiki](https://github.com/alexanderzobnin/grafana-zabbix/wiki). +#### [Documentation](https://github.com/alexanderzobnin/grafana-zabbix/wiki) +1. [**Overview**](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Overview) +2. [**Installation**](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Installation) + - [Grafana 1.9.x](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Installation#grafana-19x) + - [Grafana 2.x.x](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Installation#grafana-20x) +3. [**User’s Guide**](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Usage) + - [Query editor](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Usage#query-editor) + - [Filters](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Usage#filters) + - [Scale](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Usage#scale) + - [Templated queries](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Usage#templated-queries) + - [Templated variable editor](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Usage#templated-variable-editor) + - [Annotations](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Usage#annotations) +4. [**Troubleshooting**](https://github.com/alexanderzobnin/grafana-zabbix/wiki/Troubleshooting) ## Features @@ -36,87 +43,3 @@ Group, host, application or item names can be replaced with a template variable. ![Acknowledges](https://cloud.githubusercontent.com/assets/4932851/8269375/e6d8706a-17ad-11e5-8e2d-2d707d8ee67f.png) Read more about Grafana features at [grafana.org](http://grafana.org) - - -## Installation - -### Grafana 1.9.x -See [grafana-1.9](../../tree/grafana-1.9) branch or Grafana-Zabbix [wiki](https://github.com/alexanderzobnin/grafana-zabbix/wiki). - -### Grafana 2.0.x -Download source code from master branch and put `zabbix` directory into `/public/app/plugins/datasource/`. - * Edit plugin.json (located in `zabbix` directory) and set your `username` and `password` - - ``` - { - "pluginType": "datasource", - "name": "Zabbix", - - "type": "zabbix", - "serviceName": "ZabbixAPIDatasource", - - "module": "plugins/datasource/zabbix/datasource", - - "partials": { - "config": "app/plugins/datasource/zabbix/partials/config.html", - "query": "app/plugins/datasource/zabbix/partials/query.editor.html", - "annotations": "app/plugins/datasource/zabbix/partials/annotations.editor.html" - }, - - "username": "guest", - "password": "", - - "metrics": true, - "annotations": true - } - - ``` - * Restart grafana server. - * Add zabbix datasource in Grafana's "Data Sources" menu (see [Data Sources docs](http://docs.grafana.org/datasources/graphite/) for more info) and setup your Zabbix API url. - * **Important!** Change `Access` to `direct`! - ![2015-05-18 12-46-03 grafana - zabbix org - mozilla firefox](https://cloud.githubusercontent.com/assets/4932851/7678429/b42a9cda-fd5c-11e4-84a3-07aa765769d3.png) - -#### Trends support -If you use patch for trends support ([ZBXNEXT-1193](https://support.zabbix.com/browse/ZBXNEXT-1193)), you don't need to do anything - trends support is enabled by default in `plugin.json` file: - -``` - "trends": true, - "trendsFrom": "7d", -``` - -`trendsFrom` option define period when switch to trends from history. You can set the time in Grafana format: `7d` for 7 days or for example `2d` for 2 days. Valid time specificators are: -`h` - hours -`d` - days -`M` - months - -If you don't use trend patch, change `trends` to `false`: -``` - "trends": false, -``` - -#### Note for Zabbix 2.2 or less -Zabbix API (api_jsonrpc.php) before zabbix 2.4 don't allow cross-domain requests (CORS). And you can get HTTP error 412 (Precondition Failed). -To fix it add this code to api_jsonrpc.php immediately after the copyright -``` -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; -} -``` -before -``` -require_once dirname(__FILE__).'/include/func.inc.php'; -require_once dirname(__FILE__).'/include/classes/core/CHttpRequest.php'; -``` -[Full fix listing](https://gist.github.com/alexanderzobnin/f2348f318d7a93466a0c). -For more info see zabbix issues [ZBXNEXT-1377](https://support.zabbix.com/browse/ZBXNEXT-1377) and [ZBX-8459](https://support.zabbix.com/browse/ZBX-8459). - -#### Note about browser cache -After updating plugin, clear browser cache and reload application page. See details for [Chrome](https://support.google.com/chrome/answer/95582), [Firefox](https://support.mozilla.org/en-US/kb/how-clear-firefox-cache). You need to clear cache only, not cookies, history and other data. - -## Troubleshooting -See [Grafana troubleshooting](http://docs.grafana.org/installation/troubleshooting/) for general connection issues. If you have a problem with Zabbix datasource, you should open a [support issue](https://github.com/alexanderzobnin/grafana-zabbix/issues). Before you do that please search the existing closed or open issues.