Remove images from LFS
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
# SQL Data Source Configuration
|
||||
# Direct DB Data Source Configuration
|
||||
|
||||
## Security notes
|
||||
|
||||
Grafana-Zabbix plugin can use MySQL, Postgres or InfluxDB (if Zabbix configured to store history data in InfluxDB) data sources to query history and trend data directly from Zabbix database. In order to execute queries, plugin needs only read access to the `history`, `history_uint`, `trends` and `trends_uint` tables. To make connection more secure and prevent unnecessary data disclosure, it's highly recommended to grant read access to only that tables. But if you want to use this data source for querying another data, you can
|
||||
grant `SELECT` privileges to entire zabbix database. Also, all queries are invoked by grafana server, so you can restrict connection to only grafana host. Here's MySQL example:
|
||||
|
||||
```sql
|
||||
GRANT SELECT ON zabbix.* TO 'grafana'@'grafana-host' identified by 'password';
|
||||
```
|
||||
|
||||
## MySQL
|
||||
|
||||
@@ -9,29 +18,12 @@ In order to use _Direct DB Connection_ feature you should configure SQL data sou
|
||||
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.
|
||||
|
||||
### Security notes
|
||||
|
||||
As you can see in _User Permission_ note, Grafana doesn't restrict any queries to the database. So you should be careful
|
||||
and create a special user with limited access to Zabbix database. Grafana-Zabbix plugin uses only `SELECT` queries to
|
||||
`history`, `history_uint`, `trends` and `trends_uint` tables. So it's reasonable to grant only SELECT privileges to
|
||||
these tables for grafana user. But if you want to use this MySQL data source for querying another data, you can
|
||||
grant SELECT privileges to entire zabbix database.
|
||||
|
||||
Also, all queries are invoked by grafana-server, so you can restrict connection to only grafana host.
|
||||
|
||||
```sql
|
||||
GRANT SELECT ON zabbix.* TO 'grafana'@'grafana-host' identified by 'password';
|
||||
```
|
||||
|
||||
## PostgreSQL
|
||||
|
||||
Select _PostgreSQL_ data source type and provide your database host address and port (5432 is default). Fill
|
||||
database name (usually, `zabbix`) and specify credentials.
|
||||
|
||||

|
||||
### Security notes
|
||||
|
||||
Make sure you use read-only user for Zabbix database.
|
||||
|
||||
## InfluxDB
|
||||
|
||||
|
||||
@@ -4,53 +4,48 @@ page_description: Plugin configuration instructions for Grafana-Zabbix.
|
||||
# Configuration
|
||||
|
||||
## Enable plugin
|
||||
|
||||
Go to the plugins in Grafana side panel, select _Apps_ tab, then select _Zabbix_, open _Config_
|
||||
tab and enable plugin.
|
||||
|
||||

