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:
@@ -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(() => {
|
||||
|
@@ -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."
|
||||
|
Reference in New Issue
Block a user