From 10ed38a150a95400ddc978f4197fb9add2e699a5 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Sat, 9 Jan 2016 22:58:16 +0300 Subject: [PATCH 1/8] Added initial docs based on MkDocs. --- docs/mkdocs.yml | 38 ++++++++++++++++++++++++++++++ docs/sources/index.md | 33 ++++++++++++++++++++++++++ docs/sources/installation/index.md | 2 ++ 3 files changed, 73 insertions(+) create mode 100644 docs/mkdocs.yml create mode 100644 docs/sources/index.md create mode 100644 docs/sources/installation/index.md diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 0000000..ddddaee --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,38 @@ +site_name: Grafana-Zabbix Documentation +#site_url: http://docs.grafana.com/ +#site_url: / +site_description: Documentation for Grafana-Zabbix, Zabbix monitoring system plugin bundle for Grafana +repo_url: https://github.com/alexanderzobnin/grafana-zabbix/ +copyright: Copyright © 2014-2015, Alexander Zobnin + +docs_dir: sources +theme: readthedocs + + +pages: +- Project: + - 'About Grafana-Zabbix': 'index.md' +- Installation: + - 'Installation': 'installation/index.md' + +# - ['project/cla.md', 'Project', 'Contributor License Agreement'] + +# - ['installation/index.md', 'Installation', 'Installation'] +# - ['installation/troubleshooting.md', 'Installation', 'Troubleshooting'] +# - ['installation/migrating_to2.md', 'Installation', 'Migrating from v1.x to v2.x'] + +# - ['guides/basic_concepts.md', 'User Guides', 'Basic Concepts'] +# - ['guides/gettingstarted.md', 'User Guides', 'Getting Started'] +# - ['guides/whats-new-in-v2-6.md', 'User Guides', "What's New in Grafana v2.6"] +# - ['guides/whats-new-in-v2-5.md', 'User Guides', "What's New in Grafana v2.5"] +# - ['guides/whats-new-in-v2-1.md', 'User Guides', "What's New in Grafana v2.1"] +# - ['guides/whats-new-in-v2.md', 'User Guides', "What's New in Grafana v2.0"] +# - ['guides/screencasts.md', 'User Guides', 'Screencasts'] + +# - ['reference/graph.md', 'Reference', 'Graph Panel'] +# - ['reference/singlestat.md', 'Reference', 'Singlestat Panel'] +# - ['reference/table_panel.md', 'Reference', 'Table Panel'] +# - ['reference/dashlist.md', 'Reference', 'Dashboard List Panel'] + +# - ['tutorials/index.md', 'Tutorials', 'Tutorials'] +# - ['tutorials/hubot_howto.md', 'Tutorials', 'How To integrate Hubot and Grafana'] diff --git a/docs/sources/index.md b/docs/sources/index.md new file mode 100644 index 0000000..5a16ee2 --- /dev/null +++ b/docs/sources/index.md @@ -0,0 +1,33 @@ +page_title: About Grafana-Zabbix +page_description: Introduction to Grafana-Zabbix. + +# About Grafana-Zabbix + +Grafana-Zabbix is a plugin bundle for Grafana allowing to visualize monitoring data from Zabbix +and create dashboards for analyzing metrics and realtime monitoring. + +## Community resources, feedback, and support + +Thousands of organizations large and small rely on Grafana, and we have a vibrant and active community that constantly inspires us. + +Please don't hesitate to [open a new issue on Github](https://github.com/grafana/grafana/issues) +with your suggestions, ideas, and bug reports. + +Most of the new features and improvements that go into Grafana come from our users. We greatly value your feedback and suggestions; we consider them paramount to making the product better! + +If you have any troubles with Grafana or you just want clarification on a feature, there are +a number of ways to get help: + +- [Troubleshooting guide](/installation/troubleshooting/) +- Search closed and open [issues on GitHub](https://github.com/grafana/grafana/issues) +- [Gitter room](https://gitter.im/alexanderzobnin/grafana-zabbix) +- [Twitter](https://twitter.com/AlexanderZobnin) + +Or you can just send me [emai](mailto:alexanderzobnin@gmail.com). + +## License + +By utilizing this software, you agree to the terms of the included license. Grafana-Zabbix is +licensed under the Apache 2.0 agreement. See +[LICENSE](https://github.com/alexanderzobnin/grafana-zabbix/blob/master/LICENSE.md) for the full +license terms. \ No newline at end of file diff --git a/docs/sources/installation/index.md b/docs/sources/installation/index.md new file mode 100644 index 0000000..26bf6b5 --- /dev/null +++ b/docs/sources/installation/index.md @@ -0,0 +1,2 @@ +page_title: About Grafana-Zabbix +page_description: Introduction to Grafana-Zabbix. \ No newline at end of file From d25bba36818cd93121b634718bd2adc110cfcec2 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Sun, 10 Jan 2016 14:59:36 +0300 Subject: [PATCH 2/8] Added ./img directory for screenshots and other content for docs, managed by git lfs. --- docs/img/.gitattributes | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 docs/img/.gitattributes diff --git a/docs/img/.gitattributes b/docs/img/.gitattributes new file mode 100644 index 0000000..257c15f --- /dev/null +++ b/docs/img/.gitattributes @@ -0,0 +1,3 @@ +*.png filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.psd filter=lfs diff=lfs merge=lfs -text From 304a0323c7eff817f2a65c9fe7597f3dd29acae0 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Sun, 10 Jan 2016 14:59:57 +0300 Subject: [PATCH 3/8] Added README for docs --- docs/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/README.md diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..0be8737 --- /dev/null +++ b/docs/README.md @@ -0,0 +1 @@ +# Grafana-Zabbix Documentation \ No newline at end of file From 63383ff6001a2cd7fb34b6bec8d9550bb51f5aa1 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Sun, 10 Jan 2016 15:00:35 +0300 Subject: [PATCH 4/8] Added initial contributing guide --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..be343e6 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1 @@ +# Contributing to Grafana-Zabbix \ No newline at end of file From f0d718fc16a7cae90115c08172901e8c8b2f3d6f Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Sun, 10 Jan 2016 17:26:52 +0300 Subject: [PATCH 5/8] Added installation docs. --- docs/mkdocs.yml | 35 ++--- docs/{ => sources}/img/.gitattributes | 0 .../img/installation-add_datasource.png | 3 + .../img/installation-datasource_config.png | 3 + .../img/installation-test_connection.png | 3 + .../installation-test_connection_error.png | 3 + docs/sources/index.md | 4 +- docs/sources/installation/index.md | 120 +++++++++++++++++- docs/sources/installation/troubleshooting.md | 5 + 9 files changed, 147 insertions(+), 29 deletions(-) rename docs/{ => sources}/img/.gitattributes (100%) create mode 100644 docs/sources/img/installation-add_datasource.png create mode 100644 docs/sources/img/installation-datasource_config.png create mode 100644 docs/sources/img/installation-test_connection.png create mode 100644 docs/sources/img/installation-test_connection_error.png create mode 100644 docs/sources/installation/troubleshooting.md diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index ddddaee..3399453 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -1,5 +1,5 @@ site_name: Grafana-Zabbix Documentation -#site_url: http://docs.grafana.com/ +#site_url: http://docs.grafana-zabbix.org/ #site_url: / site_description: Documentation for Grafana-Zabbix, Zabbix monitoring system plugin bundle for Grafana repo_url: https://github.com/alexanderzobnin/grafana-zabbix/ @@ -8,31 +8,16 @@ copyright: Copyright © 2014-2015, Alexander Zobnin docs_dir: sources theme: readthedocs - pages: - Project: - 'About Grafana-Zabbix': 'index.md' - Installation: - - 'Installation': 'installation/index.md' - -# - ['project/cla.md', 'Project', 'Contributor License Agreement'] - -# - ['installation/index.md', 'Installation', 'Installation'] -# - ['installation/troubleshooting.md', 'Installation', 'Troubleshooting'] -# - ['installation/migrating_to2.md', 'Installation', 'Migrating from v1.x to v2.x'] - -# - ['guides/basic_concepts.md', 'User Guides', 'Basic Concepts'] -# - ['guides/gettingstarted.md', 'User Guides', 'Getting Started'] -# - ['guides/whats-new-in-v2-6.md', 'User Guides', "What's New in Grafana v2.6"] -# - ['guides/whats-new-in-v2-5.md', 'User Guides', "What's New in Grafana v2.5"] -# - ['guides/whats-new-in-v2-1.md', 'User Guides', "What's New in Grafana v2.1"] -# - ['guides/whats-new-in-v2.md', 'User Guides', "What's New in Grafana v2.0"] -# - ['guides/screencasts.md', 'User Guides', 'Screencasts'] - -# - ['reference/graph.md', 'Reference', 'Graph Panel'] -# - ['reference/singlestat.md', 'Reference', 'Singlestat Panel'] -# - ['reference/table_panel.md', 'Reference', 'Table Panel'] -# - ['reference/dashlist.md', 'Reference', 'Dashboard List Panel'] - -# - ['tutorials/index.md', 'Tutorials', 'Tutorials'] -# - ['tutorials/hubot_howto.md', 'Tutorials', 'How To integrate Hubot and Grafana'] + - 'Installation and Configuration': 'installation/index.md' + - 'Troubleshooting': 'installation/troubleshooting.md' +- User Guides: + - 'Getting Started': 'guides/gettingstarted.md' +- Reference: + - 'Zabbix Datasource': 'reference/datasource-zabbix.md' + - 'Triggers Panel': 'reference/panel-triggers.md' +- Tutorials: + - 'Building Host Dashboard': 'tutorials/host_dashboard.md' diff --git a/docs/img/.gitattributes b/docs/sources/img/.gitattributes similarity index 100% rename from docs/img/.gitattributes rename to docs/sources/img/.gitattributes diff --git a/docs/sources/img/installation-add_datasource.png b/docs/sources/img/installation-add_datasource.png new file mode 100644 index 0000000..1163c20 --- /dev/null +++ b/docs/sources/img/installation-add_datasource.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62deb035e0d9241c2ae9825b101c86d329766cf421a5e2555449f71420cb9891 +size 58575 diff --git a/docs/sources/img/installation-datasource_config.png b/docs/sources/img/installation-datasource_config.png new file mode 100644 index 0000000..36a86c1 --- /dev/null +++ b/docs/sources/img/installation-datasource_config.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5275ed470657abc2c9c0d648e1a24c0f1b3a029206f8aa9594009b837f3ec2f1 +size 50282 diff --git a/docs/sources/img/installation-test_connection.png b/docs/sources/img/installation-test_connection.png new file mode 100644 index 0000000..2260793 --- /dev/null +++ b/docs/sources/img/installation-test_connection.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:767ffe4d4385871847acb9c1b77b42f63144299810c5c97af2eee9057e19c6d7 +size 12828 diff --git a/docs/sources/img/installation-test_connection_error.png b/docs/sources/img/installation-test_connection_error.png new file mode 100644 index 0000000..ee85b01 --- /dev/null +++ b/docs/sources/img/installation-test_connection_error.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee8a5b214d169eb70f8c591cb0e64910b280ce1a8abe1fbf8ee4de26af81a809 +size 14287 diff --git a/docs/sources/index.md b/docs/sources/index.md index 5a16ee2..d5ea619 100644 --- a/docs/sources/index.md +++ b/docs/sources/index.md @@ -6,7 +6,7 @@ page_description: Introduction to Grafana-Zabbix. Grafana-Zabbix is a plugin bundle for Grafana allowing to visualize monitoring data from Zabbix and create dashboards for analyzing metrics and realtime monitoring. -## Community resources, feedback, and support +## Community Resources, Feedback, and Support Thousands of organizations large and small rely on Grafana, and we have a vibrant and active community that constantly inspires us. @@ -30,4 +30,4 @@ Or you can just send me [emai](mailto:alexanderzobnin@gmail.com). By utilizing this software, you agree to the terms of the included license. Grafana-Zabbix is licensed under the Apache 2.0 agreement. See [LICENSE](https://github.com/alexanderzobnin/grafana-zabbix/blob/master/LICENSE.md) for the full -license terms. \ No newline at end of file +license terms. diff --git a/docs/sources/installation/index.md b/docs/sources/installation/index.md index 26bf6b5..dea39fc 100644 --- a/docs/sources/installation/index.md +++ b/docs/sources/installation/index.md @@ -1,2 +1,118 @@ -page_title: About Grafana-Zabbix -page_description: Introduction to Grafana-Zabbix. \ No newline at end of file +page_title: Grafana-Zabbix Installation +page_description: Installation instructions for Grafana-Zabbix. + +# Installation +Download [latest release](https://github.com/alexanderzobnin/grafana-zabbix/releases/latest) +for relative Grafana version or just clone a repo: +``` +git clone https://github.com/alexanderzobnin/grafana-zabbix.git +``` + +## Copy into plugins directory +Copy content of `plugins` into your grafana plugins directory (default `/var/lib/grafana/plugins` +if your installing grafana with package). +Restart grafana-server and the plugin should be automatically detected and used. + +```sh +git clone https://github.com/alexanderzobnin/grafana-zabbix.git +cp -r ./grafana-zabbix/plugins/* /your/grafana/plugins/directory/ +sudo service grafana-server restart +``` + + +## Use directory of your choice + +By this way you can update plugin by simple `git pull` command. + +Edit your grafana.ini config file (Default location is at `/etc/grafana/grafana.ini`) +and add paths to plugins: + +```ini +[plugin.zabbix] +path = /home/your/clone/dir/plugins/datasource-zabbix + +[plugin.triggers] +path = /home/your/clone/dir/plugins/panel-triggers +``` + +Note that if you copy it into the grafana plugins directory you do not need to add the above +config option. That is only +if you want to place the plugin in a directory outside the standard plugins directory. +Be aware that grafana-server +needs read access to the directory. + +# Configuration + +To add new Zabbix data source open _Data Sources_ in side panel, click _Add new_ and select Zabbix +from dropdown list. + +![Add zabbix data source](../img/installation-add_datasource.png) + +Then configure a data source + +![Configure zabbix data source](../img/installation-datasource_config.png) + +### Http settings + +- **Url**: set Zabbix API url (full path with `api_jsonrpc.php`). +- **Access**: can be either _proxy_ or _direct_. +- **Http Auth**: configure if you use proxy authentication. + - **Basic Auth**: + - **With Credentials**: + +### Zabbiz API details + +- **User** and **Password**: setup login for access to Zabbix API. Also check user's permissions +in Zabbix if you can't get any groups and hosts in Grafana. +- **Trends**: enable if you use patch for trends +support in Zabbix 2.x ([ZBXNEXT-1193](https://support.zabbix.com/browse/ZBXNEXT-1193)). This is +strictly recommended for displaying long time periods (more than few days, depending of your item's +updating interval in Zabbix) because few days of item history contains tons of points. Using trends +can increase Grafana performance. + - **Use trends from**: time after which trends will be used. Default is **7d** (7 days). + You can set the time in Grafana format. Valid time specificators are: + - **h** - hours + - **d** - days + - **M** - months +- **Metrics limit**: maximum items number which can be returned by one request. Helps to prevent +Grafana slowdown due wrong request. + +Then click _Add_ - datasource will be added and you can check connection using _Test Connection_ button. + +![Test Connection](../img/installation-test_connection.png) + +This feature can help to find some mistakes like invalid user name or password, wrong api url. + +![Test Connection - Error](../img/installation-test_connection_error.png) + + +## Note about 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: + +```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; +} +``` +before + +```php +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 details 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. diff --git a/docs/sources/installation/troubleshooting.md b/docs/sources/installation/troubleshooting.md new file mode 100644 index 0000000..a84d15c --- /dev/null +++ b/docs/sources/installation/troubleshooting.md @@ -0,0 +1,5 @@ +# 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. From f245c170300281c93cd06c1b4822234dbad09670 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Sun, 10 Jan 2016 18:24:01 +0300 Subject: [PATCH 6/8] Changed About page. --- docs/sources/index.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/sources/index.md b/docs/sources/index.md index d5ea619..a51280b 100644 --- a/docs/sources/index.md +++ b/docs/sources/index.md @@ -4,16 +4,15 @@ page_description: Introduction to Grafana-Zabbix. # About Grafana-Zabbix Grafana-Zabbix is a plugin bundle for Grafana allowing to visualize monitoring data from Zabbix -and create dashboards for analyzing metrics and realtime monitoring. +and create dashboards for analyzing metrics and realtime monitoring. The main goals of this project +is extend Zabbix capabilities for monitoring data visualization and provide quick and powerful way +to create dashboards. It is possible due both Grafana and Grafana-Zabbix plugin features. ## Community Resources, Feedback, and Support -Thousands of organizations large and small rely on Grafana, and we have a vibrant and active community that constantly inspires us. - -Please don't hesitate to [open a new issue on Github](https://github.com/grafana/grafana/issues) -with your suggestions, ideas, and bug reports. - -Most of the new features and improvements that go into Grafana come from our users. We greatly value your feedback and suggestions; we consider them paramount to making the product better! +This project is being started as a simple plugin for Grafana. But many powerful features and +improvements come from community. So don't hesitate to give any feedback and together we will make +this tool better. If you have any troubles with Grafana or you just want clarification on a feature, there are a number of ways to get help: From a035d1db6583ca510afa5291c30fe696374a38ce Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Sun, 10 Jan 2016 19:25:13 +0300 Subject: [PATCH 7/8] Added initial Feature Highlights page --- docs/mkdocs.yml | 1 + docs/sources/features.md | 11 +++++++++++ docs/sources/guides/gettingstarted.md | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 docs/sources/features.md create mode 100644 docs/sources/guides/gettingstarted.md diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 3399453..7397aaa 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -11,6 +11,7 @@ theme: readthedocs pages: - Project: - 'About Grafana-Zabbix': 'index.md' + - 'Feature Highlights': 'features.md' - Installation: - 'Installation and Configuration': 'installation/index.md' - 'Troubleshooting': 'installation/troubleshooting.md' diff --git a/docs/sources/features.md b/docs/sources/features.md new file mode 100644 index 0000000..9f91a5a --- /dev/null +++ b/docs/sources/features.md @@ -0,0 +1,11 @@ +page_title: Feature Highlights +page_description: Grafana-Zabbix Feature Highlights. + +# Feature Highlights + +Grafana in couple with Grafana-Zabbix plugin allows to create great dashboards. There is some +features: + +- Rich graphing with Grafana +- Template variables allow to create reusable dashboards + diff --git a/docs/sources/guides/gettingstarted.md b/docs/sources/guides/gettingstarted.md new file mode 100644 index 0000000..67236f1 --- /dev/null +++ b/docs/sources/guides/gettingstarted.md @@ -0,0 +1,3 @@ +# Getting Started with Grafana-Zabbix +After you [installed and configured](../installation/index.md) Grafana-Zabbix data source let's +create a simple dashboard. \ No newline at end of file From 4eb94ed3813ad153ce06f517dfc4ee747aa21c03 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Sun, 10 Jan 2016 20:29:14 +0300 Subject: [PATCH 8/8] Added builded docs dir to .gitignore --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 93706d6..55fcca7 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,7 @@ # Grafana linter config .jshintrc .jscs.json -.jsfmtrc \ No newline at end of file +.jsfmtrc + +# Builded docs +docs/site/