mirror of
https://github.com/nttgin/BGPalerter.git
synced 2024-05-19 06:50:08 +00:00
fixed beacon monitoring to make it less chatty
This commit is contained in:
@ -24,7 +24,7 @@ The following are common parameters which it is possible to specify in the confi
|
||||
|rpki| A dictionary containing the RPKI configuration (see [here](rpki.md) for more details). | | | Yes |
|
||||
|groupsFile| A file containing user groups definition (see [here](usergroups.md) for more details). | A string | groups.yml | No |
|
||||
|rest| A dictionary containing the parameters to run the server for all APIs provided by BGPalerter. | | | No |
|
||||
|rest.host| The IP/host on which the API will be reachable. The default value is localhost, this means the API will not be reachable from another host. To make it public use null or 0.0.0.0. | A string or null | localhost | No |
|
||||
|rest.host| The IP/host on which the APIs will be reachable. The default value is localhost, this means the API will not be reachable from another host. To make it public use null or 0.0.0.0. | A string or null | localhost | No |
|
||||
|rest.port| The port of the REST API. The default value is 8011. | An integer | 8011 | No |
|
||||
|
||||
The following are advanced parameters, please don't touch them if you are not doing research/experiments.
|
||||
|
@ -41,6 +41,7 @@ export default class ConnectorRIS extends Connector {
|
||||
constructor(name, params, env) {
|
||||
super(name, params, env);
|
||||
this.ws = null;
|
||||
this.environment = env.config.environment;
|
||||
this.subscription = null;
|
||||
this.agent = env.agent;
|
||||
this.subscribed = {};
|
||||
@ -67,12 +68,10 @@ export default class ConnectorRIS extends Connector {
|
||||
|
||||
_messageToJson = (message) => {
|
||||
const messageObj = JSON.parse(message);
|
||||
const path = (messageObj.data.path || []);
|
||||
if (path[path.length - 1] === 12654) {
|
||||
if (this.environment !== "research") {
|
||||
this._checkCanary();
|
||||
} else {
|
||||
this._message(messageObj);
|
||||
}
|
||||
this._message(messageObj);
|
||||
};
|
||||
|
||||
_appendListeners = (resolve, reject) => {
|
||||
@ -245,6 +244,12 @@ export default class ConnectorRIS extends Connector {
|
||||
|
||||
_checkCanary = () => {
|
||||
clearTimeout(this._timerCheckCanary);
|
||||
if (!this.connected) {
|
||||
this.logger.log({
|
||||
level: 'error',
|
||||
message: "RIS connected again, the streaming session is working properly"
|
||||
});
|
||||
}
|
||||
this.connected = true;
|
||||
this._timerCheckCanary = setTimeout(() => {
|
||||
if (this.connected) {
|
||||
@ -254,7 +259,7 @@ export default class ConnectorRIS extends Connector {
|
||||
message: "RIS has been silent for too long, probably there is something wrong"
|
||||
});
|
||||
}
|
||||
}, 3600 * 1000 * 4);
|
||||
}, 3600 * 1000 * 4.5); // every 4.5 hours
|
||||
};
|
||||
|
||||
_onInputChange = (input) => {
|
||||
|
Reference in New Issue
Block a user