Initial alerting feature. This implementation doesn't use Grafana alerting,
instead it get triggers for particular metrics and sets panel's alert state.
This commit is contained in:
25
dist/test/datasource-zabbix/zabbixAPI.service.js
vendored
25
dist/test/datasource-zabbix/zabbixAPI.service.js
vendored
@@ -445,6 +445,31 @@ function ZabbixAPIServiceFactory(alertSrv, zabbixAPICoreService) {
|
||||
});
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: 'getAlerts',
|
||||
value: function getAlerts(itemids, timeFrom, timeTo) {
|
||||
var params = {
|
||||
output: 'extend',
|
||||
itemids: itemids,
|
||||
expandDescription: true,
|
||||
expandData: true,
|
||||
expandComment: true,
|
||||
monitored: true,
|
||||
skipDependent: true,
|
||||
//only_true: true,
|
||||
// filter: {
|
||||
// value: 1
|
||||
// },
|
||||
selectLastEvent: 'extend'
|
||||
};
|
||||
|
||||
if (timeFrom || timeTo) {
|
||||
params.lastChangeSince = timeFrom;
|
||||
params.lastChangeTill = timeTo;
|
||||
}
|
||||
|
||||
return this.request('trigger.get', params);
|
||||
}
|
||||
}]);
|
||||
|
||||
return ZabbixAPI;
|
||||
|
||||
Reference in New Issue
Block a user