mirror of
https://github.com/nttgin/BGPalerter.git
synced 2024-05-19 06:50:08 +00:00
avoid roa and rpki unknown reporting on stale data
This commit is contained in:
@ -35,16 +35,24 @@ export default class MonitorROAS extends Monitor {
|
||||
};
|
||||
|
||||
if (this.enableDiffAlerts || this.enableDeletedCheckTA) {
|
||||
setInterval(this._diffVrps, this.diffEverySeconds * 1000);
|
||||
setInterval(() => {
|
||||
this._skipIfStaleVrps(this._diffVrps);
|
||||
}, this.diffEverySeconds * 1000);
|
||||
}
|
||||
if (this.enableExpirationAlerts || this.enableExpirationCheckTA) {
|
||||
|
||||
setInterval(() => {
|
||||
this._verifyExpiration(this.roaExpirationAlertHours);
|
||||
this._skipIfStaleVrps(() => this._verifyExpiration(this.roaExpirationAlertHours));
|
||||
}, global.EXTERNAL_ROA_EXPIRATION_TEST || 600000);
|
||||
}
|
||||
};
|
||||
|
||||
_skipIfStaleVrps = (callback) => {
|
||||
if (!this.rpki.getStatus().stale) {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
_calculateSizes = (vrps) => {
|
||||
const times = {};
|
||||
|
||||
|
@ -124,7 +124,7 @@ export default class MonitorRPKI extends Monitor {
|
||||
matchedRule,
|
||||
message,
|
||||
{ covering: null, valid: null, roaDisappeared: true, subType: "rpki-disappear" });
|
||||
} else if (this.params.checkUncovered) {
|
||||
} else if (this.params.checkUncovered && !this.rpki.getStatus().stale) {
|
||||
this.publishAlert(key,
|
||||
prefix,
|
||||
matchedRule,
|
||||
|
@ -66,6 +66,7 @@ export default class RpkiUtils {
|
||||
this._loadRpkiValidator();
|
||||
|
||||
if (this.params.markDataAsStaleAfterMinutes > 0) {
|
||||
this._markAsStale();
|
||||
setInterval(this._markAsStale, this.params.markDataAsStaleAfterMinutes * 60 * 1000);
|
||||
}
|
||||
|
||||
@ -174,7 +175,6 @@ export default class RpkiUtils {
|
||||
.preCache(this.params.refreshVrpListMinutes)
|
||||
.then(data => {
|
||||
this.status.data = true;
|
||||
this.status.stale = false;
|
||||
|
||||
return data;
|
||||
})
|
||||
@ -189,7 +189,6 @@ export default class RpkiUtils {
|
||||
})
|
||||
} else {
|
||||
this.status.data = true;
|
||||
this.status.stale = false;
|
||||
return Promise.resolve();
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user