-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added incrimented field for each request #2
Conversation
Also removed debug console logging
I have already removed console.log(). Please, fetch your repo for new changes. |
Note about "id" parameter from Zabbix API docs
For this reason I don't use increment or other id calculation. |
Alex, look at errors, I add new metrics, but I have only one line |
I think this is because different data types in one graph. I note this moment in code:
I'll try to fix this problem in this release. |
Need to group requests with same data type and do multiple api request. Just with incremental id )) |
I think to use incremental Id is not best way, that is why id field must be unique, I think it is better to use Math.random() * 10000 function ? |
id must be unique within one http request. We may use for example id: 1 for integer data and id: 2 for float. |
To be honest, I think it is not needed in angularjs apps, you need to rewrite function history get that do async request to api, and when all subrequest functions return result merge them in one array and return. And with async you don't need to handle id field. |
In function you need to run over all array items, and create new hash history_type[type] = array_of_items then you need to run over history_type hash and for in history_type as key=> value { do data json for each request and then performQuery.then(function(){this.doZabbixAPIRequest(dataN) }) } return perfromQuery() //// |
Ok, I thought the same. I'll do it tomorrow. |
Great! And for future I hope this patch will be in zabbix release soon: https://support.zabbix.com/browse/ZBXNEXT-1193 If we ask data more than 24 hours we should take data from trend(s).get method instead from history.get |
Yes, I also notice this problem. It complicated work with long-time graphs. This patch will solve problem. |
I fixed bug with different data types in one graph. See release-1.0 branch. Please test on your zabbix installation. |
Alex, your code like a charm 👍 I will test it tommorrow. Another thought have come to my mind: According to data types in zabbix This method must return only items which has a value type of float or integer:
from zabbix docs: filter - object Accepts an array, where the keys are property names, and the values are either a single value or an array of values to match against. Supports additional filters: https://www.zabbix.com/documentation/2.4/manual/api/reference/item/get ` |
Thanks. It is a good idea for graphs - non-numeric items just not needed. |
Alex, do you have your own zabbix installation? |
Any success with version for grafana-2 ? |
I have production zabbix server but in isolated network without Internet access. |
Alex, please add filter to return only host groups with real servers, host groups with templates only are not needed I thinl
|
Added pull request with additonal filters. Found a lot of bugs, with visualization something strange happens, and there are still errors, will do screenshots. What about your zabbix, can you applly patch to your zabbix installation. |
Please, open issue with screenshots. |
Added incrementing requestId variable for each request, not always write good due to async requests.
Removed condole.log()