[enh] hostname in mails body as well
This commit is contained in:
@@ -36,7 +36,7 @@ export const mail = {
|
|||||||
console.log('Connection established')
|
console.log('Connection established')
|
||||||
await sendMail(conf.mail, `[dwatcher] [${os.hostname}] Connection established`, `
|
await sendMail(conf.mail, `[dwatcher] [${os.hostname}] Connection established`, `
|
||||||
<p>
|
<p>
|
||||||
Connection to ${target} established on ${moment().format('DD-MM-YYYY HH:mm:ss')}.
|
Connection from [${os.hostname}] to ${target} established on ${moment().format('DD-MM-YYYY HH:mm:ss')}.
|
||||||
</p>
|
</p>
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ export const mail = {
|
|||||||
console.log('Waiting %s seconds...', waitingDelay)
|
console.log('Waiting %s seconds...', waitingDelay)
|
||||||
await sendMail(conf.mail, `[dwatcher] [${os.hostname}] Connection closed`, `
|
await sendMail(conf.mail, `[dwatcher] [${os.hostname}] Connection closed`, `
|
||||||
<p>
|
<p>
|
||||||
Connection to ${target} was lost on ${moment().format('dd-MM-YYYY HH:mm:ss')}.
|
Connection from [${os.hostname}] to ${target} was lost on ${moment().format('dd-MM-YYYY HH:mm:ss')}.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Waiting ${(waitingDelay / 1000).toFixed(0)} seconds before trying to reconnect.
|
Waiting ${(waitingDelay / 1000).toFixed(0)} seconds before trying to reconnect.
|
||||||
@@ -62,7 +62,7 @@ export const mail = {
|
|||||||
console.log('Connection recovered')
|
console.log('Connection recovered')
|
||||||
await sendMail(conf.mail, `[dwatcher] [${os.hostname}] Connection recovered`, `
|
await sendMail(conf.mail, `[dwatcher] [${os.hostname}] Connection recovered`, `
|
||||||
<p>
|
<p>
|
||||||
Connection to ${target} was recovered on ${moment().format('dd-MM-YYYY HH:mm:ss')}.
|
Connection from [${os.hostname}] to ${target} was recovered on ${moment().format('dd-MM-YYYY HH:mm:ss')}.
|
||||||
</p>
|
</p>
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ export const mail = {
|
|||||||
console.error(e.message || e)
|
console.error(e.message || e)
|
||||||
// await sendMail(conf.mail, `[dwatcher] Connection error`, `
|
// await sendMail(conf.mail, `[dwatcher] Connection error`, `
|
||||||
// <p>
|
// <p>
|
||||||
// Connection error with ${target} on ${moment().format('dd-MM-YYYY HH:mm:ss')}:
|
// Connection from [${os.hostname}] error with ${target} on ${moment().format('dd-MM-YYYY HH:mm:ss')}:
|
||||||
// </p>
|
// </p>
|
||||||
// <p>
|
// <p>
|
||||||
// ${e.message}
|
// ${e.message}
|
||||||
|
|||||||
Reference in New Issue
Block a user