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:
@@ -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}
|
||||
|
16
reports/email_templates/newprefix.txt
Normal file
16
reports/email_templates/newprefix.txt
Normal 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}
|
||||
|
@@ -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;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user