This commit is contained in:
Alec Sears
2019-10-18 16:02:23 -05:00
parent ca145c9acb
commit e153473421
13 changed files with 6490 additions and 962 deletions

View File

@@ -110,37 +110,37 @@ export class Zabbix {
}
```
*/
testDataSource() {
let zabbixVersion;
let dbConnectorStatus;
return this.getVersion()
.then(version => {
zabbixVersion = version;
return this.login();
})
.then(() => {
if (this.enableDirectDBConnection) {
return this.dbConnector.testDataSource();
} else {
return Promise.resolve();
}
})
.catch(error => {
if (error instanceof ZabbixNotImplemented) {
return Promise.resolve();
}
return Promise.reject(error);
})
.then(testResult => {
if (testResult) {
dbConnectorStatus = {
dsType: this.dbConnector.datasourceTypeName,
dsName: this.dbConnector.datasourceName
};
}
return { zabbixVersion, dbConnectorStatus };
});
}
// testDataSource() {
// let zabbixVersion;
// let dbConnectorStatus;
// return this.getVersion()
// .then(version => {
// zabbixVersion = version;
// return this.login();
// })
// .then(() => {
// if (this.enableDirectDBConnection) {
// return this.dbConnector.testDataSource();
// } else {
// return Promise.resolve();
// }
// })
// .catch(error => {
// if (error instanceof ZabbixNotImplemented) {
// return Promise.resolve();
// }
// return Promise.reject(error);
// })
// .then(testResult => {
// if (testResult) {
// dbConnectorStatus = {
// dsType: this.dbConnector.datasourceTypeName,
// dsName: this.dbConnector.datasourceName
// };
// }
// return { zabbixVersion, dbConnectorStatus };
// });
// }
getItemsFromTarget(target, options) {
let parts = ['group', 'host', 'application', 'item'];