Merge pull request #1763 from grafana/docs-website-update
Docs website update
2
.github/pull_request_template.md
vendored
@@ -1,6 +1,6 @@
|
|||||||
* Link the PR to the related issue
|
* Link the PR to the related issue
|
||||||
* If there's no issue for the PR, please, create it first
|
* If there's no issue for the PR, please, create it first
|
||||||
* Rebase your PR if it gets out of sync with master
|
* Rebase your PR if it gets out of sync with main
|
||||||
* Ensure your PR does not include dist/ directory
|
* Ensure your PR does not include dist/ directory
|
||||||
|
|
||||||
**REMOVE THE TEXT ABOVE BEFORE CREATING THE PULL REQUEST**
|
**REMOVE THE TEXT ABOVE BEFORE CREATING THE PULL REQUEST**
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## [4.4.5] - 2024-01-10
|
||||||
|
|
||||||
|
- ⚙️ **Docs**: Documentation website moved from [github pages](https://grafana.github.io/grafana-zabbix) to [grafana.com/docs/plugins](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/) page
|
||||||
|
|
||||||
## [4.4.4] - 2023-11-21
|
## [4.4.4] - 2023-11-21
|
||||||
|
|
||||||
### Feature
|
### Feature
|
||||||
@@ -661,7 +665,7 @@ option description for more information.
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Template query format. New format is `{group}{host}{app}{item}`. It allows to use names with dot. Updated
|
- Template query format. New format is `{group}{host}{app}{item}`. It allows to use names with dot. Updated
|
||||||
[templating docs](https://alexanderzobnin.github.io/grafana-zabbix/guides/templating/#query-format),
|
[templating docs](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/templating#query-format),
|
||||||
[#254](https://github.com/alexanderzobnin/grafana-zabbix/issues/254)
|
[#254](https://github.com/alexanderzobnin/grafana-zabbix/issues/254)
|
||||||
- Update included dashboards. Add templated zabbix datasource and use it for all metrics.
|
- Update included dashboards. Add templated zabbix datasource and use it for all metrics.
|
||||||
- Improved performance of groupBy() functions (at 6-10x faster than old).
|
- Improved performance of groupBy() functions (at 6-10x faster than old).
|
||||||
|
|||||||
2
LICENSE
@@ -186,7 +186,7 @@
|
|||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright 2015-2016 Alexander Zobnin <alexanderzobnin@gmail.com>
|
Copyright 2024 Grafana Labs (https://grafana.com)
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
28
README.md
@@ -1,19 +1,19 @@
|
|||||||
# Zabbix plugin for Grafana
|
# Zabbix plugin for Grafana
|
||||||
|
|
||||||
[](https://github.com/grafana/grafana-zabbix/releases)
|
[](https://github.com/grafana/grafana-zabbix/releases)
|
||||||
[](https://github.com/grafana/grafana-zabbix/blob/master/CHANGELOG.md)
|
[](https://github.com/grafana/grafana-zabbix/blob/main/CHANGELOG.md)
|
||||||
[](https://grafana.github.io/grafana-zabbix)
|
[](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Select multiple metrics [by using Regex](https://grafana.github.io/grafana-zabbix/guides/gettingstarted/#multiple-items-on-one-graph)
|
- Select multiple metrics [by using Regex](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/guides/gettingstarted/#multiple-items-on-one-graph)
|
||||||
- Create interactive and reusable dashboards with [template variables](https://grafana.github.io/grafana-zabbix/guides/templating/)
|
- Create interactive and reusable dashboards with [template variables](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/guides/templating/)
|
||||||
- Show events on graphs with [Annotations](http://docs.grafana.org/reference/annotations/)
|
- Show events on graphs with [Annotations](http://docs.grafana.org/reference/annotations/)
|
||||||
- Display active problems with Triggers panel
|
- Display active problems with Triggers panel
|
||||||
- Transform and shape your data with [metric processing functions](https://grafana.github.io/grafana-zabbix/reference/functions/) (Avg, Median, Min, Max, Multiply, Summarize, Time shift, Alias)
|
- Transform and shape your data with [metric processing functions](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/reference/functions/) (Avg, Median, Min, Max, Multiply, Summarize, Time shift, Alias)
|
||||||
- Find problems faster with [Alerting](https://grafana.github.io/grafana-zabbix/reference/alerting/) feature
|
- Find problems faster with [Alerting](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/reference/alerting/) feature
|
||||||
- Mix metrics from multiple data sources in the same dashboard or even graph
|
- Mix metrics from multiple data sources in the same dashboard or even graph
|
||||||
- Discover and share [dashboards](https://grafana.com/dashboards) in the official library
|
- Discover and share [dashboards](https://grafana.com/dashboards) in the official library
|
||||||
|
|
||||||
@@ -28,20 +28,20 @@ Install by using `grafana-cli`
|
|||||||
grafana-cli plugins install alexanderzobnin-zabbix-app
|
grafana-cli plugins install alexanderzobnin-zabbix-app
|
||||||
```
|
```
|
||||||
|
|
||||||
Or see more installation options in [docs](https://grafana.github.io/grafana-zabbix/installation/).
|
Or see more installation options in [docs](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/installation/).
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
First, [configure](https://grafana.github.io/grafana-zabbix/configuration/) Zabbix data source. Then you can create your first dashboard with step-by-step [Getting started guide](https://grafana.github.io/grafana-zabbix/guides/gettingstarted/).
|
First, [configure](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/configuration/) Zabbix data source. Then you can create your first dashboard with step-by-step [Getting started guide](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/guides/gettingstarted/).
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
- [About](https://grafana.github.io/grafana-zabbix)
|
- [About](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/)
|
||||||
- [Installation](https://grafana.github.io/grafana-zabbix/installation)
|
- [Installation](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/installation)
|
||||||
- [Getting Started](https://grafana.github.io/grafana-zabbix/guides/gettingstarted)
|
- [Getting Started](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/guides/gettingstarted)
|
||||||
- [Templating](https://grafana.github.io/grafana-zabbix/guides/templating)
|
- [Templating](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/guides/templating)
|
||||||
- [Alerting](https://grafana.github.io/grafana-zabbix/reference/alerting/)
|
- [Alerting](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/reference/alerting/)
|
||||||
- [Metric processing functions](https://grafana.github.io/grafana-zabbix/reference/functions/)
|
- [Metric processing functions](https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/reference/functions/)
|
||||||
|
|
||||||
## Community Resources, Feedback, and Support
|
## Community Resources, Feedback, and Support
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,6 @@
|
|||||||
"templating",
|
"templating",
|
||||||
"singlestat",
|
"singlestat",
|
||||||
"iowait",
|
"iowait",
|
||||||
"mkdocs",
|
|
||||||
"submatch",
|
"submatch",
|
||||||
"Gleb",
|
"Gleb",
|
||||||
"Ivanovsky",
|
"Ivanovsky",
|
||||||
|
|||||||
8
docs/Makefile
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
.ONESHELL:
|
||||||
|
.DELETE_ON_ERROR:
|
||||||
|
export SHELL := bash
|
||||||
|
export SHELLOPTS := pipefail:errexit
|
||||||
|
MAKEFLAGS += --warn-undefined-variables
|
||||||
|
MAKEFLAGS += --no-builtin-rule
|
||||||
|
|
||||||
|
include docs.mk
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# Grafana-Zabbix Documentation
|
|
||||||
|
|
||||||
## Building docs
|
|
||||||
To build this docs on your computer you need [git-lfs](https://git-lfs.github.com/) and [mkdocs](http://www.mkdocs.org/) installed.
|
|
||||||
|
|
||||||
Clone repo
|
|
||||||
```
|
|
||||||
git clone https://github.com/alexanderzobnin/grafana-zabbix
|
|
||||||
```
|
|
||||||
Check images in `docs/sources/img/`. If this folder is empty, run
|
|
||||||
```
|
|
||||||
git lfs fetch --all
|
|
||||||
```
|
|
||||||
|
|
||||||
Build docs
|
|
||||||
```
|
|
||||||
cd docs/
|
|
||||||
mkdocs build --clean
|
|
||||||
```
|
|
||||||
|
|
||||||
Built docs will be placed in `site/` directory.
|
|
||||||
112
docs/docs.mk
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
# The source of this file is https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/docs.mk.
|
||||||
|
# A changelog is included in the head of the `make-docs` script.
|
||||||
|
include variables.mk
|
||||||
|
-include variables.mk.local
|
||||||
|
|
||||||
|
.ONESHELL:
|
||||||
|
.DELETE_ON_ERROR:
|
||||||
|
export SHELL := bash
|
||||||
|
export SHELLOPTS := pipefail:errexit
|
||||||
|
MAKEFLAGS += --warn-undefined-variables
|
||||||
|
MAKEFLAGS += --no-builtin-rule
|
||||||
|
|
||||||
|
.DEFAULT_GOAL: help
|
||||||
|
|
||||||
|
# Adapted from https://www.thapaliya.com/en/writings/well-documented-makefiles/
|
||||||
|
.PHONY: help
|
||||||
|
help: ## Display this help.
|
||||||
|
help:
|
||||||
|
@awk 'BEGIN { \
|
||||||
|
FS = ": ##"; \
|
||||||
|
printf "Usage:\n make <target>\n\nTargets:\n" \
|
||||||
|
} \
|
||||||
|
/^[a-zA-Z0-9_\.\-\/%]+: ##/ { printf " %-15s %s\n", $$1, $$2 }' \
|
||||||
|
$(MAKEFILE_LIST)
|
||||||
|
|
||||||
|
GIT_ROOT := $(shell git rev-parse --show-toplevel)
|
||||||
|
|
||||||
|
PODMAN := $(shell if command -v podman >/dev/null 2>&1; then echo podman; else echo docker; fi)
|
||||||
|
|
||||||
|
ifeq ($(PROJECTS),)
|
||||||
|
$(error "PROJECTS variable must be defined in variables.mk")
|
||||||
|
endif
|
||||||
|
|
||||||
|
# First project is considered the primary one used for doc-validator.
|
||||||
|
PRIMARY_PROJECT := $(subst /,-,$(firstword $(subst :, ,$(firstword $(PROJECTS)))))
|
||||||
|
|
||||||
|
# Host port to publish container port to.
|
||||||
|
ifeq ($(origin DOCS_HOST_PORT), undefined)
|
||||||
|
export DOCS_HOST_PORT := 3002
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Container image used to perform Hugo build.
|
||||||
|
ifeq ($(origin DOCS_IMAGE), undefined)
|
||||||
|
export DOCS_IMAGE := grafana/docs-base:latest
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Container image used for doc-validator linting.
|
||||||
|
ifeq ($(origin DOC_VALIDATOR_IMAGE), undefined)
|
||||||
|
export DOC_VALIDATOR_IMAGE := grafana/doc-validator:latest
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Container image used for vale linting.
|
||||||
|
ifeq ($(origin VALE_IMAGE), undefined)
|
||||||
|
export VALE_IMAGE := grafana/vale:latest
|
||||||
|
endif
|
||||||
|
|
||||||
|
# PATH-like list of directories within which to find projects.
|
||||||
|
# If all projects are checked out into the same directory, ~/repos/ for example, then the default should work.
|
||||||
|
ifeq ($(origin REPOS_PATH), undefined)
|
||||||
|
export REPOS_PATH := $(realpath $(GIT_ROOT)/..)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# How to treat Hugo relref errors.
|
||||||
|
ifeq ($(origin HUGO_REFLINKSERRORLEVEL), undefined)
|
||||||
|
export HUGO_REFLINKSERRORLEVEL := WARNING
|
||||||
|
endif
|
||||||
|
|
||||||
|
.PHONY: docs-rm
|
||||||
|
docs-rm: ## Remove the docs container.
|
||||||
|
$(PODMAN) rm -f $(DOCS_CONTAINER)
|
||||||
|
|
||||||
|
.PHONY: docs-pull
|
||||||
|
docs-pull: ## Pull documentation base image.
|
||||||
|
$(PODMAN) pull -q $(DOCS_IMAGE)
|
||||||
|
|
||||||
|
make-docs: ## Fetch the latest make-docs script.
|
||||||
|
make-docs:
|
||||||
|
if [[ ! -f "$(CURDIR)/make-docs" ]]; then
|
||||||
|
echo 'WARN: No make-docs script found in the working directory. Run `make update` to download it.' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
.PHONY: docs
|
||||||
|
docs: ## Serve documentation locally, which includes pulling the latest `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image. See also `docs-no-pull`.
|
||||||
|
docs: docs-pull make-docs
|
||||||
|
$(CURDIR)/make-docs $(PROJECTS)
|
||||||
|
|
||||||
|
.PHONY: docs-no-pull
|
||||||
|
docs-no-pull: ## Serve documentation locally without pulling the `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image.
|
||||||
|
docs-no-pull: make-docs
|
||||||
|
$(CURDIR)/make-docs $(PROJECTS)
|
||||||
|
|
||||||
|
.PHONY: docs-debug
|
||||||
|
docs-debug: ## Run Hugo web server with debugging enabled. TODO: support all SERVER_FLAGS defined in website Makefile.
|
||||||
|
docs-debug: make-docs
|
||||||
|
WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(CURDIR)/make-docs $(PROJECTS)
|
||||||
|
|
||||||
|
.PHONY: doc-validator
|
||||||
|
doc-validator: ## Run doc-validator on the entire docs folder.
|
||||||
|
doc-validator: make-docs
|
||||||
|
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(CURDIR)/make-docs $(PROJECTS)
|
||||||
|
|
||||||
|
.PHONY: vale
|
||||||
|
vale: ## Run vale on the entire docs folder.
|
||||||
|
vale: make-docs
|
||||||
|
DOCS_IMAGE=$(VALE_IMAGE) $(CURDIR)/make-docs $(PROJECTS)
|
||||||
|
|
||||||
|
.PHONY: update
|
||||||
|
update: ## Fetch the latest version of this Makefile and the `make-docs` script from Writers' Toolkit.
|
||||||
|
curl -s -LO https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/docs.mk
|
||||||
|
curl -s -LO https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/make-docs
|
||||||
|
chmod +x make-docs
|
||||||
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 596 KiB After Width: | Height: | Size: 596 KiB |
|
Before Width: | Height: | Size: 405 KiB After Width: | Height: | Size: 405 KiB |
|
Before Width: | Height: | Size: 480 KiB After Width: | Height: | Size: 480 KiB |
|
Before Width: | Height: | Size: 535 KiB After Width: | Height: | Size: 535 KiB |
|
Before Width: | Height: | Size: 443 KiB After Width: | Height: | Size: 443 KiB |
|
Before Width: | Height: | Size: 440 KiB After Width: | Height: | Size: 440 KiB |
|
Before Width: | Height: | Size: 705 KiB After Width: | Height: | Size: 705 KiB |
|
Before Width: | Height: | Size: 459 KiB After Width: | Height: | Size: 459 KiB |
|
Before Width: | Height: | Size: 377 KiB After Width: | Height: | Size: 377 KiB |
|
Before Width: | Height: | Size: 530 KiB After Width: | Height: | Size: 530 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 128 KiB |
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 195 KiB After Width: | Height: | Size: 195 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 501 KiB After Width: | Height: | Size: 501 KiB |
|
Before Width: | Height: | Size: 626 KiB After Width: | Height: | Size: 626 KiB |
800
docs/make-docs
Executable file
@@ -0,0 +1,800 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# The source of this file is https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/make-docs.
|
||||||
|
# # `make-docs` procedure changelog
|
||||||
|
#
|
||||||
|
# Updates should conform to the guidelines in https://keepachangelog.com/en/1.1.0/.
|
||||||
|
# [Semantic versioning](https://semver.org/) is used to help the reader identify the significance of changes.
|
||||||
|
# Changes are relevant to this script and the support docs.mk GNU Make interface.
|
||||||
|
#
|
||||||
|
|
||||||
|
# ## 5.1.2 (2023-11-08)
|
||||||
|
#
|
||||||
|
# ### Added
|
||||||
|
#
|
||||||
|
# - Hide manual_mount warning messages from non-debug output.
|
||||||
|
# Set the DEBUG environment variable to see all hidden messages.
|
||||||
|
#
|
||||||
|
# ## 5.1.1 (2023-10-30)
|
||||||
|
#
|
||||||
|
# ### Added
|
||||||
|
#
|
||||||
|
# - Support for Datadog and Oracle data source plugins repositories.
|
||||||
|
#
|
||||||
|
# ## 5.1.0 (2023-10-20)
|
||||||
|
#
|
||||||
|
# ### Added
|
||||||
|
#
|
||||||
|
# - Support for the plugins monorepo.
|
||||||
|
#
|
||||||
|
# ## 5.0.0 (2023-10-18)
|
||||||
|
#
|
||||||
|
# ### Added
|
||||||
|
#
|
||||||
|
# - Improved support for website repository.
|
||||||
|
#
|
||||||
|
# Mount more content and provide some feedback to users that the build can take time.
|
||||||
|
#
|
||||||
|
# - Ability to enter the `grafana/docs-base` container with a shell using the `ENTER` environment variable.
|
||||||
|
#
|
||||||
|
# ### Fixed
|
||||||
|
#
|
||||||
|
# - Correct key combination for interrupting the process.
|
||||||
|
#
|
||||||
|
# Keyboards use capital letters so this more accurately reflects the exact key combination users are expected to press.
|
||||||
|
#
|
||||||
|
# ### Removed
|
||||||
|
#
|
||||||
|
# - Imperfect implementation of container name.
|
||||||
|
#
|
||||||
|
# Facilitates running `make vale` and `make docs` at once.
|
||||||
|
# Container names are convenient for recognition in `docker ps` but the current implementation has more downsides than upsides.
|
||||||
|
#
|
||||||
|
# - Forced platform specification now that multiple architecture images exist.
|
||||||
|
#
|
||||||
|
# Significantly speeds up build times on larger repositories.
|
||||||
|
#
|
||||||
|
# ## 4.2.2 (2023-10-05)
|
||||||
|
|
||||||
|
# - Added support for Jira data source and MongoDB data source plugins repositories.
|
||||||
|
#
|
||||||
|
# ## 4.2.1 (2023-09-13)
|
||||||
|
|
||||||
|
# ## Fixed
|
||||||
|
#
|
||||||
|
# - Improved consistency of the webserver request loop by polling the Hugo port rather than the proxy port.
|
||||||
|
#
|
||||||
|
# ## 4.2.0 (2023-09-01)
|
||||||
|
#
|
||||||
|
# ### Added
|
||||||
|
#
|
||||||
|
# - Retry the initial webserver request up to ten times to allow for the process to start.
|
||||||
|
# If it is still failing after ten seconds, an error message is logged.
|
||||||
|
#
|
||||||
|
# ## 4.1.1 (2023-07-20)
|
||||||
|
#
|
||||||
|
# ### Fixed
|
||||||
|
#
|
||||||
|
# - Replaced use of `realpath` with POSIX compatible alternative to determine default value for REPOS_PATH.
|
||||||
|
#
|
||||||
|
# ## 4.1.0 (2023-06-16)
|
||||||
|
#
|
||||||
|
# ### Added
|
||||||
|
#
|
||||||
|
# - Mounts of `layouts` and `config` directories for the `website` project.
|
||||||
|
# Ensures that local changes to mounts or shortcodes are reflected in the development server.
|
||||||
|
#
|
||||||
|
# ### Fixed
|
||||||
|
#
|
||||||
|
# - Version inference for versioned docs pages.
|
||||||
|
# Pages in versioned projects now have the `versioned: true` front matter set to ensure that "version" in $.Page.Scratch is set on builds.
|
||||||
|
#
|
||||||
|
# ## 4.0.0 (2023-06-06)
|
||||||
|
#
|
||||||
|
# ### Removed
|
||||||
|
#
|
||||||
|
# - `doc-validator/%` target.
|
||||||
|
# The behavior of the target was not as described.
|
||||||
|
# Instead, to limit `doc-validator` to only specific files, refer to https://grafana.com/docs/writers-toolkit/writing-guide/tooling-and-workflows/validate-technical-documentation/#run-on-specific-files.
|
||||||
|
#
|
||||||
|
# ## 3.0.0 (2023-05-18)
|
||||||
|
#
|
||||||
|
# ### Fixed
|
||||||
|
#
|
||||||
|
# - Compatibility with the updated Make targets in the `website` repository.
|
||||||
|
# `docs` now runs this script itself, `server-docs` builds the site with the `docs` Hugo environment.
|
||||||
|
#
|
||||||
|
# ## 2.0.0 (2023-05-18)
|
||||||
|
#
|
||||||
|
# ### Added
|
||||||
|
#
|
||||||
|
# - Support for the grafana-cloud/frontend-observability/faro-web-sdk project.
|
||||||
|
# - Use of `doc-validator` v2.0.x which includes breaking changes to command line options.
|
||||||
|
#
|
||||||
|
# ### Fixed
|
||||||
|
#
|
||||||
|
# - Source grafana-cloud project from website repository.
|
||||||
|
#
|
||||||
|
# ### Added
|
||||||
|
#
|
||||||
|
# - Support for running the Vale linter with `make vale`.
|
||||||
|
#
|
||||||
|
# ## 1.2.1 (2023-05-05)
|
||||||
|
#
|
||||||
|
# ### Fixed
|
||||||
|
#
|
||||||
|
# - Use `latest` tag of `grafana/vale` image by default instead of hardcoded older version.
|
||||||
|
# - Fix mounting multiple projects broken by the changes in 1.0.1
|
||||||
|
#
|
||||||
|
# ## 1.2.0 (2023-05-05)
|
||||||
|
#
|
||||||
|
# ### Added
|
||||||
|
#
|
||||||
|
# - Support for running the Vale linter with `make vale`.
|
||||||
|
#
|
||||||
|
# ### Fixed
|
||||||
|
#
|
||||||
|
# ## 1.1.0 (2023-05-05)
|
||||||
|
#
|
||||||
|
# ### Added
|
||||||
|
#
|
||||||
|
# - Rewrite error output so it can be followed by text editors.
|
||||||
|
#
|
||||||
|
# ### Fixed
|
||||||
|
#
|
||||||
|
# - Fix `docs-debug` container process port.
|
||||||
|
#
|
||||||
|
# ## 1.0.1 (2023-05-04)
|
||||||
|
#
|
||||||
|
# ### Fixed
|
||||||
|
#
|
||||||
|
# - Ensure complete section hierarchy so that all projects have a visible menu.
|
||||||
|
#
|
||||||
|
# ## 1.0.0 (2023-05-04)
|
||||||
|
#
|
||||||
|
# ### Added
|
||||||
|
#
|
||||||
|
# - Build multiple projects simultaneously if all projects are checked out locally.
|
||||||
|
# - Run [`doc-validator`](https://github.com/grafana/technical-documentation/tree/main/tools/cmd/doc-validator) over projects.
|
||||||
|
# - Redirect project root to mounted version.
|
||||||
|
# For example redirect `/docs/grafana/` to `/docs/grafana/latest/`.
|
||||||
|
# - Support for Podman or Docker containers with `PODMAN` environment variable.
|
||||||
|
# - Support for projects:
|
||||||
|
# - agent
|
||||||
|
# - enterprise-logs
|
||||||
|
# - enterprise-metrics
|
||||||
|
# - enterprise-traces
|
||||||
|
# - grafana
|
||||||
|
# - grafana-cloud
|
||||||
|
# - grafana-cloud/machine-learning
|
||||||
|
# - helm-charts/mimir-distributed
|
||||||
|
# - helm-charts/tempo-distributed
|
||||||
|
# - incident
|
||||||
|
# - loki
|
||||||
|
# - mimir
|
||||||
|
# - oncall
|
||||||
|
# - opentelemetry
|
||||||
|
# - phlare
|
||||||
|
# - plugins
|
||||||
|
# - slo
|
||||||
|
# - tempo
|
||||||
|
# - writers-toolkit
|
||||||
|
|
||||||
|
|
||||||
|
set -ef
|
||||||
|
|
||||||
|
readonly DOCS_HOST_PORT="${DOCS_HOST_PORT:-3002}"
|
||||||
|
readonly DOCS_IMAGE="${DOCS_IMAGE:-grafana/docs-base:latest}"
|
||||||
|
|
||||||
|
readonly DOC_VALIDATOR_INCLUDE="${DOC_VALIDATOR_INCLUDE:-.+\.md$}"
|
||||||
|
readonly DOC_VALIDATOR_SKIP_CHECKS="${DOC_VALIDATOR_SKIP_CHECKS:-^image-}"
|
||||||
|
|
||||||
|
readonly HUGO_REFLINKSERRORLEVEL="${HUGO_REFLINKSERRORLEVEL:-WARNING}"
|
||||||
|
readonly VALE_MINALERTLEVEL="${VALE_MINALERTLEVEL:-error}"
|
||||||
|
readonly WEBSITE_EXEC="${WEBSITE_EXEC:-make server-docs}"
|
||||||
|
# If set, the docs-base image will run a prebuild script that sets up Hugo mounts.
|
||||||
|
readonly WEBSITE_MOUNTS="${WEBSITE_MOUNTS:-}"
|
||||||
|
|
||||||
|
PODMAN="$(if command -v podman >/dev/null 2>&1; then echo podman; else echo docker; fi)"
|
||||||
|
|
||||||
|
if ! command -v curl >/dev/null 2>&1; then
|
||||||
|
if ! command -v wget >/dev/null 2>&1; then
|
||||||
|
errr 'either `curl` or `wget` must be installed for this script to work.'
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v "${PODMAN}" >/dev/null 2>&1; then
|
||||||
|
errr 'either `podman` or `docker` must be installed for this script to work.'
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
about() {
|
||||||
|
cat <<EOF
|
||||||
|
Test documentation locally with multiple source repositories.
|
||||||
|
|
||||||
|
The REPOS_PATH environment variable is a colon (:) separated list of paths in which to look for project repositories.
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<EOF
|
||||||
|
Usage:
|
||||||
|
REPOS_PATH=<PATH[:<PATH>...]> $0 [<PROJECT>[:<VERSION>[:<REPO>[:<DIR>]]]...]
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
REPOS_PATH=~/ext/grafana/ $0 writers-toolkit tempo:latest helm-charts/mimir-distributed:latest:mimir:docs/sources/mimir-distributed
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ $# -lt 1 ]; then
|
||||||
|
cat <<EOF >&2
|
||||||
|
ERRR: arguments required but not supplied.
|
||||||
|
|
||||||
|
$(about)
|
||||||
|
|
||||||
|
$(usage)
|
||||||
|
EOF
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
readonly REPOS_PATH="${REPOS_PATH:-$(cd "$(git rev-parse --show-toplevel)/.." && echo "${PWD}")}"
|
||||||
|
|
||||||
|
if [ -z "${REPOS_PATH}" ]; then
|
||||||
|
cat <<EOF >&2
|
||||||
|
ERRR: REPOS_PATH environment variable is required but has not been provided.
|
||||||
|
|
||||||
|
$(usage)
|
||||||
|
EOF
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
SOURCES_as_code='as-code-docs'
|
||||||
|
SOURCES_enterprise_metrics='backend-enterprise'
|
||||||
|
SOURCES_enterprise_metrics_='backend-enterprise'
|
||||||
|
SOURCES_grafana_cloud='website'
|
||||||
|
SOURCES_grafana_cloud_alerting_and_irm_machine_learning='machine-learning'
|
||||||
|
SOURCES_grafana_cloud_alerting_and_irm_slo='slo'
|
||||||
|
SOURCES_grafana_cloud_k6='k6-docs'
|
||||||
|
SOURCES_grafana_cloud_data_configuration_integrations='cloud-onboarding'
|
||||||
|
SOURCES_grafana_cloud_frontend_observability_faro_web_sdk='faro-web-sdk'
|
||||||
|
SOURCES_helm_charts_mimir_distributed='mimir'
|
||||||
|
SOURCES_helm_charts_tempo_distributed='tempo'
|
||||||
|
SOURCES_opentelemetry='opentelemetry-docs'
|
||||||
|
SOURCES_plugins_grafana_datadog_datasource='datadog-datasource'
|
||||||
|
SOURCES_plugins_grafana_jira_datasource='jira-datasource'
|
||||||
|
SOURCES_plugins_grafana_mongodb_datasource='mongodb-datasource'
|
||||||
|
SOURCES_plugins_grafana_oracle_datasource='oracle-datasource'
|
||||||
|
SOURCES_plugins_grafana_splunk_datasource='splunk-datasource'
|
||||||
|
SOURCES_plugins_yesoreyeram_infinity_datasource='infinity'
|
||||||
|
SOURCES_plugins_alexanderzobnin_zabbix_app='zabbix'
|
||||||
|
|
||||||
|
VERSIONS_as_code='UNVERSIONED'
|
||||||
|
VERSIONS_grafana_cloud='UNVERSIONED'
|
||||||
|
VERSIONS_grafana_cloud_alerting_and_irm_machine_learning='UNVERSIONED'
|
||||||
|
VERSIONS_grafana_cloud_alerting_and_irm_slo='UNVERSIONED'
|
||||||
|
VERSIONS_grafana_cloud_k6='UNVERSIONED'
|
||||||
|
VERSIONS_grafana_cloud_data_configuration_integrations='UNVERSIONED'
|
||||||
|
VERSIONS_grafana_cloud_frontend_observability_faro_web_sdk='UNVERSIONED'
|
||||||
|
VERSIONS_opentelemetry='UNVERSIONED'
|
||||||
|
VERSIONS_plugins_grafana_datadog_datasource='latest'
|
||||||
|
VERSIONS_plugins_grafana_jira_datasource='latest'
|
||||||
|
VERSIONS_plugins_grafana_mongodb_datasource='latest'
|
||||||
|
VERSIONS_plugins_grafana_oracle_datasource='latest'
|
||||||
|
VERSIONS_plugins_grafana_splunk_datasource='latest'
|
||||||
|
VERSIONS_plugins_yesoreyeram_infinity_datasource='latest'
|
||||||
|
VERSIONS_plugins_alexanderzobnin_zabbix_app='latest'
|
||||||
|
VERSIONS_technical_documentation='UNVERSIONED'
|
||||||
|
VERSIONS_website='UNVERSIONED'
|
||||||
|
VERSIONS_writers_toolkit='UNVERSIONED'
|
||||||
|
|
||||||
|
PATHS_grafana_cloud='content/docs/grafana-cloud'
|
||||||
|
PATHS_helm_charts_mimir_distributed='docs/sources/helm-charts/mimir-distributed'
|
||||||
|
PATHS_helm_charts_tempo_distributed='docs/sources/helm-charts/tempo-distributed'
|
||||||
|
PATHS_mimir='docs/sources/mimir'
|
||||||
|
PATHS_plugins_grafana_datadog_datasource='docs/sources'
|
||||||
|
PATHS_plugins_grafana_jira_datasource='docs/sources'
|
||||||
|
PATHS_plugins_grafana_mongodb_datasource='docs/sources'
|
||||||
|
PATHS_plugins_grafana_oracle_datasource='docs/sources'
|
||||||
|
PATHS_plugins_grafana_splunk_datasource='docs/sources'
|
||||||
|
PATHS_plugins_yesoreyeram_infinity_datasource='docs/sources'
|
||||||
|
PATHS_plugins_alexanderzobnin_zabbix_app='docs/sources'
|
||||||
|
PATHS_tempo='docs/sources/tempo'
|
||||||
|
PATHS_website='content'
|
||||||
|
|
||||||
|
# identifier STR
|
||||||
|
# Replace characters that are not valid in an identifier with underscores.
|
||||||
|
identifier() {
|
||||||
|
echo "$1" | tr -C '[:alnum:]_\n' '_'
|
||||||
|
}
|
||||||
|
|
||||||
|
# aget ARRAY KEY
|
||||||
|
# Get the value of KEY from associative array ARRAY.
|
||||||
|
# Characters that are not valid in an identifier are replaced with underscores.
|
||||||
|
aget() {
|
||||||
|
eval echo '$'"$(identifier "$1")_$(identifier "$2")"
|
||||||
|
}
|
||||||
|
|
||||||
|
# src returns the project source repository name for a project.
|
||||||
|
src() {
|
||||||
|
_project="$1"
|
||||||
|
|
||||||
|
case "${_project}" in
|
||||||
|
plugins/*)
|
||||||
|
if [ -z "$(aget SOURCES "${_project}")" ]; then
|
||||||
|
echo plugins-private
|
||||||
|
else
|
||||||
|
aget SOURCES "${_project}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [ -z "$(aget SOURCES "${_project}")" ]; then
|
||||||
|
echo "${_project}"
|
||||||
|
else
|
||||||
|
aget SOURCES "${_project}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
unset _project
|
||||||
|
}
|
||||||
|
|
||||||
|
# path returns the relative path within the repository that contain the docs for a project.
|
||||||
|
path() {
|
||||||
|
_project="$1"
|
||||||
|
|
||||||
|
case "${_project}" in
|
||||||
|
plugins/*)
|
||||||
|
if [ -z "$(aget PATHS "${_project}")" ]; then
|
||||||
|
echo "${_project}/docs/sources"
|
||||||
|
else
|
||||||
|
aget PATHS "${_project}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [ -z "$(aget PATHS "${_project}")" ]; then
|
||||||
|
echo "docs/sources"
|
||||||
|
else
|
||||||
|
aget PATHS "${_project}"
|
||||||
|
fi
|
||||||
|
esac
|
||||||
|
|
||||||
|
unset _project
|
||||||
|
}
|
||||||
|
|
||||||
|
# version returns the version for a project. Unversioned projects return the special value 'UNVERSIONED'.
|
||||||
|
version() {
|
||||||
|
_project="$1"
|
||||||
|
|
||||||
|
case "${_project}" in
|
||||||
|
plugins/*)
|
||||||
|
if [ -z "$(aget VERSIONS "${_project}")" ]; then
|
||||||
|
echo "UNVERSIONED"
|
||||||
|
else
|
||||||
|
aget VERSIONS "${_project}"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [ -z "$(aget VERSIONS "${_project}")" ]; then
|
||||||
|
echo latest
|
||||||
|
else
|
||||||
|
aget VERSIONS "${_project}"
|
||||||
|
fi
|
||||||
|
esac
|
||||||
|
|
||||||
|
unset _project
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# new_proj populates a new project structure.
|
||||||
|
new_proj() {
|
||||||
|
_project="$1"
|
||||||
|
_version="$2"
|
||||||
|
_repo="$3"
|
||||||
|
_path="$4"
|
||||||
|
|
||||||
|
# If version is not set, use the script mapping of project to default versions if it exists.
|
||||||
|
# Fallback to 'latest'.
|
||||||
|
if [ -z "${_version}" ]; then
|
||||||
|
_version="$(version "${_project}")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If repo is not set, use the script mapping of project to repo name if it exists.
|
||||||
|
# Fallback to using the project name.
|
||||||
|
if [ -z "${_repo}" ]; then
|
||||||
|
_repo="$(src "${_project}")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If path is not set, use the script mapping of project to docs sources path if it exists.
|
||||||
|
# Fallback to using 'docs/sources'.
|
||||||
|
if [ -z "${_path}" ]; then
|
||||||
|
_path="$(path "${_project}")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${_project}:${_version}:${_repo}:${_path}"
|
||||||
|
unset _project _version _repo _path
|
||||||
|
}
|
||||||
|
|
||||||
|
# proj_url returns the webserver URL for a project.
|
||||||
|
# It expects a complete project structure as input.
|
||||||
|
proj_url() {
|
||||||
|
IFS=: read -r _project _version _ _ <<POSIX_HERESTRING
|
||||||
|
$1
|
||||||
|
POSIX_HERESTRING
|
||||||
|
|
||||||
|
if [ "${_project}" = 'website' ]; then
|
||||||
|
echo "http://localhost:${DOCS_HOST_PORT}/docs/"
|
||||||
|
|
||||||
|
unset _project _version
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${_version}" ] || [ "${_version}" = 'UNVERSIONED' ]; then
|
||||||
|
echo "http://localhost:${DOCS_HOST_PORT}/docs/${_project}/"
|
||||||
|
else
|
||||||
|
echo "http://localhost:${DOCS_HOST_PORT}/docs/${_project}/${_version}/"
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset _project _version
|
||||||
|
}
|
||||||
|
|
||||||
|
# proj_ver returns the version for a project.
|
||||||
|
# It expects a complete project structure as input.
|
||||||
|
proj_ver() {
|
||||||
|
IFS=: read -r _ _ver _ _ <<POSIX_HERESTRING
|
||||||
|
$1
|
||||||
|
POSIX_HERESTRING
|
||||||
|
|
||||||
|
echo "${_ver}"
|
||||||
|
unset _ver
|
||||||
|
}
|
||||||
|
|
||||||
|
# proj_dst returns the container path to content source for a project.
|
||||||
|
# It expects a complete project structure as input.
|
||||||
|
proj_dst() {
|
||||||
|
IFS=: read -r _project _version _ _ <<POSIX_HERESTRING
|
||||||
|
$1
|
||||||
|
POSIX_HERESTRING
|
||||||
|
|
||||||
|
if [ "${_project}" = 'website' ]; then
|
||||||
|
echo '/hugo/content'
|
||||||
|
|
||||||
|
unset _project _version
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${_version}" ] || [ "${_version}" = 'UNVERSIONED' ]; then
|
||||||
|
echo "/hugo/content/docs/${_project}"
|
||||||
|
else
|
||||||
|
echo "/hugo/content/docs/${_project}/${_version}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset _project _version
|
||||||
|
}
|
||||||
|
|
||||||
|
# repo_path returns the host path to the project repository.
|
||||||
|
# It looks for the provided repository name in each of the paths specified in the REPOS_PATH environment variable.
|
||||||
|
repo_path() {
|
||||||
|
_repo="$1"
|
||||||
|
IFS=:
|
||||||
|
for lookup in ${REPOS_PATH}; do
|
||||||
|
if [ -d "${lookup}/${_repo}" ]; then
|
||||||
|
echo "${lookup}/${_repo}"
|
||||||
|
unset _path _repo
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
unset IFS
|
||||||
|
|
||||||
|
errr "could not find project '${_repo}' in any of the paths in REPOS_PATH '${REPOS_PATH}'."
|
||||||
|
note "you must have a checkout of the project '${_repo}' at '${REPOS_PATH##:*}/${_repo}'."
|
||||||
|
note "if you have cloned the repository into a directory with a different name, consider changing it to ${_repo}."
|
||||||
|
|
||||||
|
unset _repo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# proj_src returns the host path to content source for a project.
|
||||||
|
# It expects a complete project structure as input.
|
||||||
|
# It looks for the provided repository name in each of the paths specified in the REPOS_PATH environment variable.
|
||||||
|
proj_src() {
|
||||||
|
IFS=: read -r _ _ _repo _path <<POSIX_HERESTRING
|
||||||
|
$1
|
||||||
|
POSIX_HERESTRING
|
||||||
|
|
||||||
|
_repo="$(repo_path "${_repo}")"
|
||||||
|
echo "${_repo}/${_path}"
|
||||||
|
|
||||||
|
unset _path _repo
|
||||||
|
}
|
||||||
|
|
||||||
|
# proj_canonical returns the canonical absolute path partial URI for a project.
|
||||||
|
# It expects a complete project structure as input.
|
||||||
|
proj_canonical() {
|
||||||
|
IFS=: read -r _project _version _ _ <<POSIX_HERESTRING
|
||||||
|
$1
|
||||||
|
POSIX_HERESTRING
|
||||||
|
|
||||||
|
if [ "${_project}" = 'website' ]; then
|
||||||
|
echo '/docs'
|
||||||
|
|
||||||
|
unset _project _version
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${_version}" ] || [ "${_version}" = 'UNVERSIONED' ]; then
|
||||||
|
echo "/docs/${_project}"
|
||||||
|
else
|
||||||
|
echo "/docs/${_project}/${_version}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset _project _version
|
||||||
|
}
|
||||||
|
|
||||||
|
proj_to_url_src_dst_ver() {
|
||||||
|
_url="$(proj_url "$1")"
|
||||||
|
_src="$(proj_src "$1")"
|
||||||
|
_dst="$(proj_dst "$1")"
|
||||||
|
_ver="$(proj_ver "$1")"
|
||||||
|
|
||||||
|
echo "${_url}^${_src}^${_dst}^${_ver}"
|
||||||
|
unset _url _src _dst _ver
|
||||||
|
}
|
||||||
|
|
||||||
|
url_src_dst_vers() {
|
||||||
|
for arg in "$@"; do
|
||||||
|
IFS=: read -r _project _version _repo _path <<POSIX_HERESTRING
|
||||||
|
$arg
|
||||||
|
POSIX_HERESTRING
|
||||||
|
|
||||||
|
case "${_project}" in
|
||||||
|
# Workaround for arbitrary mounts where the version field is expected to be the local directory
|
||||||
|
# and the repo field is expected to be the container directory.
|
||||||
|
arbitrary)
|
||||||
|
echo "${_project}^${_version}^${_repo}^" # TODO
|
||||||
|
;;
|
||||||
|
logs)
|
||||||
|
proj_to_url_src_dst_ver "$(new_proj loki "${_version}")"
|
||||||
|
proj_to_url_src_dst_ver "$(new_proj enterprise-logs "${_version}")"
|
||||||
|
;;
|
||||||
|
metrics)
|
||||||
|
proj_to_url_src_dst_ver "$(new_proj mimir "${_version}")"
|
||||||
|
proj_to_url_src_dst_ver "$(new_proj helm-charts/mimir-distributed "${_version}")"
|
||||||
|
proj_to_url_src_dst_ver "$(new_proj enterprise-metrics "${_version}")"
|
||||||
|
;;
|
||||||
|
traces)
|
||||||
|
proj_to_url_src_dst_ver "$(new_proj tempo "${_version}")"
|
||||||
|
proj_to_url_src_dst_ver "$(new_proj enterprise-traces "${_version}")"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
proj_to_url_src_dst_ver "$(new_proj "${_project}" "${_version}" "${_repo}" "${_path}")"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
unset _project _version _repo _path
|
||||||
|
}
|
||||||
|
|
||||||
|
await_build() {
|
||||||
|
url="$1"
|
||||||
|
req="$(if command -v curl >/dev/null 2>&1; then echo 'curl -s -o /dev/null'; else echo 'wget -q'; fi)"
|
||||||
|
|
||||||
|
i=1
|
||||||
|
max=10
|
||||||
|
while [ "${i}" -ne "${max}" ]
|
||||||
|
do
|
||||||
|
sleep 1
|
||||||
|
debg "Retrying request to webserver assuming the process is still starting up."
|
||||||
|
i=$((i + 1))
|
||||||
|
|
||||||
|
if ${req} "${url}"; then
|
||||||
|
echo
|
||||||
|
echo "View documentation locally:"
|
||||||
|
for x in ${url_src_dst_vers}; do
|
||||||
|
IFS='^' read -r url _ _ <<POSIX_HERESTRING
|
||||||
|
$x
|
||||||
|
POSIX_HERESTRING
|
||||||
|
|
||||||
|
if [ -n "${url}" ]; then
|
||||||
|
if [ "${_url}" != "arbitrary" ]; then
|
||||||
|
echo " ${url}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
echo 'Press Ctrl+C to stop the server'
|
||||||
|
|
||||||
|
unset i max req url
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo
|
||||||
|
errr 'The build was interrupted or a build error occurred, check the previous logs for possible causes.'
|
||||||
|
note 'You might need to use Ctrl+C to end the process.'
|
||||||
|
|
||||||
|
unset i max req url
|
||||||
|
}
|
||||||
|
|
||||||
|
debg() {
|
||||||
|
if [ -n "${DEBUG}" ]; then
|
||||||
|
echo "DEBG: $1" >&2
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
errr() {
|
||||||
|
echo "ERRR: $1" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
note() {
|
||||||
|
echo "NOTE: $1" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
url_src_dst_vers="$(url_src_dst_vers "$@")"
|
||||||
|
|
||||||
|
volumes=""
|
||||||
|
redirects=""
|
||||||
|
|
||||||
|
for arg in "$@"; do
|
||||||
|
IFS=: read -r _project _ _repo _ <<POSIX_HERESTRING
|
||||||
|
${arg}
|
||||||
|
POSIX_HERESTRING
|
||||||
|
if [ "${_project}" = website ]; then
|
||||||
|
note "Please be patient, building the website can take some time."
|
||||||
|
|
||||||
|
_repo="$(repo_path website)"
|
||||||
|
volumes="--volume=${_repo}/config:/hugo/config"
|
||||||
|
volumes="${volumes} --volume=${_repo}/layouts:/hugo/layouts"
|
||||||
|
volumes="${volumes} --volume=${_repo}/scripts:/hugo/scripts"
|
||||||
|
fi
|
||||||
|
unset _project _repo
|
||||||
|
done
|
||||||
|
|
||||||
|
for x in ${url_src_dst_vers}; do
|
||||||
|
IFS='^' read -r _url _src _dst _ver <<POSIX_HERESTRING
|
||||||
|
$x
|
||||||
|
POSIX_HERESTRING
|
||||||
|
|
||||||
|
if [ "${_url}" != "arbitrary" ]; then
|
||||||
|
if [ ! -f "${_src}/_index.md" ]; then
|
||||||
|
errr "Index file '${_src}/_index.md' does not exist."
|
||||||
|
note "Is '${_src}' the correct source directory?"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
debg "Mounting '${_src}' at container path '${_dst}'"
|
||||||
|
|
||||||
|
if [ -z "${volumes}" ]; then
|
||||||
|
volumes="--volume=${_src}:${_dst}"
|
||||||
|
else
|
||||||
|
volumes="${volumes} --volume=${_src}:${_dst}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${_ver}" ] && [ "${_ver}" != 'UNVERSIONED' ]; then
|
||||||
|
if [ -z "${redirects}" ]; then
|
||||||
|
redirects="${_dst}^${_ver}"
|
||||||
|
else
|
||||||
|
redirects="${redirects} ${_dst}^${_ver}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
unset _url _src _dst _ver
|
||||||
|
done
|
||||||
|
|
||||||
|
IFS=':' read -r image _ <<POSIX_HERESTRING
|
||||||
|
${DOCS_IMAGE}
|
||||||
|
POSIX_HERESTRING
|
||||||
|
|
||||||
|
case "${image}" in
|
||||||
|
'grafana/doc-validator')
|
||||||
|
proj="$(new_proj "$1")"
|
||||||
|
echo
|
||||||
|
"${PODMAN}" run \
|
||||||
|
--init \
|
||||||
|
--interactive \
|
||||||
|
--platform linux/amd64 \
|
||||||
|
--rm \
|
||||||
|
--tty \
|
||||||
|
${volumes} \
|
||||||
|
"${DOCS_IMAGE}" \
|
||||||
|
"--include=${DOC_VALIDATOR_INCLUDE}" \
|
||||||
|
"--skip-checks=${DOC_VALIDATOR_SKIP_CHECKS}" \
|
||||||
|
/hugo/content/docs \
|
||||||
|
"$(proj_canonical "${proj}")" | sed "s#$(proj_dst "${proj}")#sources#"
|
||||||
|
;;
|
||||||
|
'grafana/vale')
|
||||||
|
proj="$(new_proj "$1")"
|
||||||
|
echo
|
||||||
|
"${PODMAN}" run \
|
||||||
|
--init \
|
||||||
|
--interactive \
|
||||||
|
--platform linux/amd64 \
|
||||||
|
--rm \
|
||||||
|
--tty \
|
||||||
|
${volumes} \
|
||||||
|
"${DOCS_IMAGE}" \
|
||||||
|
"--minAlertLevel=${VALE_MINALERTLEVEL}" \
|
||||||
|
--config=/etc/vale/.vale.ini \
|
||||||
|
--output=line \
|
||||||
|
/hugo/content/docs | sed "s#$(proj_dst "${proj}")#sources#"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
tempfile="$(mktemp -t make-docs.XXX)"
|
||||||
|
cat <<EOF >"${tempfile}"
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
tc() {
|
||||||
|
set \${*,,}
|
||||||
|
echo \${*^}
|
||||||
|
}
|
||||||
|
|
||||||
|
for redirect in ${redirects}; do
|
||||||
|
IFS='^' read -r path ver <<<"\${redirect}"
|
||||||
|
echo -e "---\\nredirectURL: \"\${path/\/hugo\/content/}\"\\ntype: redirect\\nversioned: true\\n---\\n" > "\${path/\${ver}/_index.md}"
|
||||||
|
done
|
||||||
|
|
||||||
|
for x in "${url_src_dst_vers}"; do
|
||||||
|
IFS='^' read -r _ _ dst _ <<<"\${x}"
|
||||||
|
|
||||||
|
title="\${dst%/*}"
|
||||||
|
title="\$(tc \${title##*/})"
|
||||||
|
while [[ -n "\${dst}" ]]; do
|
||||||
|
if [[ ! -f "\${dst}/_index.md" ]]; then
|
||||||
|
echo -e "---title: \${title}\\n---\\n\\n# \${title}\\n\\n{{< section >}}" > "\${dst}/_index.md"
|
||||||
|
fi
|
||||||
|
dst="\${dst%/*}"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -n "${WEBSITE_MOUNTS}" ]]; then
|
||||||
|
unset WEBSITE_SKIP_MOUNTS
|
||||||
|
fi
|
||||||
|
|
||||||
|
${WEBSITE_EXEC}
|
||||||
|
EOF
|
||||||
|
chmod +x "${tempfile}"
|
||||||
|
volumes="${volumes} --volume=${tempfile}:/entrypoint"
|
||||||
|
readonly volumes
|
||||||
|
|
||||||
|
IFS='' read -r cmd <<EOF
|
||||||
|
${PODMAN} run \
|
||||||
|
--env=HUGO_REFLINKSERRORLEVEL=${HUGO_REFLINKSERRORLEVEL} \
|
||||||
|
--init \
|
||||||
|
--interactive \
|
||||||
|
--publish=${DOCS_HOST_PORT}:3002 \
|
||||||
|
--publish=3003:3003 \
|
||||||
|
--rm \
|
||||||
|
--tty \
|
||||||
|
${volumes} \
|
||||||
|
${DOCS_IMAGE}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
if [ -n "${ENTER}" ]; then
|
||||||
|
${cmd} /bin/bash
|
||||||
|
elif [ -n "${DEBUG}" ]; then
|
||||||
|
await_build http://localhost:3003 &
|
||||||
|
|
||||||
|
debg "${cmd} /entrypoint"
|
||||||
|
${cmd} /entrypoint
|
||||||
|
else
|
||||||
|
await_build http://localhost:3003 &
|
||||||
|
|
||||||
|
${cmd} /entrypoint 2>&1\
|
||||||
|
| sed -u \
|
||||||
|
-e '/Web Server is available at http:\/\/localhost:3003\/ (bind address 0.0.0.0)/ d' \
|
||||||
|
-e '/^hugo server/ d' \
|
||||||
|
-e '/fatal: not a git repository (or any parent up to mount point \/)/ d' \
|
||||||
|
-e '/Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)./ d' \
|
||||||
|
-e "/Makefile:[0-9]*: warning: overriding recipe for target 'docs'/ d" \
|
||||||
|
-e "/docs.mk:[0-9]*: warning: ignoring old recipe for target 'docs'/ d" \
|
||||||
|
-e '/\/usr\/bin\/make -j 2 proxy hserver-docs HUGO_PORT=3003/ d' \
|
||||||
|
-e '/website-proxy/ d' \
|
||||||
|
-e '/rm -rf dist*/ d' \
|
||||||
|
-e '/Press Ctrl+C to stop/ d' \
|
||||||
|
-e '/make/ d' \
|
||||||
|
-e '/WARNING: The manual_mount source directory/ d'
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
site_name: Grafana-Zabbix Documentation
|
|
||||||
site_description: Documentation for Grafana-Zabbix, Zabbix monitoring system plugin bundle for Grafana
|
|
||||||
site_url: https://alexanderzobnin.github.io/grafana-zabbix/
|
|
||||||
repo_url: https://github.com/alexanderzobnin/grafana-zabbix/
|
|
||||||
edit_uri: blob/docs/docs/sources/
|
|
||||||
copyright: Copyright © 2015-2020, Alexander Zobnin
|
|
||||||
|
|
||||||
docs_dir: sources
|
|
||||||
|
|
||||||
theme:
|
|
||||||
name: readthedocs
|
|
||||||
highlightjs: true
|
|
||||||
hljs_languages:
|
|
||||||
- yaml
|
|
||||||
- sql
|
|
||||||
extra_css:
|
|
||||||
- css/custom.css
|
|
||||||
|
|
||||||
nav:
|
|
||||||
- Project:
|
|
||||||
- 'About Grafana-Zabbix': 'index.md'
|
|
||||||
- 'Feature Highlights': 'features.md'
|
|
||||||
- Installation:
|
|
||||||
- 'Installation': 'installation/index.md'
|
|
||||||
- 'Building from sources': 'installation/run_from_master.md'
|
|
||||||
- 'Upgrade': 'installation/upgrade.md'
|
|
||||||
- Configuration:
|
|
||||||
- 'Configuration': 'configuration/index.md'
|
|
||||||
- 'Direct DB Connection Configuration': 'configuration/direct_db_datasource.md'
|
|
||||||
- 'Provisioning': 'configuration/provisioning.md'
|
|
||||||
- 'Troubleshooting': 'configuration/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'
|
|
||||||
- 'Functions': 'reference/functions.md'
|
|
||||||
- 'Alerting': 'reference/alerting.md'
|
|
||||||
- 'Direct DB Connection': 'reference/direct-db-connection.md'
|
|
||||||
# - Tutorials:
|
|
||||||
# - 'Building Host Dashboard': 'tutorials/host_dashboard.md'
|
|
||||||
@@ -1,7 +1,19 @@
|
|||||||
page_title: About Grafana-Zabbix
|
---
|
||||||
page_description: Introduction to Grafana-Zabbix plugin.
|
title: Grafana Zabbix plugin
|
||||||
|
menuTitle: Grafana Zabbix plugin
|
||||||
|
description: Introduction to Grafana-Zabbix plugin.
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 100
|
||||||
|
---
|
||||||
|
|
||||||
# About Grafana-Zabbix plugin
|
# Grafana Zabbix plugin
|
||||||
|
|
||||||
Grafana-Zabbix is a plugin for Grafana allowing to visualize monitoring data from Zabbix
|
Grafana-Zabbix is a plugin for Grafana allowing to visualize monitoring data from Zabbix
|
||||||
and create dashboards for analyzing metrics and realtime monitoring. Main goals of this project
|
and create dashboards for analyzing metrics and realtime monitoring. Main goals of this project
|
||||||
@@ -18,21 +30,12 @@ If you have any troubles with Grafana or you just want clarification on a featur
|
|||||||
a number of ways to get help:
|
a number of ways to get help:
|
||||||
|
|
||||||
- [Troubleshooting guide](./configuration/troubleshooting/)
|
- [Troubleshooting guide](./configuration/troubleshooting/)
|
||||||
- Search closed and open [issues on GitHub](https://github.com/grafana/grafana/issues)
|
- Search closed and open [issues on GitHub](https://github.com/grafana/grafana-zabbix/issues)
|
||||||
- [Grafana Community](https://community.grafana.com)
|
- [Grafana Community](https://community.grafana.com)
|
||||||
- [Twitter](https://twitter.com/AlexanderZobnin)
|
|
||||||
|
|
||||||
Or you can send me [email](mailto:alexanderzobnin@gmail.com).
|
|
||||||
|
|
||||||
## Support Project
|
|
||||||
I develop this project in my free time, but if you really find it helpful and promising, you can
|
|
||||||
support me. There are some ways to do this. You can [donate](https://www.paypal.me/alexanderzobnin)
|
|
||||||
any reasonable amount, or you can request a feature development, interesting for you (for example,
|
|
||||||
Triggers panel was sponsored by [Core IT Project](http://coreit.fr/)).
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
By utilizing this software, you agree to the terms of the included license. Grafana-Zabbix plugin is
|
By utilizing this software, you agree to the terms of the included license. Grafana-Zabbix plugin is
|
||||||
licensed under the Apache 2.0 agreement. See
|
licensed under the Apache 2.0 agreement. See
|
||||||
[LICENSE](https://github.com/alexanderzobnin/grafana-zabbix/blob/master/LICENSE) for the full
|
[LICENSE](https://github.com/grafana/grafana-zabbix/blob/main/LICENSE) for the full
|
||||||
license terms.
|
license terms.
|
||||||
@@ -1,5 +1,17 @@
|
|||||||
page_title: Grafana-Zabbix Configuration
|
---
|
||||||
page_description: Plugin configuration instructions for Grafana-Zabbix.
|
title: Configuration
|
||||||
|
menuTitle: Configuration
|
||||||
|
description: Plugin configuration instructions for Grafana-Zabbix.
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 300
|
||||||
|
---
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
|
|
||||||
@@ -8,7 +20,7 @@ page_description: Plugin configuration instructions for Grafana-Zabbix.
|
|||||||
Go to the plugins in Grafana side panel, select _Apps_ tab, then select _Zabbix_, open _Config_
|
Go to the plugins in Grafana side panel, select _Apps_ tab, then select _Zabbix_, open _Config_
|
||||||
tab and enable plugin.
|
tab and enable plugin.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Configure Zabbix data source
|
## Configure Zabbix data source
|
||||||
|
|
||||||
@@ -16,7 +28,7 @@ After enabling plugin you can add Zabbix data source.
|
|||||||
|
|
||||||
To add new Zabbix data source open _Data Sources_ in side panel, click _Add data source_ and select _Zabbix_ from dropdown list.
|
To add new Zabbix data source open _Data Sources_ in side panel, click _Add data source_ and select _Zabbix_ from dropdown list.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### HTTP settings
|
### HTTP settings
|
||||||
|
|
||||||
@@ -75,7 +87,7 @@ Then click _Add_ - data source will be added and you can check connection using
|
|||||||
|
|
||||||
You can import dashboard examples from _Dashboards_ tab in the data source config.
|
You can import dashboard examples from _Dashboards_ tab in the data source config.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Note about Browser Cache
|
## Note about Browser Cache
|
||||||
|
|
||||||
@@ -1,3 +1,18 @@
|
|||||||
|
---
|
||||||
|
title: Direct DB Data Source Configuration
|
||||||
|
menuTitle: Direct DB Data Source Configuration
|
||||||
|
description: Direct DB Data Source Configuration
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 310
|
||||||
|
---
|
||||||
|
|
||||||
# Direct DB Data Source Configuration
|
# Direct DB Data Source Configuration
|
||||||
|
|
||||||
## Security notes
|
## Security notes
|
||||||
@@ -13,7 +28,7 @@ GRANT SELECT ON zabbix.* TO 'grafana'@'grafana-host' identified by 'password';
|
|||||||
|
|
||||||
In order to use _Direct DB Connection_ feature you should configure SQL data source first.
|
In order to use _Direct DB Connection_ feature you should configure SQL data source first.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Select _MySQL_ data source type and provide your database host address and port (3306 is default for MySQL). Fill
|
Select _MySQL_ data source type and provide your database host address and port (3306 is default for MySQL). Fill
|
||||||
database name (usually, `zabbix`) and specify credentials.
|
database name (usually, `zabbix`) and specify credentials.
|
||||||
@@ -23,11 +38,11 @@ database name (usually, `zabbix`) and specify credentials.
|
|||||||
Select _PostgreSQL_ data source type and provide your database host address and port (5432 is default). Fill
|
Select _PostgreSQL_ data source type and provide your database host address and port (5432 is default). Fill
|
||||||
database name (usually, `zabbix`) and specify credentials.
|
database name (usually, `zabbix`) and specify credentials.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## InfluxDB
|
## InfluxDB
|
||||||
|
|
||||||
Select _InfluxDB_ data source type and provide your InfluxDB instance host address and port (8086 is default). Fill
|
Select _InfluxDB_ data source type and provide your InfluxDB instance host address and port (8086 is default). Fill
|
||||||
database name you configured in the [effluence](https://github.com/i-ky/effluence) module config (usually, `zabbix`) and specify credentials.
|
database name you configured in the [effluence](https://github.com/i-ky/effluence) module config (usually, `zabbix`) and specify credentials.
|
||||||
|
|
||||||

|

|
||||||
66
docs/sources/configuration/provisioning.md
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
---
|
||||||
|
title: Provisioning Grafana-Zabbix plugin
|
||||||
|
menuTitle: Provisioning Grafana-Zabbix plugin
|
||||||
|
description: Grafana-Zabbix plugin provisioning instructions.
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 320
|
||||||
|
---
|
||||||
|
|
||||||
|
# Provisioning Grafana-Zabbix plugin
|
||||||
|
|
||||||
|
It’s now possible to configure datasources using config files with Grafana’s provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](http://docs.grafana.org/administration/provisioning/#datasources)
|
||||||
|
|
||||||
|
## Example Datasource Config File
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: 1
|
||||||
|
datasources:
|
||||||
|
- name: Zabbix
|
||||||
|
type: alexanderzobnin-zabbix-datasource
|
||||||
|
access: proxy
|
||||||
|
url: http://localhost/zabbix/api_jsonrpc.php
|
||||||
|
isDefault: true
|
||||||
|
jsonData:
|
||||||
|
# Zabbix API credentials
|
||||||
|
username: zabbix
|
||||||
|
password: zabbix
|
||||||
|
# Trends options
|
||||||
|
trends: true
|
||||||
|
trendsFrom: '7d'
|
||||||
|
trendsRange: '4d'
|
||||||
|
# Cache update interval
|
||||||
|
cacheTTL: '1h'
|
||||||
|
# Alerting options
|
||||||
|
alerting: true
|
||||||
|
addThresholds: false
|
||||||
|
alertingMinSeverity: 3
|
||||||
|
# Direct DB Connection options
|
||||||
|
dbConnectionEnable: true
|
||||||
|
# Name of existing datasource for Direct DB Connection
|
||||||
|
dbConnectionDatasourceName: MySQL Zabbix
|
||||||
|
# Retention policy name (InfluxDB only) for fetching long-term stored data.
|
||||||
|
# Leave it blank if only default retention policy used.
|
||||||
|
dbConnectionRetentionPolicy: one_year
|
||||||
|
# Disable acknowledges for read-only users
|
||||||
|
disableReadOnlyUsersAck: true
|
||||||
|
# Disable time series data alignment
|
||||||
|
disableDataAlignment: false
|
||||||
|
# Use value mapping from Zabbix
|
||||||
|
useZabbixValueMapping: true
|
||||||
|
version: 1
|
||||||
|
editable: false
|
||||||
|
|
||||||
|
- name: MySQL Zabbix
|
||||||
|
type: mysql
|
||||||
|
url: localhost:3306
|
||||||
|
database: zabbix
|
||||||
|
user: grafana
|
||||||
|
password: password
|
||||||
|
```
|
||||||
@@ -1,4 +1,20 @@
|
|||||||
|
---
|
||||||
|
title: Troubleshooting
|
||||||
|
menuTitle: Troubleshooting
|
||||||
|
description: Troubleshooting guide for Grafana-Zabbix plugin.
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 330
|
||||||
|
---
|
||||||
|
|
||||||
# Troubleshooting
|
# Troubleshooting
|
||||||
|
|
||||||
See [Grafana troubleshooting](http://docs.grafana.org/installation/troubleshooting/) for general
|
See [Grafana troubleshooting](http://docs.grafana.org/installation/troubleshooting/) for general
|
||||||
connection issues. If you have a problem with Zabbix datasource, you should open
|
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
|
a [support issue](https://github.com/alexanderzobnin/grafana-zabbix/issues). Before you do that
|
||||||
@@ -1,5 +1,17 @@
|
|||||||
page_title: Feature Highlights
|
---
|
||||||
page_description: Grafana-Zabbix Feature Highlights.
|
title: Feature Highlights
|
||||||
|
menuTitle: Feature Highlights
|
||||||
|
description: Grafana-Zabbix Feature Highlights.
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 110
|
||||||
|
---
|
||||||
|
|
||||||
# Feature Highlights
|
# Feature Highlights
|
||||||
|
|
||||||
@@ -1,55 +1,76 @@
|
|||||||
|
---
|
||||||
|
title: Getting Started
|
||||||
|
menuTitle: Getting Started
|
||||||
|
description: Getting Started with Grafana-Zabbix
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 400
|
||||||
|
---
|
||||||
|
|
||||||
# Getting Started with Grafana-Zabbix
|
# Getting Started with Grafana-Zabbix
|
||||||
|
|
||||||
After you [installed and configured](../installation/index.md) Grafana-Zabbix data source let's
|
After you [installed and configured](../installation/index.md) Grafana-Zabbix data source let's
|
||||||
create a simple dashboard.
|
create a simple dashboard.
|
||||||
|
|
||||||
## Simple Graph
|
## Simple Graph
|
||||||
|
|
||||||
Add new Graph panel to dashboard.
|
Add new Graph panel to dashboard.
|
||||||
Select metrics from dropdown or start to type to filter results
|
Select metrics from dropdown or start to type to filter results
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Let's create _15 min avg processor load_ graph. Select Host Group, Host, Application (optional - you can leave it blank) and Item.
|
Let's create _15 min avg processor load_ graph. Select Host Group, Host, Application (optional - you can leave it blank) and Item.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Multiple Items On One Graph
|
## Multiple Items On One Graph
|
||||||
|
|
||||||
You can build graphs with lots of items using Regular Expressions inside metric field. Grafana uses JavaScript regex implementation. For example, if you need to show CPU time (user, system, iowait, etc) you may create graph using this regex in Item field:
|
You can build graphs with lots of items using Regular Expressions inside metric field. Grafana uses JavaScript regex implementation. For example, if you need to show CPU time (user, system, iowait, etc) you may create graph using this regex in Item field:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
/CPU (?!idle).* time/
|
/CPU (?!idle).* time/;
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Another case to use regex is comparing the same metrics for different hosts. Use `/.*/` regex for showing all metrics or write your own filter. For example, I want to show _CPU system time_ for all hosts which name started with _backend_ from all host groups. I use `/.*/` for Group, `/^backend/` for Host and `CPU system time` for Item.
|
Another case to use regex is comparing the same metrics for different hosts. Use `/.*/` regex for showing all metrics or write your own filter. For example, I want to show _CPU system time_ for all hosts which name started with _backend_ from all host groups. I use `/.*/` for Group, `/^backend/` for Host and `CPU system time` for Item.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Bar Chart
|
## Bar Chart
|
||||||
|
|
||||||
Let's create a graph which show queries stats for MySQL database. Select Group, Host, Application (_MySQL_ in my case) and Items. I use `/MySQL .* operations/` regex for filtering different types of operations.
|
Let's create a graph which show queries stats for MySQL database. Select Group, Host, Application (_MySQL_ in my case) and Items. I use `/MySQL .* operations/` regex for filtering different types of operations.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
To show graph as Bar Chart, go to the **Display** tab, uncheck **Lines** and set **Bars**. Also, enable **Stack** checkbox for showing stacked bars.
|
To show graph as Bar Chart, go to the **Display** tab, uncheck **Lines** and set **Bars**. Also, enable **Stack** checkbox for showing stacked bars.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
But this graph doesn't look good because it contains too many bars. We can fix it by using **Max data points** parameter. Go to the **Metrics** tab and set **Max data points** to 50 for example.
|
But this graph doesn't look good because it contains too many bars. We can fix it by using **Max data points** parameter. Go to the **Metrics** tab and set **Max data points** to 50 for example.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Ok, looks pretty!
|
Ok, looks pretty!
|
||||||
|
|
||||||
## Singlestat and Gauges
|
## Singlestat and Gauges
|
||||||
|
|
||||||
Sometimes you may need to show just a big single value for particular metric. Use Grafana's **Singlestat** panel in this case. Let's create panel which shows _CPU user time_ metric.
|
Sometimes you may need to show just a big single value for particular metric. Use Grafana's **Singlestat** panel in this case. Let's create panel which shows _CPU user time_ metric.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Suppose that you want to set units as percents and show **Gauge** for this value. Go to the **Options** tab and set units to _percent (0-100)_. Then enable _Show_ option for _Gauge_ and set Min and Max values for your metric (0-100 in our case). Set thresholds if you want to see it on Gauge (`50,80` for example).
|
Suppose that you want to set units as percents and show **Gauge** for this value. Go to the **Options** tab and set units to _percent (0-100)_. Then enable _Show_ option for _Gauge_ and set Min and Max values for your metric (0-100 in our case). Set thresholds if you want to see it on Gauge (`50,80` for example).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Great, looks cool. Read more about Singlestat panel in [Grafana docs](http://docs.grafana.org/reference/singlestat/).
|
Great, looks cool. Read more about Singlestat panel in [Grafana docs](http://docs.grafana.org/reference/singlestat/).
|
||||||
|
|
||||||
And all together:
|
And all together:
|
||||||
|
|
||||||

|

|
||||||
@@ -1,14 +1,31 @@
|
|||||||
|
---
|
||||||
|
title: Templating Guide
|
||||||
|
menuTitle: Templating Guide
|
||||||
|
description: Templating Guide
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 410
|
||||||
|
---
|
||||||
|
|
||||||
# Templating Guide
|
# 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.
|
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
|
## Creating Variable
|
||||||
|
|
||||||
To create template variable click the cog icon on the top navigation bar and choose _Templating_.
|
To create template variable click the cog icon on the top navigation bar and choose _Templating_.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
When you click _New_ button, you'll see template variable editor. It contains these sections:
|
When you click _New_ button, you'll see template variable editor. It contains these sections:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Variable
|
### Variable
|
||||||
|
|
||||||
@@ -16,7 +33,7 @@ When you click _New_ button, you'll see template variable editor. It contains th
|
|||||||
Name of the variable. You should use this name in queries.
|
Name of the variable. You should use this name in queries.
|
||||||
|
|
||||||
**Label**
|
**Label**
|
||||||
Visible label for variable. Use when you want to display different name on dashboard. For instance, _Host Group_ instead *host_group*.
|
Visible label for variable. Use when you want to display different name on dashboard. For instance, _Host Group_ instead _host_group_.
|
||||||
|
|
||||||
**Type**
|
**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_.
|
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_.
|
||||||
@@ -43,15 +60,17 @@ Enable, if you want to select multiple values at the same time.
|
|||||||
### Value groups/tags (Experimental feature)
|
### Value groups/tags (Experimental feature)
|
||||||
|
|
||||||
## Query Format
|
## Query Format
|
||||||
|
|
||||||
Template variable query in Zabbix data source is a string which contains 4 parts wrapped in braces (`{}`). You still can
|
Template variable query in Zabbix data source is a string which contains 4 parts wrapped in braces (`{}`). You still can
|
||||||
use a period (`.`), but it's deprecated and will be removed in future.
|
use a period (`.`), but it's deprecated and will be removed in future.
|
||||||
|
|
||||||
```
|
```sh
|
||||||
{host group}{host}{application}{item name}
|
{host group}{host}{application}{item name}
|
||||||
```
|
```
|
||||||
|
|
||||||
For example,
|
For example,
|
||||||
```
|
|
||||||
|
```sh
|
||||||
{Zabbix servers}{Zabbix server}{CPU}{*}
|
{Zabbix servers}{Zabbix server}{CPU}{*}
|
||||||
{Frontend}{web01.mydomain.com}{*}{*}
|
{Frontend}{web01.mydomain.com}{*}{*}
|
||||||
```
|
```
|
||||||
@@ -60,15 +79,16 @@ Each part can be a name of corresponding metric or `*`, which means _all metrics
|
|||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
- `{*}` returns list of all available Host Groups
|
- `{*}` returns list of all available Host Groups
|
||||||
- `{*}{*}` all hosts in Zabbix
|
- `{*}{*}` all hosts in Zabbix
|
||||||
- `{Network}{*}` returns all hosts in group Network
|
- `{Network}{*}` returns all hosts in group Network
|
||||||
- `{Linux servers}{*}{*}` returns all applications from hosts in Linux servers group
|
- `{Linux servers}{*}{*}` returns all applications from hosts in Linux servers group
|
||||||
- `{Linux servers}{backend01}{CPU}{*}` returns all items from backend01 belonging to CPU application.
|
- `{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
|
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:
|
host groups and want to use it for querying hosts in selected group only. Here's a query for this case:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
{$group}{*}
|
{$group}{*}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -76,7 +96,7 @@ host groups and want to use it for querying hosts in selected group only. Here's
|
|||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> Note, that you should add `$` sign before variable's name (**$host** for _host_ variable).
|
> Note, that you should add `$` sign before variable's name (**$host** for _host_ variable).
|
||||||
|
|
||||||
@@ -1,5 +1,17 @@
|
|||||||
page_title: Grafana-Zabbix Installation
|
---
|
||||||
page_description: Installation instructions for Grafana-Zabbix.
|
title: Installation
|
||||||
|
menuTitle: Installation
|
||||||
|
description: Installation instructions for Grafana-Zabbix.
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 200
|
||||||
|
---
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
@@ -22,6 +34,7 @@ grafana-cli plugins install alexanderzobnin-zabbix-app
|
|||||||
```
|
```
|
||||||
|
|
||||||
Restart grafana after installing plugins
|
Restart grafana after installing plugins
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
systemctl restart grafana-server
|
systemctl restart grafana-server
|
||||||
```
|
```
|
||||||
@@ -38,4 +51,4 @@ Starting from version 4.0, each plugin release on GitHub contains packaged plugi
|
|||||||
|
|
||||||
## Building from sources
|
## Building from sources
|
||||||
|
|
||||||
If you want to build a package yourself, or contribute - read [building instructions](./run_from_master).
|
If you want to build a package yourself, or contribute - read [building instructions](./building-from-sources).
|
||||||
@@ -1,7 +1,19 @@
|
|||||||
page_title: Run Grafana-Zabbix from master
|
---
|
||||||
page_description: Building instructions for Grafana-Zabbix.
|
title: Building from sources
|
||||||
|
menuTitle: Building from sources
|
||||||
|
description: Building instructions for Grafana-Zabbix.
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 210
|
||||||
|
---
|
||||||
|
|
||||||
# Run from master
|
# Building from sources
|
||||||
|
|
||||||
If you want to build a package yourself, or contribute - here is a guide for how to do that.
|
If you want to build a package yourself, or contribute - here is a guide for how to do that.
|
||||||
|
|
||||||
22
docs/sources/installation/upgrade.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
title: Upgrade
|
||||||
|
menuTitle: Upgrade
|
||||||
|
description: Upgrade instructions for Grafana-Zabbix.
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 220
|
||||||
|
---
|
||||||
|
|
||||||
|
# Upgrade
|
||||||
|
|
||||||
|
## Upgrade from 2.x
|
||||||
|
|
||||||
|
After [enabling](../../configuration/#enable-plugin) Zabbix App go to _Data Sources_, open your configured Zabbix
|
||||||
|
data source end select _Zabbix_ from _Type_ list again. This is needed because plugin id was changed
|
||||||
|
in Grafana 3.0.
|
||||||
20
docs/sources/reference/_index.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
title: References
|
||||||
|
menuTitle: References
|
||||||
|
description: References
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 500
|
||||||
|
---
|
||||||
|
|
||||||
|
# References
|
||||||
|
|
||||||
|
- [Functions](./functions)
|
||||||
|
- [Direct DB Connection](./direct-db-connection)
|
||||||
|
- [Alerting](./alerting)
|
||||||
@@ -1,4 +1,17 @@
|
|||||||
# Alerting
|
---
|
||||||
|
title: Alerting
|
||||||
|
menuTitle: Alerting
|
||||||
|
description: Alerting
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 520
|
||||||
|
---
|
||||||
|
|
||||||
## Alerting overview
|
## Alerting overview
|
||||||
|
|
||||||
@@ -1,4 +1,17 @@
|
|||||||
# Direct DB Connection
|
---
|
||||||
|
title: Direct DB Connection
|
||||||
|
menuTitle: Direct DB Connection
|
||||||
|
description: Direct DB Connection
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 530
|
||||||
|
---
|
||||||
|
|
||||||
Since version 4.3 Grafana can use MySQL as a native data source. The idea of Direct DB Connection is that Grafana-Zabbix plugin can use this data source for querying data directly from a Zabbix database.
|
Since version 4.3 Grafana can use MySQL as a native data source. The idea of Direct DB Connection is that Grafana-Zabbix plugin can use this data source for querying data directly from a Zabbix database.
|
||||||
|
|
||||||
@@ -18,13 +31,14 @@ This chart illustrates how the plugin uses both Zabbix API and the MySQL data so
|
|||||||
of data from Zabbix. MySQL data source is used only for pulling history and trend data instead of `history.get`
|
of data from Zabbix. MySQL data source is used only for pulling history and trend data instead of `history.get`
|
||||||
and `trend.get` API calls.
|
and `trend.get` API calls.
|
||||||
|
|
||||||
[](../img/reference-direct-db-connection.svg)
|
[](https://raw.githubusercontent.com/grafana/alexanderzobnin-zabbix-app/main/docs/images/reference-direct-db-connection.svg)
|
||||||
|
|
||||||
## Query structure
|
## Query structure
|
||||||
|
|
||||||
Below is an example query for getting history in the Grafana-Zabbix Plugin:
|
Below is an example query for getting history in the Grafana-Zabbix Plugin:
|
||||||
|
|
||||||
**MySQL**:
|
**MySQL**:
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
SELECT itemid AS metric, clock AS time_sec, {aggFunc}(value) as value
|
SELECT itemid AS metric, clock AS time_sec, {aggFunc}(value) as value
|
||||||
FROM {historyTable}
|
FROM {historyTable}
|
||||||
@@ -35,6 +49,7 @@ ORDER BY time_sec ASC
|
|||||||
```
|
```
|
||||||
|
|
||||||
**PostgreSQL**:
|
**PostgreSQL**:
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
SELECT to_char(itemid, 'FM99999999999999999999') AS metric,
|
SELECT to_char(itemid, 'FM99999999999999999999') AS metric,
|
||||||
clock / {intervalSec} * {intervalSec} AS time,
|
clock / {intervalSec} * {intervalSec} AS time,
|
||||||
@@ -53,6 +68,7 @@ When getting trends, the plugin additionally queries a particular value column (
|
|||||||
depends on `consolidateBy` function value:
|
depends on `consolidateBy` function value:
|
||||||
|
|
||||||
**MySQL**:
|
**MySQL**:
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
SELECT itemid AS metric, clock AS time_sec, {aggFunc}({valueColumn}) as value
|
SELECT itemid AS metric, clock AS time_sec, {aggFunc}({valueColumn}) as value
|
||||||
FROM {trendsTable}
|
FROM {trendsTable}
|
||||||
@@ -63,6 +79,7 @@ ORDER BY time_sec ASC
|
|||||||
```
|
```
|
||||||
|
|
||||||
**PostgreSQL**:
|
**PostgreSQL**:
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
SELECT to_char(itemid, 'FM99999999999999999999') AS metric,
|
SELECT to_char(itemid, 'FM99999999999999999999') AS metric,
|
||||||
clock / {intervalSec} * {intervalSec} AS time,
|
clock / {intervalSec} * {intervalSec} AS time,
|
||||||
@@ -79,9 +96,11 @@ ORDER BY time ASC
|
|||||||
As you can see, the Grafana-Zabbix plugin uses aggregation by a given time interval. This interval is provided by Grafana and depends on the panel width in pixels. Thus, Grafana displays the data in the proper resolution.
|
As you can see, the Grafana-Zabbix plugin uses aggregation by a given time interval. This interval is provided by Grafana and depends on the panel width in pixels. Thus, Grafana displays the data in the proper resolution.
|
||||||
|
|
||||||
## InfluxDB
|
## InfluxDB
|
||||||
|
|
||||||
Zabbix supports loadable modules which makes possible to write history data into an external database. There's a [module](https://github.com/i-ky/effluence) for InfluxDB written by [Gleb Ivanovsky](https://github.com/i-ky) which can export history into InfluxDB in real-time.
|
Zabbix supports loadable modules which makes possible to write history data into an external database. There's a [module](https://github.com/i-ky/effluence) for InfluxDB written by [Gleb Ivanovsky](https://github.com/i-ky) which can export history into InfluxDB in real-time.
|
||||||
|
|
||||||
#### InfluxDB retention policy
|
### InfluxDB retention policy
|
||||||
|
|
||||||
In order to keep database size under control, you should use InfluxDB retention policy mechanism. It's possible to create retention policy for long-term data and write aggregated data in the same manner as Zabbix does (trends). Then this retention policy can be used in plugin for getting data after a certain period ([Retention Policy](../../configuration/#direct-db-connection) option in data source config). Read more about how to configure retention policy for using with plugin in effluence module [docs](https://github.com/i-ky/effluence#database-sizing).
|
In order to keep database size under control, you should use InfluxDB retention policy mechanism. It's possible to create retention policy for long-term data and write aggregated data in the same manner as Zabbix does (trends). Then this retention policy can be used in plugin for getting data after a certain period ([Retention Policy](../../configuration/#direct-db-connection) option in data source config). Read more about how to configure retention policy for using with plugin in effluence module [docs](https://github.com/i-ky/effluence#database-sizing).
|
||||||
|
|
||||||
#### InfluxDB Query
|
#### InfluxDB Query
|
||||||
@@ -1,5 +1,17 @@
|
|||||||
Functions reference
|
---
|
||||||
===================
|
title: Functions reference
|
||||||
|
menuTitle: Functions reference
|
||||||
|
description: Functions reference
|
||||||
|
aliases:
|
||||||
|
keywords:
|
||||||
|
- data source
|
||||||
|
- zabbix
|
||||||
|
labels:
|
||||||
|
products:
|
||||||
|
- oss
|
||||||
|
- grafana cloud
|
||||||
|
weight: 510
|
||||||
|
---
|
||||||
|
|
||||||
## Functions Variables
|
## Functions Variables
|
||||||
|
|
||||||
@@ -11,7 +23,8 @@ There are some built-in template variables available for using in functions:
|
|||||||
- `$__range_series` - invoke function over all series values
|
- `$__range_series` - invoke function over all series values
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
groupBy($__range, avg)
|
groupBy($__range, avg)
|
||||||
percentile($__range_series, 95) - 95th percentile over all values
|
percentile($__range_series, 95) - 95th percentile over all values
|
||||||
```
|
```
|
||||||
@@ -20,70 +33,85 @@ percentile($__range_series, 95) - 95th percentile over all values
|
|||||||
|
|
||||||
## Transform
|
## Transform
|
||||||
|
|
||||||
|
|
||||||
### _groupBy_
|
### _groupBy_
|
||||||
|
|
||||||
```
|
```sh
|
||||||
groupBy(interval, function)
|
groupBy(interval, function)
|
||||||
```
|
```
|
||||||
|
|
||||||
Takes each timeseries and consolidate its points fallen in the given _interval_ into one point using _function_, which can be one of: _avg_, _min_, _max_, _median_.
|
Takes each timeseries and consolidate its points fallen in the given _interval_ into one point using _function_, which can be one of: _avg_, _min_, _max_, _median_.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
groupBy(10m, avg)
|
groupBy(10m, avg)
|
||||||
groupBy(1h, median)
|
groupBy(1h, median)
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _scale_
|
### _scale_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
scale(factor)
|
scale(factor)
|
||||||
```
|
```
|
||||||
|
|
||||||
Takes timeseries and multiplies each point by the given _factor_.
|
Takes timeseries and multiplies each point by the given _factor_.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
scale(100)
|
scale(100)
|
||||||
scale(0.01)
|
scale(0.01)
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _delta_
|
### _delta_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
delta()
|
delta()
|
||||||
```
|
```
|
||||||
|
|
||||||
Converts absolute values to delta. This function just calculate difference between values. For the per-second
|
Converts absolute values to delta. This function just calculate difference between values. For the per-second
|
||||||
calculation use `rate()`.
|
calculation use `rate()`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _rate_
|
### _rate_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
rate()
|
rate()
|
||||||
```
|
```
|
||||||
|
|
||||||
Calculates the per-second rate of increase of the time series. Resistant to counter reset. Suitable for converting of
|
Calculates the per-second rate of increase of the time series. Resistant to counter reset. Suitable for converting of
|
||||||
growing counters into the per-second rate.
|
growing counters into the per-second rate.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _movingAverage_
|
### _movingAverage_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
movingAverage(windowSize)
|
movingAverage(windowSize)
|
||||||
```
|
```
|
||||||
|
|
||||||
Graphs the moving average of a metric over a fixed number of past points, specified by `windowSize` param.
|
Graphs the moving average of a metric over a fixed number of past points, specified by `windowSize` param.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
movingAverage(60)
|
movingAverage(60)
|
||||||
calculates moving average over 60 points (if metric has 1 second resolution it matches 1 minute window)
|
calculates moving average over 60 points (if metric has 1 second resolution it matches 1 minute window)
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _exponentialMovingAverage_
|
### _exponentialMovingAverage_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
exponentialMovingAverage(windowSize)
|
exponentialMovingAverage(windowSize)
|
||||||
```
|
```
|
||||||
|
|
||||||
Takes a series of values and a window size and produces an exponential moving average utilizing the following formula:
|
Takes a series of values and a window size and produces an exponential moving average utilizing the following formula:
|
||||||
`ema(current) = constant * (Current Value) + (1 - constant) * ema(previous)`
|
`ema(current) = constant * (Current Value) + (1 - constant) * ema(previous)`
|
||||||
|
|
||||||
@@ -99,50 +127,63 @@ hack: assume, previous N points have the same average values as first N (windowS
|
|||||||
in mind and don't rely on first N points interval.
|
in mind and don't rely on first N points interval.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
movingAverage(60)
|
movingAverage(60)
|
||||||
calculates moving average over 60 points (if metric has 1 second resolution it matches 1 minute window)
|
calculates moving average over 60 points (if metric has 1 second resolution it matches 1 minute window)
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _percentile_
|
### _percentile_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
percentile(interval, N)
|
percentile(interval, N)
|
||||||
```
|
```
|
||||||
|
|
||||||
Takes a series of values and a window size and consolidate all its points fallen in the given _interval_ into one point by Nth percentile.
|
Takes a series of values and a window size and consolidate all its points fallen in the given _interval_ into one point by Nth percentile.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
percentile(1h, 99)
|
percentile(1h, 99)
|
||||||
percentile($__range_series, 95) - 95th percentile over all series values
|
percentile($__range_series, 95) - 95th percentile over all series values
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _removeAboveValue_
|
### _removeAboveValue_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
removeAboveValue(N)
|
removeAboveValue(N)
|
||||||
```
|
```
|
||||||
|
|
||||||
Replaces series values with `null` if value > N
|
Replaces series values with `null` if value > N
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
removeAboveValue(1)
|
removeAboveValue(1)
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _removeBelowValue_
|
### _removeBelowValue_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
removeBelowValue(N)
|
removeBelowValue(N)
|
||||||
```
|
```
|
||||||
|
|
||||||
Replaces series values with `null` if value < N
|
Replaces series values with `null` if value < N
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _transformNull_
|
### _transformNull_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
transformNull(N)
|
transformNull(N)
|
||||||
```
|
```
|
||||||
|
|
||||||
Replaces `null` values with N
|
Replaces `null` values with N
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -150,21 +191,25 @@ Replaces `null` values with N
|
|||||||
## Aggregate
|
## Aggregate
|
||||||
|
|
||||||
### _aggregateBy_
|
### _aggregateBy_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
aggregateBy(interval, function)
|
aggregateBy(interval, function)
|
||||||
```
|
```
|
||||||
|
|
||||||
Takes all timeseries and consolidate all its points fallen in the given _interval_ into one point using _function_, which can be one of: _avg_, _min_, _max_, _median_.
|
Takes all timeseries and consolidate all its points fallen in the given _interval_ into one point using _function_, which can be one of: _avg_, _min_, _max_, _median_.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
aggregateBy(10m, avg)
|
aggregateBy(10m, avg)
|
||||||
aggregateBy(1h, median)
|
aggregateBy(1h, median)
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _sumSeries_
|
### _sumSeries_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
sumSeries()
|
sumSeries()
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -173,13 +218,16 @@ This will add metrics together and return the sum at each datapoint. This method
|
|||||||
---
|
---
|
||||||
|
|
||||||
### _percentileAgg_
|
### _percentileAgg_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
percentileAgg(interval, N)
|
percentileAgg(interval, N)
|
||||||
```
|
```
|
||||||
|
|
||||||
Takes all timeseries and consolidate all its points fallen in the given _interval_ into one point by Nth percentile.
|
Takes all timeseries and consolidate all its points fallen in the given _interval_ into one point by Nth percentile.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
percentileAgg(1h, 99)
|
percentileAgg(1h, 99)
|
||||||
percentileAgg($__range_series, 95) - 95th percentile over all values
|
percentileAgg($__range_series, 95) - 95th percentile over all values
|
||||||
```
|
```
|
||||||
@@ -187,25 +235,31 @@ percentileAgg($__range_series, 95) - 95th percentile over all values
|
|||||||
---
|
---
|
||||||
|
|
||||||
### _average_
|
### _average_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
average(interval)
|
average(interval)
|
||||||
```
|
```
|
||||||
|
|
||||||
**Deprecated**, use `aggregateBy(interval, avg)` instead.
|
**Deprecated**, use `aggregateBy(interval, avg)` instead.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _min_
|
### _min_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
min(interval)
|
min(interval)
|
||||||
```
|
```
|
||||||
|
|
||||||
**Deprecated**, use `aggregateBy(interval, min)` instead.
|
**Deprecated**, use `aggregateBy(interval, min)` instead.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _max_
|
### _max_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
max(interval)
|
max(interval)
|
||||||
```
|
```
|
||||||
|
|
||||||
**Deprecated**, use `aggregateBy(interval, max)` instead.
|
**Deprecated**, use `aggregateBy(interval, max)` instead.
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -214,37 +268,42 @@ max(interval)
|
|||||||
|
|
||||||
### _top_
|
### _top_
|
||||||
|
|
||||||
```
|
```sh
|
||||||
top(N, value)
|
top(N, value)
|
||||||
```
|
```
|
||||||
|
|
||||||
Returns top N series, sorted by _value_, which can be one of: _avg_, _min_, _max_, _median_.
|
Returns top N series, sorted by _value_, which can be one of: _avg_, _min_, _max_, _median_.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
top(10, avg)
|
top(10, avg)
|
||||||
top(5, max)
|
top(5, max)
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _bottom_
|
### _bottom_
|
||||||
|
|
||||||
```
|
```sh
|
||||||
bottom(N, value)
|
bottom(N, value)
|
||||||
```
|
```
|
||||||
|
|
||||||
Returns bottom N series, sorted by _value_, which can be one of: _avg_, _min_, _max_, _median_.
|
Returns bottom N series, sorted by _value_, which can be one of: _avg_, _min_, _max_, _median_.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
bottom(5, avg)
|
bottom(5, avg)
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Trends
|
## Trends
|
||||||
|
|
||||||
### _trendValue_
|
### _trendValue_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
trendValue(valueType)
|
trendValue(valueType)
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -255,16 +314,20 @@ Specifying type of trend value returned by Zabbix when trends are used (avg, min
|
|||||||
## Time
|
## Time
|
||||||
|
|
||||||
### _timeShift_
|
### _timeShift_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
timeShift(interval)
|
timeShift(interval)
|
||||||
```
|
```
|
||||||
|
|
||||||
Draws the selected metrics shifted in time. If no sign is given, a minus sign ( - ) is implied which will shift the metric back in time. If a plus sign ( + ) is given, the metric will be shifted forward in time.
|
Draws the selected metrics shifted in time. If no sign is given, a minus sign ( - ) is implied which will shift the metric back in time. If a plus sign ( + ) is given, the metric will be shifted forward in time.
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
timeShift(24h) - shift metric back in 24h hours
|
timeShift(24h) - shift metric back in 24h hours
|
||||||
timeShift(-24h) - the same result as for timeShift(24h)
|
timeShift(-24h) - the same result as for timeShift(24h)
|
||||||
timeShift(+1d) - shift metric forward in 1 day
|
timeShift(+1d) - shift metric forward in 1 day
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Alias
|
## Alias
|
||||||
@@ -277,57 +340,66 @@ Following template variables available for using in `setAlias()` and `replaceAli
|
|||||||
- `$__zbx_host` - technical name of the host
|
- `$__zbx_host` - technical name of the host
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
setAlias($__zbx_host_name: $__zbx_item) -> backend01: CPU user time
|
setAlias($__zbx_host_name: $__zbx_item) -> backend01: CPU user time
|
||||||
setAlias(Item key: $__zbx_item_key) -> Item key: system.cpu.load[percpu,avg1]
|
setAlias(Item key: $__zbx_item_key) -> Item key: system.cpu.load[percpu,avg1]
|
||||||
setAlias($__zbx_host_name) -> backend01
|
setAlias($__zbx_host_name) -> backend01
|
||||||
```
|
```
|
||||||
|
|
||||||
### _setAlias_
|
### _setAlias_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
setAlias(alias)
|
setAlias(alias)
|
||||||
```
|
```
|
||||||
|
|
||||||
Returns given alias instead of the metric name.
|
Returns given alias instead of the metric name.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
setAlias(load)
|
setAlias(load)
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _setAliasByRegex_
|
### _setAliasByRegex_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
setAliasByRegex(regex)
|
setAliasByRegex(regex)
|
||||||
```
|
```
|
||||||
|
|
||||||
Returns part of the metric name matched by regex.
|
Returns part of the metric name matched by regex.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
setAlias(Zabbix busy [a-zA-Z]+)
|
setAlias(Zabbix busy [a-zA-Z]+)
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### _replaceAlias_
|
### _replaceAlias_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
replaceAlias(pattern, newAlias)
|
replaceAlias(pattern, newAlias)
|
||||||
```
|
```
|
||||||
|
|
||||||
Replace metric name using pattern. Pattern is regex or regular string. If regex is used, following special replacement patterns are supported:
|
Replace metric name using pattern. Pattern is regex or regular string. If regex is used, following special replacement patterns are supported:
|
||||||
|
|
||||||
|Pattern | Inserts|
|
| Pattern | Inserts |
|
||||||
----------|---------
|
| ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|$$ | Inserts a "$". |
|
| $$ | Inserts a "$". |
|
||||||
|$& | Inserts the matched substring. |
|
| $& | Inserts the matched substring. |
|
||||||
|$` | Inserts the portion of the string that precedes the matched substring. |
|
| $` | Inserts the portion of the string that precedes the matched substring. |
|
||||||
|$' | Inserts the portion of the string that follows the matched substring. |
|
| $' | Inserts the portion of the string that follows the matched substring. |
|
||||||
|$n | Where n is a non-negative integer less than 100, inserts the nth parenthesized submatch string, provided the first argument was a RegExp object. |
|
| $n | Where n is a non-negative integer less than 100, inserts the nth parenthesized submatch string, provided the first argument was a RegExp object. |
|
||||||
|
|
||||||
For more details see [String.prototype.replace()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) function.
|
For more details see [String.prototype.replace()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) function.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
```
|
|
||||||
|
```sh
|
||||||
CPU system time
|
CPU system time
|
||||||
replaceAlias(/CPU (.*) time/, $1) -> system
|
replaceAlias(/CPU (.*) time/, $1) -> system
|
||||||
|
|
||||||
@@ -340,12 +412,14 @@ replaceAlias(/.*CPU (.*) time/, $1) -> system
|
|||||||
backend01: CPU system time
|
backend01: CPU system time
|
||||||
replaceAlias(/(.*): CPU (.*) time/, $1 - $2) -> backend01 - system
|
replaceAlias(/(.*): CPU (.*) time/, $1 - $2) -> backend01 - system
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Special
|
## Special
|
||||||
|
|
||||||
### _consolidateBy_
|
### _consolidateBy_
|
||||||
```
|
|
||||||
|
```sh
|
||||||
consolidateBy(consolidationFunc)
|
consolidateBy(consolidationFunc)
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
page_title: Provisioning Grafana-Zabbix plugin
|
|
||||||
page_description: Grafana-Zabbix plugin provisioning instructions.
|
|
||||||
|
|
||||||
# Provisioning Grafana-Zabbix plugin
|
|
||||||
|
|
||||||
It’s now possible to configure datasources using config files with Grafana’s provisioning system. You can read more about how it works and all the settings you can set for datasources on the [provisioning docs page](http://docs.grafana.org/administration/provisioning/#datasources)
|
|
||||||
|
|
||||||
### Example Datasource Config File
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
apiVersion: 1
|
|
||||||
|
|
||||||
datasources:
|
|
||||||
- name: Zabbix
|
|
||||||
type: alexanderzobnin-zabbix-datasource
|
|
||||||
access: proxy
|
|
||||||
url: http://localhost/zabbix/api_jsonrpc.php
|
|
||||||
isDefault: true
|
|
||||||
jsonData:
|
|
||||||
# Zabbix API credentials
|
|
||||||
username: zabbix
|
|
||||||
password: zabbix
|
|
||||||
# Trends options
|
|
||||||
trends: true
|
|
||||||
trendsFrom: "7d"
|
|
||||||
trendsRange: "4d"
|
|
||||||
# Cache update interval
|
|
||||||
cacheTTL: "1h"
|
|
||||||
# Alerting options
|
|
||||||
alerting: true
|
|
||||||
addThresholds: false
|
|
||||||
alertingMinSeverity: 3
|
|
||||||
# Direct DB Connection options
|
|
||||||
dbConnectionEnable: true
|
|
||||||
# Name of existing datasource for Direct DB Connection
|
|
||||||
dbConnectionDatasourceName: MySQL Zabbix
|
|
||||||
# Retention policy name (InfluxDB only) for fetching long-term stored data.
|
|
||||||
# Leave it blank if only default retention policy used.
|
|
||||||
dbConnectionRetentionPolicy: one_year
|
|
||||||
# Disable acknowledges for read-only users
|
|
||||||
disableReadOnlyUsersAck: true
|
|
||||||
# Disable time series data alignment
|
|
||||||
disableDataAlignment: false
|
|
||||||
# Use value mapping from Zabbix
|
|
||||||
useZabbixValueMapping: true
|
|
||||||
version: 1
|
|
||||||
editable: false
|
|
||||||
|
|
||||||
- name: MySQL Zabbix
|
|
||||||
type: mysql
|
|
||||||
url: localhost:3306
|
|
||||||
database: zabbix
|
|
||||||
user: grafana
|
|
||||||
password: password
|
|
||||||
```
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
@import url('https://fonts.googleapis.com/css?family=Roboto|Source+Code+Pro');
|
|
||||||
|
|
||||||
.wy-side-nav-search, .wy-nav-top {
|
|
||||||
background-color: #8e3030;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wy-side-nav-search input[type=text] {
|
|
||||||
border-radius: 2px;
|
|
||||||
width: 100%;
|
|
||||||
border-color: #e3e3e3;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Content container */
|
|
||||||
.wy-nav-content {
|
|
||||||
max-width: 1200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rst-content .section {
|
|
||||||
color: #404040;
|
|
||||||
font-family: 'Roboto', 'Lato', 'proxima-nova', 'Helvetica Neue', Arial, sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rst-content p {
|
|
||||||
margin-bottom: 16px;
|
|
||||||
line-height: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rst-content li {
|
|
||||||
margin-top: 6px;
|
|
||||||
margin-bottom: 6px;
|
|
||||||
line-height: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rst-content img {
|
|
||||||
max-width: 80%;
|
|
||||||
max-height: 800px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rst-content blockquote {
|
|
||||||
max-width: 80%;
|
|
||||||
margin-left: 0em;
|
|
||||||
padding: 0 1em;
|
|
||||||
color: #757575;
|
|
||||||
border-left: 6px solid #e0e0e0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Source code highlighting */
|
|
||||||
|
|
||||||
code, .rst-content tt {
|
|
||||||
font-family: 'Source Code Pro', monospace;
|
|
||||||
font-size: 90%;
|
|
||||||
color: #404040;
|
|
||||||
background-color: #f4f4f4;
|
|
||||||
padding: 1px 5px;
|
|
||||||
border-radius: 2px;
|
|
||||||
border-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hljs {
|
|
||||||
max-width: 100%;
|
|
||||||
|
|
||||||
/* Colors are from solarized scheme. */
|
|
||||||
background-color: #fdf6e3;
|
|
||||||
color: #657b83;
|
|
||||||
|
|
||||||
border-width: 0 0 0 4px;
|
|
||||||
border-color: #eee8d5;
|
|
||||||
border-left-color: #268bd2;
|
|
||||||
|
|
||||||
font-size: 90%;
|
|
||||||
line-height: 1.5;
|
|
||||||
padding: 0.5em 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hljs-keyword {
|
|
||||||
color: #dc322f;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hljs-built_in {
|
|
||||||
color: #268bd2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hljs-string {
|
|
||||||
color: #859900;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hljs-variable {
|
|
||||||
color: #6c71c4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Functions list tweaks */
|
|
||||||
|
|
||||||
h3 em {
|
|
||||||
font-family: 'Source Code Pro', monospace;
|
|
||||||
line-height: 2;
|
|
||||||
padding-top: 20px;
|
|
||||||
font-style: normal;
|
|
||||||
padding-bottom: 2px;
|
|
||||||
border-bottom: 2px;
|
|
||||||
border-bottom-style: solid;
|
|
||||||
border-bottom-color: #2aa198;
|
|
||||||
color: #01579b;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
|
||||||
margin: 24px 0 48px 0;
|
|
||||||
}
|
|
||||||
0
docs/src/img/.gitattributes
vendored
@@ -1,10 +0,0 @@
|
|||||||
page_title: Grafana-Zabbix Upgrade
|
|
||||||
page_description: Upgrade instructions for Grafana-Zabbix.
|
|
||||||
|
|
||||||
# Upgrade
|
|
||||||
|
|
||||||
## Upgrade from 2.x
|
|
||||||
|
|
||||||
After [enabling](../../configuration/#enable-plugin) Zabbix App go to _Data Sources_, open your configured Zabbix
|
|
||||||
data source end select _Zabbix_ from _Type_ list again. This is needed because plugin id was changed
|
|
||||||
in Grafana 3.0.
|
|
||||||
2
docs/variables.mk
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# List of projects to provide to the make-docs script.
|
||||||
|
PROJECTS = plugins/alexanderzobnin-zabbix-app
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "grafana-zabbix",
|
"name": "grafana-zabbix",
|
||||||
"version": "4.4.4",
|
"version": "4.4.5",
|
||||||
"description": "Zabbix plugin for Grafana",
|
"description": "Zabbix plugin for Grafana",
|
||||||
"homepage": "http://grafana-zabbix.org",
|
"homepage": "http://grafana-zabbix.org",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { Icon } from '@grafana/ui';
|
import { Icon } from '@grafana/ui';
|
||||||
import { MetricFunc } from '../../types';
|
import { MetricFunc } from '../../types';
|
||||||
|
|
||||||
const DOCS_FUNC_REF_URL = 'https://grafana.github.io/grafana-zabbix/reference/functions/';
|
const DOCS_FUNC_REF_URL = 'https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/reference/functions/';
|
||||||
|
|
||||||
export interface FunctionEditorControlsProps {
|
export interface FunctionEditorControlsProps {
|
||||||
onMoveLeft: (func: MetricFunc) => void;
|
onMoveLeft: (func: MetricFunc) => void;
|
||||||
|
|||||||
@@ -8,9 +8,7 @@
|
|||||||
"name": "Grafana Labs",
|
"name": "Grafana Labs",
|
||||||
"url": "https://grafana.com"
|
"url": "https://grafana.com"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": ["zabbix"],
|
||||||
"zabbix"
|
|
||||||
],
|
|
||||||
"logos": {
|
"logos": {
|
||||||
"small": "img/icn-zabbix-app.svg",
|
"small": "img/icn-zabbix-app.svg",
|
||||||
"large": "img/icn-zabbix-app.svg"
|
"large": "img/icn-zabbix-app.svg"
|
||||||
@@ -22,11 +20,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Docs",
|
"name": "Docs",
|
||||||
"url": "https://grafana.github.io/grafana-zabbix"
|
"url": "https://grafana.com/docs/plugins/alexanderzobnin-zabbix-app/latest/"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "License",
|
"name": "License",
|
||||||
"url": "https://github.com/grafana/grafana-zabbix/blob/master/LICENSE"
|
"url": "https://github.com/grafana/grafana-zabbix/blob/main/LICENSE"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"screenshots": [
|
"screenshots": [
|
||||||
|
|||||||