This commit is contained in:
Wolfgang Hottgenroth
2017-08-27 23:43:21 +02:00
parent 85db16a271
commit 6a364bd38a
7 changed files with 58 additions and 41 deletions

View File

@ -2,13 +2,10 @@ import * as nodemailer from 'nodemailer'
import * as log from './log'
import * as CallChain from './callchain'
import * as Processor from './processor'
import * as config from './config'
const CHECK_PERIOD : number = 60 // seconds
const SMTP_HOST : string = "localhost"
const SMTP_PORT : number = 25
const SMTP_SENDER : string = "dispatcher@hottis.de"
const SMTP_RECEIVER : string = "woho@hottis.de"
class ClientEntry {
@ -30,8 +27,8 @@ class MissingEventProcessor extends Processor.AProcessor {
super("MissingEventProcessor")
this.smtp = nodemailer.createTransport({
host: SMTP_HOST,
port: SMTP_PORT,
host: config.dict.smtpHost,
port: config.dict.smtpPort,
secure: false
});
@ -43,8 +40,8 @@ class MissingEventProcessor extends Processor.AProcessor {
if ((value.avgDelay != 0) && (elapsedTime > (value.avgDelay * 3))) {
let mail : nodemailer.SendMailOptions = {
from: SMTP_SENDER,
to: SMTP_RECEIVER,
from: config.dict.smtpSender,
to: config.dict.smtpReceiver,
subject: `Missing Event Detected for ${key}`,
text: `Missing Event Detected: ${key}, elapsed: ${elapsedTime / 1000}, avg. delay: ${value.avgDelay / 1000}`
};