1
0
mirror of https://github.com/nttgin/BGPalerter.git synced 2024-05-19 06:50:08 +00:00

added email functionality and template for new prefix detection

This commit is contained in:
Massimo Candela
2019-07-10 18:05:08 +02:00
parent 8651ae1ea3
commit 62d24f383f
6 changed files with 324 additions and 235 deletions

View File

@@ -5,7 +5,7 @@ DETAILS:
------------------------------------------------------
Monitored prefix: ${prefix}
Prefix Description: ${description}
Usual prefix origin: AS${asn}
Usually announced by: AS${asn}
Event type: ${type}
Now announced by: AS${neworigin}
Now announced with: ${newprefix}

View File

@@ -0,0 +1,16 @@
${summary}
DETAILS:
------------------------------------------------------
Monitored prefix: ${prefix}
Prefix Description: ${description}
Usually announced by: AS${asn}
Event type: ${type}
Detected new prefix: ${newprefix}
Announced by: AS${neworigin}
When event started: ${earliest} UTC
Last event: ${latest} UTC
Detected by peers: ${peers}
See in BGPlay: ${bgplay}

View File

@@ -124,6 +124,14 @@ export default class ReportEmail extends Report {
break;
case "newprefix":
matched = content.data[0].matchedRule;
context.prefix = matched.prefix;
context.description = matched.description;
context.asn = matched.asn;
context.peers = [...new Set(content.data.map(alert => alert.matchedMessage.peer))].length;
context.neworigin = content.data[0].matchedMessage.originAs;
context.newprefix = content.data[0].matchedMessage.prefix;
context.bgplay = this._getBGPlayLink(matched.prefix, content.earliest, content.latest);
break;
}