Resolved #54 - Implemented testDatasource() method for test connection to zabbix server.

This commit is contained in:
Alexander Zobnin
2015-07-12 19:12:21 +03:00
parent b97b96a164
commit b466cc4cbc
2 changed files with 51 additions and 0 deletions

View File

@@ -41,6 +41,21 @@ function (angular, _, kbn) {
this.zabbixAPI = new ZabbixAPI(this.url, this.username, this.password, this.basicAuth, this.withCredentials);
}
/**
* Test connection to Zabbix API
*
* @return {object} Connection status and Zabbix API version
*/
ZabbixAPIDatasource.prototype.testDatasource = function() {
return this.zabbixAPI.getZabbixAPIVersion().then(function (apiVersion) {
return {
status: "success",
title: "Success",
message: "Zabbix API version: " + apiVersion
};
});
};
/**
* Calls for each panel in dashboard.
*