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

refactored monitorRPKI to use rpkiUtils

This commit is contained in:
Massimo Candela
2020-11-04 19:33:53 +01:00
parent c88a4f6821
commit a286a6236b
2 changed files with 11 additions and 2 deletions

View File

@@ -6,6 +6,17 @@ export default class MonitorRPKI extends Monitor {
constructor(name, channel, params, env, input){
super(name, channel, params, env, input);
// Warn about deprecated config parameters
for (const configParamKey of Object.keys(params)) {
const deprecated = ["preCacheROAs", "refreshVrpListMinutes", "vrpFile", "vrpProvider"];
if (deprecated.includes(configParamKey)) {
this.logger.log({
level: 'error',
message: `The parameters ${deprecated.join(",")} are deprecated in monitorRPKI. Please use see here: https://github.com/nttgin/BGPalerter/blob/master/docs/rpki.md`
});
}
}
this.rpki = env.rpki;
this.cacheValidPrefixesSeconds = (this.params.cacheValidPrefixesSeconds || 3600 * 24 * 7) * 1000;
this.input.onChange(() => {

View File

@@ -76,7 +76,6 @@ export default class RpkiUtils {
};
_loadRpkiValidatorFromVrpFile = (vrpFile) => {
console.log("LOADING");
if (fs.existsSync(vrpFile)) {
try {
@@ -146,7 +145,6 @@ export default class RpkiUtils {
return this.rpki
.preCache(this.params.refreshVrpListMinutes)
.catch(() => {
console.log("ERROR");
this.logger.log({
level: 'error',
message: "One of the VRPs lists cannot be downloaded. The RPKI monitoring should be working anyway with one of the on-line providers."