grafana / grafana-zabbix Goto Github PK
View Code? Open in Web Editor NEWZabbix plugin for Grafana dashboard
Home Page: http://play.grafana-zabbix.org
License: Apache License 2.0
Zabbix plugin for Grafana dashboard
Home Page: http://play.grafana-zabbix.org
License: Apache License 2.0
Support Grafana templated dashboards.
Downsample series for better graph displaying.
Здравствуйте!
При добавлении метрик , в списке отсутствуют метрики у которых "Тип информации" в ZABBIX
Текст или журнал.
Как их можно добавить в "Single Stat" ?
Is there any doc about regex description usage ? Appreciate for any advice and thanks you very much to offer so great plugin .
Dear Alex,
Today I've updated to newest files,(not sure if it was working before, did not try it) but now I get red exclamation mark on left near row. It is only when using "last 30 days" option... In zabbix I use to keep data for 7 days and trends/history after that.. 7 Days are shown OK, but when i do more than that I get this, so has to do something with trends/history data in zabbix.
Here is screenshot of the issue when I open the red exclamation mark:
Remove empty data series (which all values are 0) from graph.
Support templated variables in aliases (need for templated items).
Hi,
Could you please help me in configuring zabbix with grafana 1.9??
How to run grafana 1.9?
I'm trying to create a single dashboard with Grafana to monitor two different Zabbix servers. I can't get the two servers working at the same time, whenever one of them appears, the other disappears. Is it a known issue? Any fix for this?
Thank you.
Move configuration parameters from plugin.json
file to Grafana data source configuration page.
I try to use grafana-zabbix from branch grafana-1.9
with: grafata 1.9.1, zabbix 2.2.1, and zabbix accessible over self-signed certificate.
After all steps in manual I got black grafana screen and error in browser javascript console:
Error: [$injector:unpr] Unknown provider: backendSrvProvider <- backendSrv <- ZabbixAPIDatasource <- datasourceSrv
http://errors.angularjs.org/1.3.0-rc.3/$injector/unpr?p0=backendSrvProvider%20%3C-%20backendSrv%20%3C-%20ZabbixAPIDatasource%20%3C-NaNatasourceSrv
at http://grafana.local/app/app.fea68443.js:8:6499
at http://grafana.local/app/app.fea68443.js:8:23535
at Object.d [as get] (http://grafana.local/app/app.fea68443.js:8:22744)
at http://grafana.local/app/app.fea68443.js:8:23630
at d (http://grafana.local/app/app.fea68443.js:8:22744)
at Object.e [as invoke] (http://grafana.local/app/app.fea68443.js:8:23068)
at http://grafana.local/app/app.fea68443.js:8:23648
at Object.d [as get] (http://grafana.local/app/app.fea68443.js:8:22744)
at d.service.datasourceFactory (http://grafana.local/app/app.fea68443.js:18:11618)
at null.<anonymous> (http://grafana.local/app/app.fea68443.js:18:10995)
Can't support Http Basic auth? thank you!
code
this.init = function(api_url, username, password) {
this.url = api_url;
this.username = username;
this.password = password;
}
Show/hide button in metric configuration not working.
Implement testDatasource
method for test connection to zabbix server.
Nice job Alex,
I've found cosmetic issue. I'm trying to compile Grafana from the source with zabbix datasource and it's failing because code style errors (whitespaces, multi line breaks). Workaround is easy: first compile and then copy zabbix datasource. It'll be awesome, if workaround is not required.
Thank you.
Output.
# npm install -g grunt-cli && grunt
/usr/bin/grunt -> /usr/lib/node_modules/grunt-cli/bin/grunt
[email protected] /usr/lib/node_modules/grunt-cli
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected])
Running "jscs:src" (jscs) task
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
71 | });
72 | }
73 |
------------^
74 | // Called once per panel (graph)
75 | DruidDatasource.prototype.query = function(options) {
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
119 | else if (target.queryType === 'groupBy') {
120 | if (target.hasLimit) {
121 | limitSpec = getLimitSpec(target.limit, target.orderBy);
--------------------------------------------------------------------------^
122 | }
123 | promise = this._groupByQuery(datasource, intervals, granularity, filters, aggregators, postAggregators, groupBy, limitSpec)
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
144 | ...
145 | ]
146 |
--------------^
147 | Druid calculates metrics based on the intervals specified in the query but returns a timestamp rounded down.
148 | We need to adjust the first timestamp in each time series
Expected indentation of 6 characters at public/app/plugins/datasource/druid/datasource.js :
222 | data: query
223 | };
224 | $log.debug("Make http request")
--------------^
225 | $log.debug(options);
226 | return $http(options);
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
318 | ]
319 | /
320 |
--------------^
321 | /
322 | First, we need make sure that the result for each
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
323 | timestamp contains entries for all distinct dimension values
324 | in the entire list of results.
325 |
--------------^
326 | Otherwise, if we do a stacked bar chart, Grafana doesn't sum
327 | the metrics correctly.
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
327 | the metrics correctly.
328 | */
329 |
--------------^
330 | //Get the list of all distinct dimension values for the entire result set
331 | var dVals = md.reduce(function (dValsSoFar, tsItem) {
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
333 | return _.union(dValsSoFar, dValsForTs);
334 | }, {});
335 |
--------------^
336 | //Add null for the metric for any missing dimension values per timestamp result
337 | md.forEach(function (tsItem) {
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
363 | },
364 | ...
365 | ]
-----------------------------^
366 | */
367 | var timestamp = formatTimestamp(item.timestamp);
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
466 | return Math.ceil(intervalSecs/gEntry[1].asSeconds()) <= maxDataPoints;
467 | });
468 |
--------------^
469 | $log.debug("Calculated \"" + granularityEntry[0] + "\" granularity [" + Math.ceil(intervalSecs/granularityEntry[1].asSeconds()) + " pts]" + " for " + (intervalSecs/60).toFixed(0) + " minutes and max of " + maxDataPoints + " data points");
470 | return granularityEntry[0];
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
470 | return granularityEntry[0];
471 | }
472 |
------------^
473 | function roundUpStartTime(from, granularity) {
474 | var duration = _.find(GRANULARITIES, function (gEntry) {
Missing space before opening curly brace at public/app/plugins/datasource/kairosdb/kairosdb.Datasource.js :
27 |
28 | var queries = .compact(.map(options.targets, .partial(convertTargetToQuery, options)));
29 | var plotParams = _.compact(.map(options.targets, function(target){
--------------------------------------------------------------------------------^
30 | var alias = target.alias;
31 | if (typeof target.alias == 'undefined' || target.alias == "")
Illegal trailing whitespace at public/app/plugins/datasource/kairosdb/kairosdb.TargetCtrl.js :
67 | if ($scope.target.metric)
68 | $scope.metric.value = $scope.target.metric;
69 | else
---------------------^
70 | $scope.metric.value = "";
71 | $scope.metricListLoading = false;
Expected indentation of 10 characters at public/app/plugins/datasource/prometheus/datasource.js :
140 | })
141 | .value();
142 | });
------------------^
143 | } else {
144 | // if query contains full metric name, return metric name and label list
Expected indentation of 6 characters at public/app/plugins/datasource/prometheus/datasource.js :
157 | });
158 | });
159 | }
--------------^
160 | };
161 |
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
37 | zabbix.init(this.url, this.username, this.password);
38 | }
39 |
--------^
40 |
41 | /**
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
142 | });
143 | };
144 |
--------^
145 |
146 | ZabbixAPIDatasource.prototype.handleTrendResponse = function(items, alias, scale, trends) {
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
171 | });
172 | };
173 |
--------^
174 |
175 | /**
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
225 | });
226 | };
227 |
--------^
228 |
229 | /**
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
303 | }
304 | };
305 |
--------^
306 |
307 | /////////////////
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
308 | // Annotations //
309 | /////////////////
310 |
--------^
311 |
312 | ZabbixAPIDatasource.prototype.annotationQuery = function(annotation, rangeUnparsed) {
Expected indentation of 14 characters at public/app/plugins/datasource/zabbix/datasource.js :
354 | });
355 | return events;
356 | });
----------------------^
357 | } else {
358 | return [];
Expected indentation of 8 characters at public/app/plugins/datasource/zabbix/datasource.js :
358 | return [];
359 | }
360 | });
----------------^
361 | };
362 |
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
364 | });
365 |});
366 |
--------^
367 |
368 |/**
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
378 | return metrics.replace(remove_brackets_pattern, '').split(metric_split_pattern)
379 |}
380 |
--------^
381 |
382 |/**
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
395 | return date.getFullYear() + '-' + MM + '-' + DD + ' ' + HH + ':' + mm + ':' + ss;
396 |}
397 |
--------^
398 |
399 |/**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
31 | $scope.target.errors = validateTarget($scope.target);
32 | };
33 |
--------^
34 |
35 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
41 | }
42 | };
43 |
--------^
44 |
45 | $scope.targetBlur = function() {
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
51 | }
52 | };
53 |
--------^
54 |
55 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
67 | }
68 | };
69 |
--------^
70 |
71 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
82 | }
83 | };
84 |
--------^
85 |
86 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
96 | }
97 | };
98 |
--------^
99 |
100 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
109 | }
110 | };
111 |
--------^
112 |
113 | $scope.duplicate = function() {
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
115 | $scope.panel.targets.push(clone);
116 | };
117 |
--------^
118 |
119 | $scope.moveMetricQuery = function(fromIndex, toIndex) {
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
124 | // SUGGESTION QUERIES
125 | //////////////////////////////
126 |
--------^
127 |
128 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
137 | });
138 | };
139 |
--------^
140 |
141 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
151 | });
152 | };
153 |
--------^
154 |
155 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
169 | });
170 | };
171 |
--------^
172 |
173 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
191 | });
192 | };
193 |
--------^
194 |
195 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
206 | });
207 | };
208 |
--------^
209 |
210 | //////////////////////////////
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
221 |
222 |});
223 |
--------^
224 |
225 |/**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
18 | this.password = password;
19 | }
20 |
--------^
21 |
22 | //////////////////
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
23 | // Core methods //
24 | //////////////////
25 |
--------^
26 |
27 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
69 | });
70 | };
71 |
--------^
72 |
73 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
100 | };
101 |
102 |
--------^
103 |
104 | /////////////////////////
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
105 | // API method wrappers //
106 | /////////////////////////
107 |
--------^
108 |
109 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
141 | });
142 | };
143 |
--------^
144 |
145 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
178 | });
179 | };
180 |
--------^
181 |
182 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
197 | return this.performZabbixAPIRequest('hostgroup.get', params);
198 | };
199 |
--------^
200 |
201 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
220 | return this.performZabbixAPIRequest('host.get', params);
221 | };
222 |
--------^
223 |
224 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
243 | return this.performZabbixAPIRequest('application.get', params);
244 | };
245 |
--------^
246 |
247 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
287 | return this.performZabbixAPIRequest('item.get', params);
288 | };
289 |
--------^
290 |
291 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
306 | return this.performZabbixAPIRequest('hostgroup.get', params);
307 | };
308 |
--------^
309 |
310 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
324 | return this.performZabbixAPIRequest('hostgroup.get', params);
325 | };
326 |
--------^
327 |
328 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
343 | return this.performZabbixAPIRequest('host.get', params);
344 | };
345 |
--------^
346 |
347 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
362 | return this.performZabbixAPIRequest('application.get', params);
363 | };
364 |
--------^
365 |
366 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
411 | });
412 | };
413 |
--------^
414 |
415 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
449 | });
450 | };
451 |
--------^
452 |
453 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
468 | });
469 | };
470 |
--------^
471 |
472 | /**
>> 59 code style errors found!
Warning: Task "jscs:src" failed. Use --force to continue.
Aborted due to warnings.
Set trends
to false
in plugin.json file.
At least for Zabbix 2.2 authorization is not initiated getting on all requests auth error.
Zabbix 2.2 in json return "Not authorized" error, not the "Not authorised." as it is checked
in zabbix/datasource.js
// Handle auth errors
if (response.data.error.data == "Session terminated, re-login, please." ||
response.data.error.data == 'Not authorised.') {
return self.performZabbixAPILogin().then(function (response) {
self.auth = response;
return self.performZabbixAPIRequest(method, params);
});
grafana-zabbix needs license and copyright statement.
Perhaps it makes sense to use Apache-2.0 license -- the same as grafana license?
Please consider adding license and copyright statement. Thanks.
Host filtering by regex in query editor.
Alex, add new graph and add new metrics with different values one higher than another and add tooltip
After selecting metric in query it is not added to graph. I don't see any requests to get items history data. After selecting another item in query also no request are initiated.
I use Grafana 2.0.2-1.
In web console there is only one warning: "The specified value '!' does not conform to the required format. The format is '#rrggbb' where rr, gg, bb are two-digit hexadecimal numbers.". It is related to grafana/grafana#1932
I made one change in plugin to make retrieving data (host groups, hosts, applications, items) from zabbix (2.2.1) working - changed "search" method in api requests to "filter", otherwise I always got empty results.
Would be nice to be able to use custom template variables in the search filter section so you can graph multiple items and not just have to select one item from a dropdown.
Alias replace item names in templated dashboard when All
item selected.
Hi,
do we have to place the grafana folder where zabbix has been installed?
or we can place it anywhere?
Metrics in multiple requests returns in random order.
Hi ,
Just want to show the time of host on the dashboard template ,but find that there is no unit the metrics which can be used to handle the unixtime format from zabbix monitoring item(host local time).It will be nice if added in next version.
"Error: $scope.target.host is null
$scope.selectHost@http://localhost:8090/public/app/plugins/datasource/zabbix/queryCtrl.js?bust=1431450309338:67:9
in browser's console when select "--select host--" (null).
Alex,
I think it is better to publish the project to share.zabbix.com
And I will try to ask Zabbix SIA to publish link to this repo on its facebook, it will add some new contributors to the project
Also habr will be nice too
Александр, день добрый!
Я настроил получение данных из zabbix через шаблоны и столкнулся с проблемой. А именно - если выбоать отображение всех элиментов (All), то в подписи графика они передаются списком и не понятно к какому элементу это относится (скрин приложил)
Сам шаблон выглядит так
Скажите, есть ли какой способ отображения при выборе всех элементов, чтобы они отображались не списком, а поэлементно?
Спасибо!
Александр, отличный плагин написал, собирался попробовать и наткнулся на неприятность, Grafana ругается примерно так:
Stack trace:
kb/<@https://monitoring.test.com/grafana/app/app.6e379bdb.js:10:15701
v@https://monitoring.test.com/grafana/app/app.6e379bdb.js:10:14241
o/j@https://monitoring.test.com/grafana/app/app.6e379bdb.js:10:12812
i@https://monitoring.test.com/grafana/app/app.6e379bdb.js:10:29774
j/<@https://monitoring.test.com/grafana/app/app.6e379bdb.js:10:29946
Rb/this.$get</l.prototype.$eval@https://monitoring.test.com/grafana/app/app.6e379bdb.js:12:5064
Rb/this.$get</l.prototype.$digest@https://monitoring.test.com/grafana/app/app.6e379bdb.js:12:3578
Rb/this.$get</l.prototype.$apply@https://monitoring.test.com/grafana/app/app.6e379bdb.js:12:5322
k@https://monitoring.test.com/grafana/app/app.6e379bdb.js:14:3970
_.event.dispatch@https://monitoring.test.com/grafana/app/app.6e379bdb.js:6:1535
_.event.add/q.handle@https://monitoring.test.com/grafana/app/app.6e379bdb.js:5:30407
Исходные данные: свежая Grafana, последний стабильный Zabbix, юзер для доступа настроен и прописан с настройках, логи httpd на Zabbix пустые, так как Grafana даже не может достучаться, спотыкается на JS error, Рекомендации?
Would be nice, if alias is taken from zabbix item name.
Needed chekpoint (fill alias from zabbix) if it is set, grafana must take it from zabbix api, not from alias field
Alex, when I begin to add new metric, and first select host group all lines disappear from graph, I think it is not right, grafana must not query if itemid is not defined.
Feature request to support trends https://support.zabbix.com/browse/ZBXNEXT-1193
Needed a configuration variable "this.useTrendsAfter = datasource.useTrendsAfter || 24" (hours by default)
Dear Alex,
first of all thank you for bringing zabbix to grafana, it is a great way for me to show managers monitoring dashboard which is cleaner and nicer then zabbix.
I write you because today I've upgraded to newest version after a month or so. And when I try to display IN and OUT traffic on one of my WIFI AP, the legend on the right say some other data then it really shows.. and IN and OUT traffic almost match. I've cleared cache in my browser just in case but still the same issue. Any idea please what could be wrong ? If needed more details, let me know I will provide it to you.
Thanks for your time and effort 👍
Item names always displayed instead aliases.
Hello,
I've try to use the plugin with a Zabbix server version : 2.2.9 and the last version of Grafana.
After setup Zabbix part and apply the patch on api_jsonrpc.php I success to get the group list when adding a metric.
But Host lists, Application list and Item list remain empty (I.E. only with "All" value).
Nothing in log file and no datapoints.
I've I doing something wrong ?
Great job gentlemen
Please let an ability choose a counter which is exists in specific group and automatically populate it on the graphs from all servers that are exists in chosen group.
thank you
Many managers want to see services availability like HP and VMware, see image above.
In grafana it will be very easy
Box with drilldowns, SLA percents on it
https://www.zabbix.com/documentation/2.4/manual/api/reference/service/getsla
drill down just link you want, i.e. sublevel services
Move Zabbix API requests to separate file for clearer code.
Invert values for show below null line (for example network in/out traffic)
Add item regex filter to query editor.
I've installed Grafana 2.0.2 and Grafana-Zabbix datasource on my Zabbix host. I'm using Zabbix 2.0.9 on Centos 6.5
When I'm trying to add a new graph I see all my groups and hosts. But when I select one of them only one option ("all") is available to me in the following lists. It does not allow me to select any host items.
How can I debug this?
Able to specify Max Data Points parameter in percents.
I add metrics, but I don't get any annotaions vertical line for those metrics which have trigger?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.