Annotations: show host name as colored tag.
This commit is contained in:
@@ -396,19 +396,20 @@ export class ZabbixAPIDatasource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return _.map(events, event => {
|
return _.map(events, event => {
|
||||||
var title ='';
|
let tags;
|
||||||
if (annotation.showHostname) {
|
if (annotation.showHostname) {
|
||||||
title += event.hosts[0].name + ': ';
|
tags = _.map(event.hosts, 'name');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show event type (OK or Problem)
|
// Show event type (OK or Problem)
|
||||||
title += Number(event.value) ? 'Problem' : 'OK';
|
let title = Number(event.value) ? 'Problem' : 'OK';
|
||||||
|
|
||||||
var formatted_acknowledges = utils.formatAcknowledges(event.acknowledges);
|
let formatted_acknowledges = utils.formatAcknowledges(event.acknowledges);
|
||||||
return {
|
return {
|
||||||
annotation: annotation,
|
annotation: annotation,
|
||||||
time: event.clock * 1000,
|
time: event.clock * 1000,
|
||||||
title: title,
|
title: title,
|
||||||
|
tags: tags,
|
||||||
text: indexedTriggers[event.objectid].description + formatted_acknowledges
|
text: indexedTriggers[event.objectid].description + formatted_acknowledges
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user