diff --git a/docs/sources/img/installation-enable_app.png b/docs/sources/img/installation-enable_app.png index 781e297..0c8db7b 100644 --- a/docs/sources/img/installation-enable_app.png +++ b/docs/sources/img/installation-enable_app.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c46b44d6db23e898c29e72a3c3df3f36d62d712206b3453c18c173fcbcc5529 -size 139772 +oid sha256:dc8ff42dbfa78458edcf931377156775973b87037b358daf82ecd5a3e49787b7 +size 138620 diff --git a/docs/sources/img/installation-plugin-dashboards.png b/docs/sources/img/installation-plugin-dashboards.png index 2b82016..e1cdbd5 100644 --- a/docs/sources/img/installation-plugin-dashboards.png +++ b/docs/sources/img/installation-plugin-dashboards.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:98e41015ed5e6738645065a057af30ce46482ec6797e4cbe85d9990e1fdce5be -size 140142 +oid sha256:4932343924aa2416b72e46344e61335f2c0c4472575b919ee0629933d2c74b3e +size 139070 diff --git a/docs/sources/img/installation-plugins-apps.png b/docs/sources/img/installation-plugins-apps.png index c931d73..ec3ca67 100644 --- a/docs/sources/img/installation-plugins-apps.png +++ b/docs/sources/img/installation-plugins-apps.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fcaa6263d827d3344eb88fec28b1b3b084856af80174551e8c0725c3fd99e982 -size 132477 +oid sha256:ef6860cefddd6ead2fe97d1ff3ebaa14320e8b0366fc094c13a47a6502e62f42 +size 131496 diff --git a/docs/sources/installation/configuration.md b/docs/sources/installation/configuration.md index 9ef80e3..3f16aa7 100644 --- a/docs/sources/installation/configuration.md +++ b/docs/sources/installation/configuration.md @@ -17,14 +17,20 @@ select _Zabbix_ from dropdown list. ![Configure Zabbix data source](../img/installation-datasource_config.png) -### Http settings +### HTTP settings - **Url**: set Zabbix API url (full path with `api_jsonrpc.php`). -- **Access**: can be either _proxy_ or _direct_. +- **Access**: + - **Proxy**: access via Grafana backend + - **Direct**: access from browser. - **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. + ### Zabbix API details - **User** and **Password**: setup login for access to Zabbix API. Also check user's permissions diff --git a/docs/sources/installation/index.md b/docs/sources/installation/index.md index 3f10253..0c3f0ad 100644 --- a/docs/sources/installation/index.md +++ b/docs/sources/installation/index.md @@ -3,11 +3,43 @@ page_description: Installation instructions for Grafana-Zabbix. # Installation -## From release package -Download [latest release](https://github.com/alexanderzobnin/grafana-zabbix/releases/latest) -for relative Grafana version. Unpack archive and copy *grafana-zabbix* into your grafana -plugins directory (default `/var/lib/grafana/plugins` if your installing grafana with package). -Restart grafana-server and the plugin should be automatically detected and used. +## Using grafana-cli tool +Get list of available plugins + +```sh +grafana-cli plugins list-remote +``` + +Install zabbix plugin + +```sh +grafana-cli plugins install alexanderzobnin-zabbix-app +``` + +Restart grafana after installing plugins +```sh +service grafana-server restart +``` + +Read more about installing plugins in [Grafana docs](http://docs.grafana.org/plugins/installation/) + +## From special repo +You can use [grafana-zabbix-app](https://github.com/alexanderzobnin/grafana-zabbix-app) repo, +which contains latest builded version of plugin. + +```sh +cd /var/lib/grafana/plugins +git clone https://github.com/alexanderzobnin/grafana-zabbix-app +``` + +Then restart grafana server. + +Using this way you can easy upgrade plugin just running +```sh +cd /var/lib/grafana/plugins/grafana-zabbix-app +git pull +service grafana-server restart +``` ## Building from sources You need NodeJS, npm and Grunt for building plugin from sources. Read more about required versions @@ -39,22 +71,6 @@ grunt Restart Grafana server ```sh -sudo service grafana-server restart +service grafana-server restart systemctl restart grafana-server ``` - -## Using grafana-cli tool - -Get list of available plugins - -```sh -grafana-cli plugins list-remote -``` - -Install zabbix plugin - -```sh -grafana-cli plugins install zabbix-app -``` - -Read more in [Grafana docs](http://docs.grafana.org/plugins/installation/) diff --git a/src/datasource-zabbix/add-metric-function.directive.js b/src/datasource-zabbix/add-metric-function.directive.js index a3676ee..88448e5 100644 --- a/src/datasource-zabbix/add-metric-function.directive.js +++ b/src/datasource-zabbix/add-metric-function.directive.js @@ -8,10 +8,10 @@ angular .module('grafana.directives') .directive('addMetricFunction', function($compile) { var inputTemplate = ''; - var buttonTemplate = '' + ''; diff --git a/src/datasource-zabbix/partials/query.editor.html b/src/datasource-zabbix/partials/query.editor.html index c1b042c..eb858c5 100644 --- a/src/datasource-zabbix/partials/query.editor.html +++ b/src/datasource-zabbix/partials/query.editor.html @@ -1,226 +1,149 @@ -
- - - +
+
+
+
+ - + + + + +
+
+
+ - -
- + }"> + -
-
+ +
-
  • Application
  • -
  • +
    + -
  • +
    -
  • Item
  • -
  • +
    + -
  • -
  • - - - - {{ctrl.queryOptionsText}} - -
  • - - -
    - - - -
    - -
    -
    - - -
    -
    -
    -
      -
    • - Show disabled items -
    • -
    • - - -
    • -
    -
    +
    + +
    +
    + +
    +
    +
    -
    - -
    - + ng-blur="ctrl.onTargetBlur()"> +
    -
    - + + + + diff --git a/src/datasource-zabbix/query.controller.js b/src/datasource-zabbix/query.controller.js index f8c156c..bbc0269 100644 --- a/src/datasource-zabbix/query.controller.js +++ b/src/datasource-zabbix/query.controller.js @@ -26,9 +26,9 @@ export class ZabbixQueryController extends QueryCtrl { this.templateSrv = templateSrv; this.editorModes = { - 0: 'num', - 1: 'itservice', - 2: 'text' + 0: {value: 'num', text: 'Numeric metrics', mode: 0}, + 1: {value: 'itservice', text: 'IT Services', mode: 1}, + 2: {value: 'text', text: 'Text metrics', mode: 2} }; // Map functions for bs-typeahead @@ -63,8 +63,7 @@ export class ZabbixQueryController extends QueryCtrl { functions: [], options: { showDisabledItems: false - }, - refId: "A" + } }; _.defaults(target, targetDefaults); @@ -102,7 +101,7 @@ export class ZabbixQueryController extends QueryCtrl { initFilters() { var self = this; - var itemtype = self.editorModes[self.target.mode]; + var itemtype = self.editorModes[self.target.mode].value; return this.$q.when(this.suggestGroups()) .then(() => {return self.suggestHosts();}) .then(() => {return self.suggestApps();})