Triggers query mode, allow to get active triggers count, #141
This commit is contained in:
31
dist/test/datasource-zabbix/zabbixAPI.service.js
vendored
31
dist/test/datasource-zabbix/zabbixAPI.service.js
vendored
@@ -483,6 +483,37 @@ function ZabbixAPIServiceFactory(alertSrv, zabbixAPICoreService) {
|
||||
params.lastChangeTill = timeTo;
|
||||
}
|
||||
|
||||
return this.request('trigger.get', params);
|
||||
}
|
||||
}, {
|
||||
key: 'getHostAlerts',
|
||||
value: function getHostAlerts(hostids, applicationids, minSeverity, count, timeFrom, timeTo) {
|
||||
var params = {
|
||||
output: 'extend',
|
||||
hostids: hostids,
|
||||
min_severity: minSeverity,
|
||||
filter: { value: 1 },
|
||||
expandDescription: true,
|
||||
expandData: true,
|
||||
expandComment: true,
|
||||
monitored: true,
|
||||
skipDependent: true,
|
||||
selectLastEvent: 'extend'
|
||||
};
|
||||
|
||||
if (count) {
|
||||
params.countOutput = true;
|
||||
}
|
||||
|
||||
if (applicationids && applicationids.length) {
|
||||
params.applicationids = applicationids;
|
||||
}
|
||||
|
||||
if (timeFrom || timeTo) {
|
||||
params.lastChangeSince = timeFrom;
|
||||
params.lastChangeTill = timeTo;
|
||||
}
|
||||
|
||||
return this.request('trigger.get', params);
|
||||
}
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user