Merge branch 'docs'

This commit is contained in:
Alexander Zobnin
2016-11-17 21:26:22 +03:00
6 changed files with 126 additions and 0 deletions

View File

@@ -3,10 +3,13 @@ site_name: Grafana-Zabbix Documentation
#site_url: /
site_description: Documentation for Grafana-Zabbix, Zabbix monitoring system plugin bundle for Grafana
repo_url: https://github.com/alexanderzobnin/grafana-zabbix/
edit_uri: blob/master/docs/sources/
copyright: Copyright © 2015-2016, Alexander Zobnin
docs_dir: sources
theme: readthedocs
extra_css:
- css/custom.css
pages:
- Project:
@@ -19,6 +22,7 @@ pages:
- 'Troubleshooting': 'installation/troubleshooting.md'
- User Guides:
- 'Getting Started': 'guides/gettingstarted.md'
- 'Templating': 'guides/templating.md'
- Reference:
- 'Zabbix Datasource': 'reference/datasource-zabbix.md'
- 'Triggers Panel': 'reference/panel-triggers.md'

View File

@@ -0,0 +1,38 @@
.wy-side-nav-search, .wy-nav-top {
background-color: #8e3030
}
p {
margin-bottom: 24px;
}
.rst-content blockquote {
margin-left: 0px;
padding: 0 1em;
color: #777;
border-left: 0.25em solid #ddd;
}
code, .rst-content tt {
font-size: 85%;
color: #404040;
background-color: #f4f4f4;
padding: 1px 5px;
border-radius: 2px;
}
.hljs {
font-size: 100%;
line-height: 1.5;
padding: 1em 0.5em;
border-radius: 4px;
border-color: #f4f4f4;
}
.btn-neutral:hover {
background-color: #8e3030 !important;
color: #f4f4f4 !important;
box-shadow:
0px 1px 2px -1px rgba(255,255,255,0.5) inset,
0px -2px 0px 0px rgba(0, 0, 0, 0.2) inset;
}

View File

@@ -0,0 +1,75 @@
# Templating Guide
You can use template variables for creating highly reusable and interactive dashboards. General idea of templating is allow Grafana to get different metrics from data source and provide a way to change it on the fly without modifying dashboard. In case of Zabbix it means that you can get list of Host Groups, Hosts, Applications or Items and add it as a variables.
## Creating Variable
To create template variable click the cog icon on the top navigation bar and choose _Templating_.
![Templating menu](../img/templating-menu.png)
When you click _New_ button, you'll see template variable editor. It contains these sections:
![Variable editor](../img/templating-variable_editor.png)
### Variable
**Name**
Name of the variable. You should use this name in queries.
**Label**
Visible label for variable. Use when you want to display different name on dashboard. For instance, _Host Group_ instead *host_group*.
**Type**
By default _Query_ type is selected. It means that Grafana asks data source for values of variable. But there are some other types: _Interval_ (just a time interval), _Data source_ (You can switch data source, for example, if you have more than one Zabbix instance and each added into Grafana as data source), _Custom_ (you can set any predefined values for variable) and _Constant_.
### Query Options
**Data source**
Data source used for querying variable values.
**Refresh**
When to update the values of this variable.
**Query**
Query string.
**Regex**
Use regex if you need to filter values or extract a part of value.
### Selection Options
**Multi-value**
Enable, if you want to select multiple values at the same time.
### Value groups/tags (Experimental feature)
## Query Format
Template variable query in Zabbix data source is a string which contains 4 parts divided by period (`.`):
```
{host group}.{host}.{application}.{item name}
```
For example, `Zabbix servers.Zabbix server.CPU.*`
Each part can be a name of corresponding metric or `*`, which means _all metrics_.
Examples:
- `*` returns list of all available Host Groups
- `*.*` all hosts in Zabbix
- `Network.*` returns all hosts in group Network
- `Linux servers.*.*` returns all applications from hosts in Linux servers group
- `Linux servers.backend01.CPU.*` returns all items from backend01 belonging to CPU application.
You can use another variable as a part of query. For instance, you have variable _group_, which returns list of host groups and want to use it for querying hosts in selected group only. Here's a query for this case:
```
$group.*
```
## Variables Usage
When you create a variable, you can use it as a part of data source query. Grafana also supports variables in different places like panel's and row's titles, Text panel's content, etc.
![Query with variables](../img/templating-query_with_variables.png)
> Note, that you should add `$` sign before variable's name (**$host** for _host_ variable).
See more about templating in [Grafana docs](http://docs.grafana.org/reference/templating)

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f8ac9a48403b9ad670c3739e81292ff247cd105016695d1dcc8b5fd5e3325c00
size 87143

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7946b4eb820f5256e8aadf053b55e4a2061619888f2283516cf78b09ab179a83
size 513234

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3ceea183bd12e5b28161f75c40df2530069831a8a8db12b4484a76fb1f88e8e9
size 641375