Skip to content

Commit

Permalink
add method for querying list of proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderzobnin committed Nov 7, 2018
1 parent c58cb42 commit 85f320a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export class ZabbixAPIConnector {
value: 1
},
selectGroups: ['name'],
selectHosts: ['name', 'host', 'maintenance_status'],
selectHosts: ['name', 'host', 'maintenance_status', 'proxy_hostid'],
selectItems: ['name', 'key_', 'lastvalue'],
selectLastEvent: 'extend',
selectTags: 'extend'
Expand Down Expand Up @@ -463,6 +463,14 @@ export class ZabbixAPIConnector {
return triggers;
});
}

getProxies() {
var params = {
output: ['proxyid', 'host'],
};

return this.request('proxy.get', params);
}
}

function filterTriggersByAcknowledge(triggers, acknowledged) {
Expand Down
6 changes: 3 additions & 3 deletions src/datasource-zabbix/zabbix/zabbix.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ import { ZabbixNotImplemented } from './connectors/dbConnector';

const REQUESTS_TO_PROXYFY = [
'getHistory', 'getTrend', 'getGroups', 'getHosts', 'getApps', 'getItems', 'getMacros', 'getItemsByIDs',
'getEvents', 'getAlerts', 'getHostAlerts', 'getAcknowledges', 'getITService', 'getSLA', 'getVersion'
'getEvents', 'getAlerts', 'getHostAlerts', 'getAcknowledges', 'getITService', 'getSLA', 'getVersion', 'getProxies'
];

const REQUESTS_TO_CACHE = [
'getGroups', 'getHosts', 'getApps', 'getItems', 'getMacros', 'getItemsByIDs', 'getITService'
'getGroups', 'getHosts', 'getApps', 'getItems', 'getMacros', 'getItemsByIDs', 'getITService', 'getProxies'
];

const REQUESTS_TO_BIND = [
'getHistory', 'getTrend', 'getMacros', 'getItemsByIDs', 'getEvents', 'getAlerts', 'getHostAlerts',
'getAcknowledges', 'getITService', 'getVersion', 'login', 'acknowledgeEvent'
'getAcknowledges', 'getITService', 'getVersion', 'login', 'acknowledgeEvent', 'getProxies'
];

export class Zabbix {
Expand Down

0 comments on commit 85f320a

Please sign in to comment.