Merge branch 'develop'
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
define([
|
define([
|
||||||
'angular',
|
'angular',
|
||||||
'lodash',
|
'lodash',
|
||||||
'kbn',
|
'app/core/utils/datemath',
|
||||||
|
'./directives',
|
||||||
'./zabbixAPIWrapper',
|
'./zabbixAPIWrapper',
|
||||||
'./helperFunctions',
|
'./helperFunctions',
|
||||||
'./queryCtrl'
|
'./queryCtrl'
|
||||||
],
|
],
|
||||||
function (angular, _, kbn) {
|
function (angular, _, dateMath) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var module = angular.module('grafana.services');
|
var module = angular.module('grafana.services');
|
||||||
@@ -93,9 +94,9 @@ function (angular, _, kbn) {
|
|||||||
ZabbixAPIDatasource.prototype.query = function(options) {
|
ZabbixAPIDatasource.prototype.query = function(options) {
|
||||||
|
|
||||||
// get from & to in seconds
|
// get from & to in seconds
|
||||||
var from = Math.ceil(kbn.parseDate(options.range.from).getTime() / 1000);
|
var from = Math.ceil(dateMath.parse(options.range.from) / 1000);
|
||||||
var to = Math.ceil(kbn.parseDate(options.range.to).getTime() / 1000);
|
var to = Math.ceil(dateMath.parse(options.range.to) / 1000);
|
||||||
var useTrendsFrom = Math.ceil(kbn.parseDate('now-' + this.trendsFrom).getTime() / 1000);
|
var useTrendsFrom = Math.ceil(dateMath.parse('now-' + this.trendsFrom) / 1000);
|
||||||
|
|
||||||
// Create request for each target
|
// Create request for each target
|
||||||
var promises = _.map(options.targets, function(target) {
|
var promises = _.map(options.targets, function(target) {
|
||||||
@@ -336,8 +337,8 @@ function (angular, _, kbn) {
|
|||||||
/////////////////
|
/////////////////
|
||||||
|
|
||||||
ZabbixAPIDatasource.prototype.annotationQuery = function(annotation, rangeUnparsed) {
|
ZabbixAPIDatasource.prototype.annotationQuery = function(annotation, rangeUnparsed) {
|
||||||
var from = Math.ceil(kbn.parseDate(rangeUnparsed.from).getTime() / 1000);
|
var from = Math.ceil(dateMath.parse(rangeUnparsed.from) / 1000);
|
||||||
var to = Math.ceil(kbn.parseDate(rangeUnparsed.to).getTime() / 1000);
|
var to = Math.ceil(dateMath.parse(rangeUnparsed.to) / 1000);
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var params = {
|
var params = {
|
||||||
|
|||||||
17
zabbix/directives.js
Normal file
17
zabbix/directives.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
define([
|
||||||
|
'angular'
|
||||||
|
],
|
||||||
|
function (angular) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var module = angular.module('grafana.directives');
|
||||||
|
|
||||||
|
module.directive('metricQueryEditorZabbix', function() {
|
||||||
|
return {controller: 'ZabbixAPIQueryCtrl', templateUrl: 'app/plugins/datasource/zabbix/partials/query.editor.html'};
|
||||||
|
});
|
||||||
|
|
||||||
|
module.directive('metricQueryOptionsZabbix', function() {
|
||||||
|
return {templateUrl: 'app/plugins/datasource/zabbix/partials/query.options.html'};
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
@@ -1,318 +1,227 @@
|
|||||||
<div class="editor-row">
|
<div class="tight-form">
|
||||||
|
<ul class="tight-form-list pull-right">
|
||||||
|
<li class="tight-form-item small" ng-show="target.datasource">
|
||||||
|
<em>{{target.datasource}}</em>
|
||||||
|
</li>
|
||||||
|
<li class="tight-form-item">
|
||||||
|
<div class="dropdown">
|
||||||
|
<a class="pointer dropdown-toggle"
|
||||||
|
data-toggle="dropdown"
|
||||||
|
tabindex="1">
|
||||||
|
<i class="fa fa-bars"></i>
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu pull-right" role="menu">
|
||||||
|
<!-- Switch editor mode -->
|
||||||
|
<li role="menuitem" ng-show="target.mode">
|
||||||
|
<a class="pointer" tabindex="1"
|
||||||
|
ng-click="switchEditorMode(0)">Numeric metrics</a>
|
||||||
|
</li>
|
||||||
|
<li role="menuitem" ng-show="target.mode != 1">
|
||||||
|
<a class="pointer" tabindex="1"
|
||||||
|
ng-click="switchEditorMode(1)">IT services</a>
|
||||||
|
</li>
|
||||||
|
<li role="menuitem" ng-show="target.mode != 2">
|
||||||
|
<a class="pointer" tabindex="1"
|
||||||
|
ng-click="switchEditorMode(2)">Text metrics</a>
|
||||||
|
</li>
|
||||||
|
<li class="divider" role="menuitem"></li>
|
||||||
|
<li role="menuitem"><a tabindex="1" ng-click="duplicate()">Duplicate</a></li>
|
||||||
|
<li role="menuitem"><a tabindex="1" ng-click="moveMetricQuery($index, $index-1)">Move up</a></li>
|
||||||
|
<li role="menuitem"><a tabindex="1" ng-click="moveMetricQuery($index, $index+1)">Move down</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="tight-form-item last">
|
||||||
|
<a class="pointer" tabindex="1" ng-click="removeDataQuery(target)">
|
||||||
|
<i class="fa fa-remove"></i>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<div ng-repeat="target in panel.targets"
|
<ul class="tight-form-list">
|
||||||
class="tight-form-container"
|
<li class="tight-form-item" style="min-width: 15px; text-align: center">
|
||||||
ng-class="{'tight-form-disabled': target.hide}"
|
{{target.refId}}
|
||||||
ng-controller="ZabbixAPIQueryCtrl"
|
</li>
|
||||||
ng-init="init()">
|
<li>
|
||||||
|
<a class="tight-form-item"
|
||||||
|
ng-click="target.hide = !target.hide; get_data();"
|
||||||
|
role="menuitem">
|
||||||
|
<i class="fa fa-eye"></i>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<div class="tight-form">
|
<!-- IT Service editor -->
|
||||||
<ul class="tight-form-list pull-right">
|
<ul class="tight-form-list" role="menu" ng-show="target.mode == 1">
|
||||||
<li class="tight-form-item">
|
<li class="tight-form-item input-small">IT Service</li>
|
||||||
<div class="dropdown">
|
<li>
|
||||||
<a class="pointer dropdown-toggle"
|
<select class="tight-form-input input-large"
|
||||||
data-toggle="dropdown"
|
ng-change="selectITService()"
|
||||||
tabindex="1">
|
ng-model="target.itservice"
|
||||||
<i class="fa fa-bars"></i>
|
bs-tooltip="target.itservice.name.length > 25 ? target.itservice.name : ''"
|
||||||
</a>
|
ng-options="itservice.name for itservice in itserviceList track by itservice.name">
|
||||||
<ul class="dropdown-menu pull-right" role="menu">
|
<option value="">-- Select IT service --</option>
|
||||||
<!-- Switch editor mode -->
|
</select>
|
||||||
<li role="menuitem" ng-show="target.mode">
|
</li>
|
||||||
<a class="pointer" tabindex="1"
|
<li class="tight-form-item input-medium">IT service property</li>
|
||||||
ng-click="switchEditorMode(0)">Numeric metrics</a>
|
<li>
|
||||||
</li>
|
<select class="tight-form-input input-medium"
|
||||||
<li role="menuitem" ng-show="target.mode != 1">
|
ng-change="selectITService()"
|
||||||
<a class="pointer" tabindex="1"
|
ng-model="target.slaProperty"
|
||||||
ng-click="switchEditorMode(1)">IT services</a>
|
ng-options="slaProperty.name for slaProperty in slaPropertyList track by slaProperty.name">
|
||||||
</li>
|
<option value="">-- Property --</option>
|
||||||
<li role="menuitem" ng-show="target.mode != 2">
|
</select>
|
||||||
<a class="pointer" tabindex="1"
|
</li>
|
||||||
ng-click="switchEditorMode(2)">Text metrics</a>
|
</ul>
|
||||||
</li>
|
|
||||||
<li class="divider" role="menuitem"></li>
|
|
||||||
<li role="menuitem"><a tabindex="1" ng-click="duplicate()">Duplicate</a></li>
|
|
||||||
<li role="menuitem"><a tabindex="1" ng-click="moveMetricQuery($index, $index-1)">Move up</a></li>
|
|
||||||
<li role="menuitem"><a tabindex="1" ng-click="moveMetricQuery($index, $index+1)">Move down</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li class="tight-form-item last">
|
|
||||||
<a class="pointer" tabindex="1" ng-click="removeDataQuery(target)">
|
|
||||||
<i class="fa fa-remove"></i>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<ul class="tight-form-list">
|
<ul class="tight-form-list" role="menu" ng-hide="target.mode == 1">
|
||||||
<li class="tight-form-item" style="min-width: 15px; text-align: center">
|
<!-- Alias -->
|
||||||
{{targetLetters[$index]}}
|
<li>
|
||||||
</li>
|
<input type="text"
|
||||||
<li>
|
class="tight-form-input input-medium"
|
||||||
<a class="tight-form-item"
|
ng-model="target.alias"
|
||||||
ng-click="target.hide = !target.hide; get_data();"
|
spellcheck='false'
|
||||||
role="menuitem">
|
placeholder="Alias"
|
||||||
<i class="fa fa-eye"></i>
|
ng-blur="targetBlur()">
|
||||||
</a>
|
</li>
|
||||||
</li>
|
<!-- Select Host Group -->
|
||||||
</ul>
|
<li class="tight-form-item input-small" style="width: 5em">Group</li>
|
||||||
|
<li>
|
||||||
|
<select class="tight-form-input input-large"
|
||||||
|
ng-change="selectHostGroup()"
|
||||||
|
ng-model="target.group"
|
||||||
|
bs-tooltip="target.group.name.length > 25 ? target.group.name : ''"
|
||||||
|
ng-options="group.visible_name ? group.visible_name : group.name for group in metric.groupList track by group.name">
|
||||||
|
<option value="">-- Select host group --</option>
|
||||||
|
</select>
|
||||||
|
<a bs-tooltip="target.errors.metric"
|
||||||
|
style="color: rgb(229, 189, 28)"
|
||||||
|
ng-show="target.errors.metric">
|
||||||
|
<i class="fa fa-warning"></i>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<!-- Select Host -->
|
||||||
|
<li class="tight-form-item input-small" style="width: 3em">Host</li>
|
||||||
|
<li>
|
||||||
|
<select class="tight-form-input input-large"
|
||||||
|
ng-change="selectHost()"
|
||||||
|
ng-model="target.host"
|
||||||
|
bs-tooltip="target.host.name.length > 25 ? target.host.name : ''"
|
||||||
|
ng-options="host.visible_name ? host.visible_name : host.name for host in metric.hostList track by host.name">
|
||||||
|
<option value="">-- Select host --</option>
|
||||||
|
</select>
|
||||||
|
<a bs-tooltip="target.errors.metric"
|
||||||
|
style="color: rgb(229, 189, 28)"
|
||||||
|
ng-show="target.errors.metric">
|
||||||
|
<i class="icon-warning-sign"></i>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<!-- Host filter -->
|
||||||
|
<li class="tight-form-item" ng-hide="target.mode == 2">
|
||||||
|
Filter
|
||||||
|
<i class="fa fa-question-circle"
|
||||||
|
bs-tooltip="'Filtering hosts by regex. Select All in items and specify regex for host names.'"></i>
|
||||||
|
</li>
|
||||||
|
<li ng-hide="target.mode == 2">
|
||||||
|
<input type="text"
|
||||||
|
class="tight-form-input input-large"
|
||||||
|
ng-model="target.hostFilter"
|
||||||
|
spellcheck='false'
|
||||||
|
placeholder="Host filter (regex)"
|
||||||
|
ng-blur="targetBlur()">
|
||||||
|
</li>
|
||||||
|
<!-- Downsampling function -->
|
||||||
|
<li class="tight-form-item input-medium" ng-hide="target.mode == 2">
|
||||||
|
Downsampling
|
||||||
|
</li>
|
||||||
|
<li ng-hide="target.mode == 2">
|
||||||
|
<select class="tight-form-input input-small"
|
||||||
|
ng-change="targetBlur()"
|
||||||
|
ng-model="target.downsampleFunction"
|
||||||
|
bs-tooltip="'Downsampling function'"
|
||||||
|
ng-options="func.name for func in downsampleFunctionList track by func.name">
|
||||||
|
</select>
|
||||||
|
<a bs-tooltip="target.errors.metric"
|
||||||
|
style="color: rgb(229, 189, 28)"
|
||||||
|
ng-show="target.errors.metric">
|
||||||
|
<i class="icon-warning-sign"></i>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<!-- IT Service editor -->
|
<div class="clearfix"></div>
|
||||||
<ul class="tight-form-list" role="menu" ng-show="target.mode == 1">
|
|
||||||
<li class="tight-form-item input-small">IT Service</li>
|
|
||||||
<li>
|
|
||||||
<select class="tight-form-input input-large"
|
|
||||||
ng-change="selectITService()"
|
|
||||||
ng-model="target.itservice"
|
|
||||||
bs-tooltip="target.itservice.name.length > 25 ? target.itservice.name : ''"
|
|
||||||
ng-options="itservice.name for itservice in itserviceList track by itservice.name">
|
|
||||||
<option value="">-- Select IT service --</option>
|
|
||||||
</select>
|
|
||||||
</li>
|
|
||||||
<li class="tight-form-item input-medium">IT service property</li>
|
|
||||||
<li>
|
|
||||||
<select class="tight-form-input input-medium"
|
|
||||||
ng-change="selectITService()"
|
|
||||||
ng-model="target.slaProperty"
|
|
||||||
ng-options="slaProperty.name for slaProperty in slaPropertyList track by slaProperty.name">
|
|
||||||
<option value="">-- Property --</option>
|
|
||||||
</select>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<ul class="tight-form-list" role="menu" ng-hide="target.mode == 1">
|
|
||||||
<!-- Alias -->
|
|
||||||
<li>
|
|
||||||
<input type="text"
|
|
||||||
class="tight-form-input input-medium"
|
|
||||||
ng-model="target.alias"
|
|
||||||
spellcheck='false'
|
|
||||||
placeholder="Alias"
|
|
||||||
ng-blur="targetBlur()">
|
|
||||||
</li>
|
|
||||||
<!-- Select Host Group -->
|
|
||||||
<li class="tight-form-item input-small" style="width: 5em">Group</li>
|
|
||||||
<li>
|
|
||||||
<select class="tight-form-input input-large"
|
|
||||||
ng-change="selectHostGroup()"
|
|
||||||
ng-model="target.group"
|
|
||||||
bs-tooltip="target.group.name.length > 25 ? target.group.name : ''"
|
|
||||||
ng-options="group.visible_name ? group.visible_name : group.name for group in metric.groupList track by group.name">
|
|
||||||
<option value="">-- Select host group --</option>
|
|
||||||
</select>
|
|
||||||
<a bs-tooltip="target.errors.metric"
|
|
||||||
style="color: rgb(229, 189, 28)"
|
|
||||||
ng-show="target.errors.metric">
|
|
||||||
<i class="fa fa-warning"></i>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<!-- Select Host -->
|
|
||||||
<li class="tight-form-item input-small" style="width: 3em">Host</li>
|
|
||||||
<li>
|
|
||||||
<select class="tight-form-input input-large"
|
|
||||||
ng-change="selectHost()"
|
|
||||||
ng-model="target.host"
|
|
||||||
bs-tooltip="target.host.name.length > 25 ? target.host.name : ''"
|
|
||||||
ng-options="host.visible_name ? host.visible_name : host.name for host in metric.hostList track by host.name">
|
|
||||||
<option value="">-- Select host --</option>
|
|
||||||
</select>
|
|
||||||
<a bs-tooltip="target.errors.metric"
|
|
||||||
style="color: rgb(229, 189, 28)"
|
|
||||||
ng-show="target.errors.metric">
|
|
||||||
<i class="icon-warning-sign"></i>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<!-- Host filter -->
|
|
||||||
<li class="tight-form-item" ng-hide="target.mode == 2">
|
|
||||||
Filter
|
|
||||||
<i class="fa fa-question-circle"
|
|
||||||
bs-tooltip="'Filtering hosts by regex. Select All in items and specify regex for host names.'"></i>
|
|
||||||
</li>
|
|
||||||
<li ng-hide="target.mode == 2">
|
|
||||||
<input type="text"
|
|
||||||
class="tight-form-input input-large"
|
|
||||||
ng-model="target.hostFilter"
|
|
||||||
spellcheck='false'
|
|
||||||
placeholder="Host filter (regex)"
|
|
||||||
ng-blur="targetBlur()">
|
|
||||||
</li>
|
|
||||||
<!-- Downsampling function -->
|
|
||||||
<li class="tight-form-item input-medium" ng-hide="target.mode == 2">
|
|
||||||
Downsampling
|
|
||||||
</li>
|
|
||||||
<li ng-hide="target.mode == 2">
|
|
||||||
<select class="tight-form-input input-small"
|
|
||||||
ng-change="targetBlur()"
|
|
||||||
ng-model="target.downsampleFunction"
|
|
||||||
bs-tooltip="'Downsampling function'"
|
|
||||||
ng-options="func.name for func in downsampleFunctionList track by func.name">
|
|
||||||
</select>
|
|
||||||
<a bs-tooltip="target.errors.metric"
|
|
||||||
style="color: rgb(229, 189, 28)"
|
|
||||||
ng-show="target.errors.metric">
|
|
||||||
<i class="icon-warning-sign"></i>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="tight-form" ng-hide="target.mode == 1">
|
|
||||||
<ul class="tight-form-list" role="menu">
|
|
||||||
<li class="tight-form-item" style="min-width: 15px; text-align: center"> </li>
|
|
||||||
<li class="tight-form-item">
|
|
||||||
<i class="fa fa-eye invisible"></i>
|
|
||||||
</li>
|
|
||||||
<li class="tight-form-item" style="width: 135px"> </li>
|
|
||||||
|
|
||||||
<!-- Select Application -->
|
|
||||||
<li class="tight-form-item input-small" style="width: 5em">Application</li>
|
|
||||||
<li>
|
|
||||||
<select class="tight-form-input input-large"
|
|
||||||
ng-change="selectApplication()"
|
|
||||||
ng-model="target.application"
|
|
||||||
bs-tooltip="target.application.name.length > 15 ? target.application.name : ''"
|
|
||||||
ng-options="app.visible_name ? app.visible_name : app.name for app in metric.applicationList track by app.name">
|
|
||||||
<option value="">-- Select application --</option>
|
|
||||||
</select>
|
|
||||||
<a bs-tooltip="target.errors.metric"
|
|
||||||
style="color: rgb(229, 189, 28)"
|
|
||||||
ng-show="target.errors.metric">
|
|
||||||
<i class="icon-warning-sign"></i>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<!-- Select Item -->
|
|
||||||
<li class="tight-form-item input-small" style="width: 3em">Item</li>
|
|
||||||
<li>
|
|
||||||
<select class="tight-form-input input-large"
|
|
||||||
ng-change="selectItem()"
|
|
||||||
ng-model="target.item"
|
|
||||||
bs-tooltip="target.item.name.length > 25 ? target.item.name : ''"
|
|
||||||
ng-options="item.name for item in metric.itemList track by item.name">
|
|
||||||
<option value="">-- Select item --</option>
|
|
||||||
</select>
|
|
||||||
<a bs-tooltip="target.errors.metric"
|
|
||||||
style="color: rgb(229, 189, 28)"
|
|
||||||
ng-show="target.errors.metric">
|
|
||||||
<i class="icon-warning-sign"></i>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<!-- Item filter -->
|
|
||||||
<li class="tight-form-item" ng-hide="target.mode == 2">
|
|
||||||
Filter
|
|
||||||
<i class="fa fa-question-circle"
|
|
||||||
bs-tooltip="'Filtering items by regex. Select All in items and specify regex for item names.'"></i>
|
|
||||||
</li>
|
|
||||||
<li ng-hide="target.mode == 2">
|
|
||||||
<input type="text"
|
|
||||||
class="tight-form-input input-large"
|
|
||||||
ng-model="target.itemFilter"
|
|
||||||
spellcheck='false'
|
|
||||||
placeholder="Item filter (regex)"
|
|
||||||
ng-blur="targetBlur()">
|
|
||||||
</li>
|
|
||||||
<!-- Scale -->
|
|
||||||
<li class="tight-form-item" ng-hide="target.mode == 2">
|
|
||||||
Scale
|
|
||||||
<i class="fa fa-question-circle"
|
|
||||||
bs-tooltip="'Set a custom multiplier for series values, for example -1 to invert series'"></i>
|
|
||||||
</li>
|
|
||||||
<li ng-hide="target.mode == 2">
|
|
||||||
<input type="text"
|
|
||||||
class="tight-form-input input-small"
|
|
||||||
ng-model="target.scale"
|
|
||||||
spellcheck='false'
|
|
||||||
placeholder="1"
|
|
||||||
ng-blur="targetBlur()">
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section class="grafana-metric-options">
|
<div class="tight-form" ng-hide="target.mode == 1">
|
||||||
<div class="tight-form">
|
<ul class="tight-form-list" role="menu">
|
||||||
<ul class="tight-form-list">
|
<li class="tight-form-item" style="min-width: 15px; text-align: center"> </li>
|
||||||
<li class="tight-form-item tight-form-item-icon">
|
<li class="tight-form-item">
|
||||||
<i class="fa fa-wrench"></i>
|
<i class="fa fa-eye invisible"></i>
|
||||||
</li>
|
</li>
|
||||||
<li class="tight-form-item">
|
<li class="tight-form-item" style="width: 135px"> </li>
|
||||||
Max data points
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<input type="text"
|
|
||||||
class="input-mini tight-form-input"
|
|
||||||
ng-model="panel.maxDataPoints"
|
|
||||||
bs-tooltip="'Override max data points, automatically set to graph width in pixels.'"
|
|
||||||
data-placement="right"
|
|
||||||
ng-model-onblur ng-change="get_data()"
|
|
||||||
spellcheck='false'
|
|
||||||
placeholder="auto">
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
<div class="tight-form">
|
|
||||||
<ul class="tight-form-list">
|
|
||||||
<li class="tight-form-item tight-form-item-icon">
|
|
||||||
<i class="fa fa-info-circle"></i>
|
|
||||||
</li>
|
|
||||||
<li class="tight-form-item">
|
|
||||||
<a ng-click="toggleEditorHelp(1)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
|
|
||||||
Max data points
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="tight-form-item">
|
|
||||||
<a ng-click="toggleEditorHelp(2)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
|
|
||||||
IT services
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="tight-form-item">
|
|
||||||
<a ng-click="toggleEditorHelp(3)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
|
|
||||||
IT service property
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<div class="editor-row">
|
<!-- Select Application -->
|
||||||
<div class="pull-left" style="margin-top: 30px;">
|
<li class="tight-form-item input-small" style="width: 5em">Application</li>
|
||||||
|
<li>
|
||||||
|
<select class="tight-form-input input-large"
|
||||||
|
ng-change="selectApplication()"
|
||||||
|
ng-model="target.application"
|
||||||
|
bs-tooltip="target.application.name.length > 15 ? target.application.name : ''"
|
||||||
|
ng-options="app.visible_name ? app.visible_name : app.name for app in metric.applicationList track by app.name">
|
||||||
|
<option value="">-- Select application --</option>
|
||||||
|
</select>
|
||||||
|
<a bs-tooltip="target.errors.metric"
|
||||||
|
style="color: rgb(229, 189, 28)"
|
||||||
|
ng-show="target.errors.metric">
|
||||||
|
<i class="icon-warning-sign"></i>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<!-- Select Item -->
|
||||||
|
<li class="tight-form-item input-small" style="width: 3em">Item</li>
|
||||||
|
<li>
|
||||||
|
<select class="tight-form-input input-large"
|
||||||
|
ng-change="selectItem()"
|
||||||
|
ng-model="target.item"
|
||||||
|
bs-tooltip="target.item.name.length > 25 ? target.item.name : ''"
|
||||||
|
ng-options="item.name for item in metric.itemList track by item.name">
|
||||||
|
<option value="">-- Select item --</option>
|
||||||
|
</select>
|
||||||
|
<a bs-tooltip="target.errors.metric"
|
||||||
|
style="color: rgb(229, 189, 28)"
|
||||||
|
ng-show="target.errors.metric">
|
||||||
|
<i class="icon-warning-sign"></i>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<!-- Item filter -->
|
||||||
|
<li class="tight-form-item" ng-hide="target.mode == 2">
|
||||||
|
Filter
|
||||||
|
<i class="fa fa-question-circle"
|
||||||
|
bs-tooltip="'Filtering items by regex. Select All in items and specify regex for item names.'"></i>
|
||||||
|
</li>
|
||||||
|
<li ng-hide="target.mode == 2">
|
||||||
|
<input type="text"
|
||||||
|
class="tight-form-input input-large"
|
||||||
|
ng-model="target.itemFilter"
|
||||||
|
spellcheck='false'
|
||||||
|
placeholder="Item filter (regex)"
|
||||||
|
ng-blur="targetBlur()">
|
||||||
|
</li>
|
||||||
|
<!-- Scale -->
|
||||||
|
<li class="tight-form-item" ng-hide="target.mode == 2">
|
||||||
|
Scale
|
||||||
|
<i class="fa fa-question-circle"
|
||||||
|
bs-tooltip="'Set a custom multiplier for series values, for example -1 to invert series'"></i>
|
||||||
|
</li>
|
||||||
|
<li ng-hide="target.mode == 2">
|
||||||
|
<input type="text"
|
||||||
|
class="tight-form-input input-small"
|
||||||
|
ng-model="target.scale"
|
||||||
|
spellcheck='false'
|
||||||
|
placeholder="1"
|
||||||
|
ng-blur="targetBlur()">
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<div class="grafana-info-box span6" ng-if="editorHelpIndex === 1">
|
<div class="clearfix"></div>
|
||||||
<h5>Max data points</h5>
|
|
||||||
<ul>
|
|
||||||
<li>Grafana-Zabbix plugin uses maxDataPoints parameter to consolidate the real number of values down to this
|
|
||||||
number
|
|
||||||
</li>
|
|
||||||
<li>If there are more real values, then by default they will be consolidated using averages</li>
|
|
||||||
<li>This could hide real peaks and max values in your series</li>
|
|
||||||
<li>Point consolidation will effect series legend values (min,max,total,current)</li>
|
|
||||||
<li>If you override maxDataPoint and set a high value performance can be severely effected</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="grafana-info-box span6" ng-if="editorHelpIndex === 2">
|
|
||||||
<h5>IT services</h5>
|
|
||||||
<p>
|
|
||||||
Select "IT services" in targets menu to activate IT services mode.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="grafana-info-box span6" ng-if="editorHelpIndex === 3">
|
|
||||||
<h5>IT service property</h5>
|
|
||||||
<ul>
|
|
||||||
<li>Zabbix returns the following availability information about IT service</li>
|
|
||||||
<li>Status - current status of the IT service</li>
|
|
||||||
<li>SLA - SLA for the given time interval</li>
|
|
||||||
<li>OK time - time the service was in OK state, in seconds</li>
|
|
||||||
<li>Problem time - time the service was in problem state, in seconds</li>
|
|
||||||
<li>Down time - time the service was in scheduled downtime, in seconds</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
83
zabbix/partials/query.options.html
Normal file
83
zabbix/partials/query.options.html
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<section class="grafana-metric-options">
|
||||||
|
<div class="tight-form">
|
||||||
|
<ul class="tight-form-list">
|
||||||
|
<li class="tight-form-item tight-form-item-icon">
|
||||||
|
<i class="fa fa-wrench"></i>
|
||||||
|
</li>
|
||||||
|
<li class="tight-form-item">
|
||||||
|
Max data points
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<input type="text"
|
||||||
|
class="input-mini tight-form-input"
|
||||||
|
ng-model="panel.maxDataPoints"
|
||||||
|
bs-tooltip="'Override max data points, automatically set to graph width in pixels.'"
|
||||||
|
data-placement="right"
|
||||||
|
ng-model-onblur ng-change="get_data()"
|
||||||
|
spellcheck='false'
|
||||||
|
placeholder="auto">
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
|
<div class="tight-form">
|
||||||
|
<ul class="tight-form-list">
|
||||||
|
<li class="tight-form-item tight-form-item-icon">
|
||||||
|
<i class="fa fa-info-circle"></i>
|
||||||
|
</li>
|
||||||
|
<li class="tight-form-item">
|
||||||
|
<a ng-click="toggleEditorHelp(1)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
|
||||||
|
Max data points
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="tight-form-item">
|
||||||
|
<a ng-click="toggleEditorHelp(2)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
|
||||||
|
IT services
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="tight-form-item">
|
||||||
|
<a ng-click="toggleEditorHelp(3)" bs-tooltip="'click to show helpful info'" data-placement="bottom">
|
||||||
|
IT service property
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div class="editor-row">
|
||||||
|
<div class="pull-left" style="margin-top: 30px;">
|
||||||
|
|
||||||
|
<div class="grafana-info-box span6" ng-if="editorHelpIndex === 1">
|
||||||
|
<h5>Max data points</h5>
|
||||||
|
<ul>
|
||||||
|
<li>Grafana-Zabbix plugin uses maxDataPoints parameter to consolidate the real number of values down to this
|
||||||
|
number
|
||||||
|
</li>
|
||||||
|
<li>If there are more real values, then by default they will be consolidated using averages</li>
|
||||||
|
<li>This could hide real peaks and max values in your series</li>
|
||||||
|
<li>Point consolidation will effect series legend values (min,max,total,current)</li>
|
||||||
|
<li>If you override maxDataPoint and set a high value performance can be severely effected</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grafana-info-box span6" ng-if="editorHelpIndex === 2">
|
||||||
|
<h5>IT services</h5>
|
||||||
|
<p>
|
||||||
|
Select "IT services" in targets menu to activate IT services mode.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grafana-info-box span6" ng-if="editorHelpIndex === 3">
|
||||||
|
<h5>IT service property</h5>
|
||||||
|
<ul>
|
||||||
|
<li>Zabbix returns the following availability information about IT service</li>
|
||||||
|
<li>Status - current status of the IT service</li>
|
||||||
|
<li>SLA - SLA for the given time interval</li>
|
||||||
|
<li>OK time - time the service was in OK state, in seconds</li>
|
||||||
|
<li>Problem time - time the service was in problem state, in seconds</li>
|
||||||
|
<li>Down time - time the service was in scheduled downtime, in seconds</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -5,22 +5,12 @@
|
|||||||
"type": "zabbix",
|
"type": "zabbix",
|
||||||
"serviceName": "ZabbixAPIDatasource",
|
"serviceName": "ZabbixAPIDatasource",
|
||||||
|
|
||||||
"module": "plugins/datasource/zabbix/datasource",
|
"module": "app/plugins/datasource/zabbix/datasource",
|
||||||
|
|
||||||
"partials": {
|
"partials": {
|
||||||
"config": "app/plugins/datasource/zabbix/partials/config.html",
|
"config": "app/plugins/datasource/zabbix/partials/config.html"
|
||||||
"query": "app/plugins/datasource/zabbix/partials/query.editor.html",
|
|
||||||
"annotations": "app/plugins/datasource/zabbix/partials/annotations.editor.html"
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"username": "guest",
|
|
||||||
"password": "",
|
|
||||||
|
|
||||||
"trends": false,
|
|
||||||
"trendsFrom": "7d",
|
|
||||||
|
|
||||||
"limitmetrics": 100,
|
|
||||||
|
|
||||||
"metrics": true,
|
"metrics": true,
|
||||||
"annotations": true
|
"annotations": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -266,6 +266,8 @@ define([
|
|||||||
return errs;
|
return errs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.init();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user