|
||||
|
||||
## Configure Zabbix data source
|
||||
|
||||
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
|
||||
|
||||
- **Url**: set Zabbix API url (full path with `api_jsonrpc.php`).
|
||||
- **Access**:
|
||||
- **Proxy**: access via Grafana backend
|
||||
- **Direct**: access from browser.
|
||||
- **URL**: set Zabbix API url (full path with `api_jsonrpc.php`).
|
||||
- **Access**: Set to `Server (default)`.
|
||||
- **Http Auth**: configure if you use proxy authentication.
|
||||
- **Basic Auth**:
|
||||
- **With Credentials**:
|
||||
|
||||
Proxy access means that the Grafana backend will proxy all requests from the browser, and send them on to the Data Source. This is useful because it can eliminate CORS (Cross Origin Site Resource) issues, as well as eliminate the need to disseminate authentication details to the Data Source to the browser.
|
||||
|
||||
Direct access is still supported because in some cases it may be useful to access a Data Source directly depending on the use case and topology of Grafana, the user, and the Data Source.
|
||||
- **Basic Auth**:
|
||||
- **With Credentials**:
|
||||
|
||||
### Zabbix API details
|
||||
|
||||
- **User** and **Password**: setup login for access to Zabbix API. Also check user's permissions
|
||||
in Zabbix if you can't get any groups and hosts in Grafana.
|
||||
- **Trends**: enable if you use Zabbix 3.x or patch for trends
|
||||
support in Zabbix 2.x ([ZBXNEXT-1193](https://support.zabbix.com/browse/ZBXNEXT-1193)). This option
|
||||
- **Username** and **Password**: setup login for access to Zabbix API. Also check user's permissions
|
||||
in Zabbix if you cannot get any groups and hosts in Grafana.
|
||||
- **Trends**: enable if you use Zabbix 3.x or newer. This option is
|
||||
strictly recommended for displaying long time periods (more than few days, depending of your item's
|
||||
updating interval in Zabbix) because few days of item history contains tons of points. Using trends
|
||||
updating interval in Zabbix), because few days of item history contains tons of points. Using trends
|
||||
will increase Grafana performance.
|
||||
- **After**: time after which trends will be used.
|
||||
- **After**: time after which trends will be used.
|
||||
Best practice is to set this value to your history storage period (7d, 30d, etc). Default is **7d** (7 days).
|
||||
You can set the time in Grafana format. Valid time specificators are:
|
||||
- **h** - hours
|
||||
- **d** - days
|
||||
- **M** - months
|
||||
- **Range**: Time range width after which trends will be used instead of history.
|
||||
- **h** - hours
|
||||
- **d** - days
|
||||
- **M** - months
|
||||
- **Range**: Time range width after which trends will be used instead of history.
|
||||
It's better to set this value in range of 4 to 7 days to prevent loading large amount of history data.
|
||||
Default is 4 days.
|
||||
- **Cache TTL**: plugin caches some api requests for increasing performance. Set this
|
||||
value to desired cache lifetime (this option affect data like items list).
|
||||
- **Timeout**: Zabbix connection timeout in seconds. Default is 30.
|
||||
|
||||
### Direct DB Connection
|
||||
|
||||
@@ -70,47 +65,18 @@ Read [how to configure](./direct_db_datasource) SQL data source in Grafana.
|
||||
|
||||
### Other
|
||||
|
||||
- **Disable acknowledges for read-only users**: disable ability to acknowledge problems from Grafana for non-editors.
|
||||
|
||||
- **Disable data alignment**: disable time series data alignment. This feature aligns points based on item update interval. For instance, if value collected once per minute, then timestamp of the each point will be set to the start of corresponding minute. This alignment required for proper work of the stacked graphs. If you don't need stacked graphs and want to get exactly the same timestamps as in Zabbix, then you can disable this feature. Also, data alignment can be toggled for each query individually, in the query options.
|
||||
|
||||
Then click _Add_ - datasource will be added and you can check connection using
|
||||
_Test Connection_ button. This feature can help to find some mistakes like invalid user name
|
||||
or password, wrong api url.
|
||||
|
||||

|
||||
Then click _Add_ - data source will be added and you can check connection using _Test Connection_ button. This feature can help to find some mistakes like invalid user name or password, wrong api url.
|
||||
|
||||
## Import example dashboards
|
||||
|
||||
You can import dashboard examples from _Dashboards_ tab in plugin config.
|
||||
You can import dashboard examples from _Dashboards_ tab in the data source config.
|
||||
|
||||

|
||||
|
||||
## Note about Zabbix 2.2 or less
|
||||
|
||||
Zabbix API (api_jsonrpc.php) before zabbix 2.4 don't allow cross-domain requests (CORS). And you
|
||||
can get HTTP error 412 (Precondition Failed).
|
||||
To fix it add this code to api_jsonrpc.php immediately after the copyright:
|
||||
|
||||
```php
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Headers: Content-Type');
|
||||
header('Access-Control-Allow-Methods: POST');
|
||||
header('Access-Control-Max-Age: 1000');
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
||||
return;
|
||||
}
|
||||
```
|
||||
|
||||
before
|
||||
|
||||
```php
|
||||
require_once dirname(__FILE__).'/include/func.inc.php';
|
||||
require_once dirname(__FILE__).'/include/classes/core/CHttpRequest.php';
|
||||
```
|
||||
|
||||
[Full fix listing](https://gist.github.com/alexanderzobnin/f2348f318d7a93466a0c).
|
||||
For more details see zabbix issues [ZBXNEXT-1377](https://support.zabbix.com/browse/ZBXNEXT-1377)
|
||||
and [ZBX-8459](https://support.zabbix.com/browse/ZBX-8459).
|
||||
|
||||
## Note about Browser Cache
|
||||
|
||||
After updating plugin, clear browser cache and reload application page. See details
|
||||
|
||||
Reference in New Issue
Block a user