Skip to content

Commit

Permalink
improved ta malfunction alert
Browse files Browse the repository at this point in the history
  • Loading branch information
massimocandela committed Jan 24, 2022
1 parent 02b5c40 commit fdce01d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ Note, while BGPalerter will perform the check near real time, many RIRs have del
Example of alerts:
> ROAs change detected: removed <1.2.3.4/24, 1234, 25, apnic>; added <5.5.3.4/24, 1234, 25, apnic>
>
> Possible TA malfunction: 24% of the ROAs disappeared from APNIC
> Possible TA malfunction or incomplete VRP file: 24% of the ROAs disappeared from APNIC

**This monitor also alerts about ROAs expiration.**

Expand All @@ -393,7 +393,7 @@ The field `expire` must be the closest expiration time of all of the above.
Example of alerts:
> The following ROAs will expire in less than 2 hours: <1.2.3.4/24, 1234, 25, apnic>; <5.5.3.4/24, 1234, 25, apnic>
>
> Possible TA malfunction: 24% of the ROAs are expiring in APNIC
> Possible TA malfunction or incomplete VRP file: 24% of the ROAs are expiring in APNIC


Parameters for this monitor module:
Expand Down
4 changes: 2 additions & 2 deletions src/monitors/monitorROAS.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class MonitorROAS extends Monitor {
const percentage = 100 / max * diff;

if (percentage > this.toleranceDeletedRoasTA) {
const message = `Possible TA malfunction: ${percentage.toFixed(2)}% of the ROAs disappeared from ${ta}`;
const message = `Possible TA malfunction or incomplete VRP file: ${percentage.toFixed(2)}% of the ROAs disappeared from ${ta}`;

this.publishAlert(`disappeared-${ta}`, // The hash will prevent alert duplications in case multiple ASes/prefixes are involved
ta,
Expand All @@ -90,7 +90,7 @@ export default class MonitorROAS extends Monitor {
const percentage = (100 / max) * min;

if (percentage > this.toleranceExpiredRoasTA) {
const message = `Possible TA malfunction: ${percentage.toFixed(2)}% of the ROAs are expiring in ${ta}`;
const message = `Possible TA malfunction or incomplete VRP file: ${percentage.toFixed(2)}% of the ROAs are expiring in ${ta}`;

this.publishAlert(`expiring-${ta}`, // The hash will prevent alert duplications in case multiple ASes/prefixes are involved
ta,
Expand Down
8 changes: 4 additions & 4 deletions tests/rpki_tests/tests.external-roas.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ describe("RPKI monitoring external", function() {
truncated: false,
origin: 'rpki-monitor',
affected: 'ripe',
message: 'Possible TA malfunction: 60.00% of the ROAs disappeared from ripe',
message: 'Possible TA malfunction or incomplete VRP file: 60.00% of the ROAs disappeared from ripe',
data: [
{
affected: 'ripe',
matchedMessage: 'Possible TA malfunction: 60.00% of the ROAs disappeared from ripe'
matchedMessage: 'Possible TA malfunction or incomplete VRP file: 60.00% of the ROAs disappeared from ripe'
}
]
},
Expand All @@ -74,11 +74,11 @@ describe("RPKI monitoring external", function() {
truncated: false,
origin: 'rpki-monitor',
affected: 'ripe',
message: 'Possible TA malfunction: 50.00% of the ROAs are expiring in ripe',
message: 'Possible TA malfunction or incomplete VRP file: 50.00% of the ROAs are expiring in ripe',
data: [
{
affected: 'ripe',
matchedMessage: 'Possible TA malfunction: 50.00% of the ROAs are expiring in ripe',
matchedMessage: 'Possible TA malfunction or incomplete VRP file: 50.00% of the ROAs are expiring in ripe',
extra: {}
}
]
Expand Down

0 comments on commit fdce01d

Please sign in to comment.