diff --git a/src/datasource-zabbix/datasource.js b/src/datasource-zabbix/datasource.js index 09a9e44..4c7ccfd 100644 --- a/src/datasource-zabbix/datasource.js +++ b/src/datasource-zabbix/datasource.js @@ -135,7 +135,7 @@ export class ZabbixAPIDatasource { // Build query in asynchronous manner return self.queryProcessor - .build(groupFilter, hostFilter, appFilter, itemFilter) + .build(groupFilter, hostFilter, appFilter, itemFilter, 'num') .then(items => { // Add hostname for items from multiple hosts var addHostName = utils.isRegex(target.host.filter); diff --git a/src/datasource-zabbix/zabbixAPI.service.js b/src/datasource-zabbix/zabbixAPI.service.js index 3f6ea94..df8bcf4 100644 --- a/src/datasource-zabbix/zabbixAPI.service.js +++ b/src/datasource-zabbix/zabbixAPI.service.js @@ -152,7 +152,7 @@ function ZabbixAPIService($q, alertSrv, zabbixAPICoreService) { * @param {String} itemtype 'num' or 'text' * @return {[type]} array of items */ - getItems(hostids, appids, itemtype='num') { + getItems(hostids, appids, itemtype) { var params = { output: [ 'name', 'key_', @@ -163,10 +163,7 @@ function ZabbixAPIService($q, alertSrv, zabbixAPICoreService) { ], sortfield: 'name', webitems: true, - filter: { - // Return only numeric items by default - value_type: [0, 3] - }, + filter: {}, selectHosts: [ 'hostid', 'name' @@ -178,6 +175,10 @@ function ZabbixAPIService($q, alertSrv, zabbixAPICoreService) { if (appids) { params.applicationids = appids; } + if (itemtype === 'num') { + // Return only numeric metrics + params.filter.value_type = [0, 3]; + } if (itemtype === 'text') { // Return only text metrics params.filter.value_type = [1, 2, 4];