Add tags filter to triggers query
This commit is contained in:
@@ -715,7 +715,7 @@ export class ZabbixAPIConnector {
|
||||
}
|
||||
|
||||
async getHostAlerts(hostids, applicationids, options): Promise<ZBXTrigger[]> {
|
||||
const { minSeverity, acknowledged, count, timeFrom, timeTo } = options;
|
||||
const { minSeverity, acknowledged, tags, count, timeFrom, timeTo } = options;
|
||||
const params: any = {
|
||||
output: 'extend',
|
||||
hostids: hostids,
|
||||
@@ -747,6 +747,11 @@ export class ZabbixAPIConnector {
|
||||
params.lastChangeTill = timeTo;
|
||||
}
|
||||
|
||||
if (tags) {
|
||||
params.tags = tags;
|
||||
params.evaltype = 0;
|
||||
}
|
||||
|
||||
let triggers = await this.request('trigger.get', params);
|
||||
if (!count || acknowledged === 1) {
|
||||
triggers = filterTriggersByAcknowledge(triggers, acknowledged);
|
||||
|
||||
Reference in New Issue
Block a user