use machine name if available in alerts
This commit is contained in:
parent
3720c2eca9
commit
0d4ce51467
2 changed files with 7 additions and 4 deletions
|
|
@ -95,7 +95,7 @@ function devicesAndEvents () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkStatus () {
|
function checkStatus () {
|
||||||
var alerts = {devices: {}}
|
var alerts = {devices: {}, deviceNames: {}}
|
||||||
alerts.general = checkBalances()
|
alerts.general = checkBalances()
|
||||||
|
|
||||||
return devicesAndEvents()
|
return devicesAndEvents()
|
||||||
|
|
@ -105,6 +105,7 @@ function checkStatus () {
|
||||||
|
|
||||||
devices.rows.forEach(function (deviceRow) {
|
devices.rows.forEach(function (deviceRow) {
|
||||||
var deviceFingerprint = deviceRow.fingerprint
|
var deviceFingerprint = deviceRow.fingerprint
|
||||||
|
var deviceName = deviceRow.name || deviceFingerprint
|
||||||
var deviceEvents = events.rows.filter(function (eventRow) {
|
var deviceEvents = events.rows.filter(function (eventRow) {
|
||||||
return eventRow.device_fingerprint === deviceFingerprint
|
return eventRow.device_fingerprint === deviceFingerprint
|
||||||
})
|
})
|
||||||
|
|
@ -113,7 +114,8 @@ function checkStatus () {
|
||||||
deviceAlerts = R.concat(deviceAlerts, checkStuckScreen(deviceEvents))
|
deviceAlerts = R.concat(deviceAlerts, checkStuckScreen(deviceEvents))
|
||||||
deviceAlerts = R.concat(deviceAlerts, checkPing(deviceEvents))
|
deviceAlerts = R.concat(deviceAlerts, checkPing(deviceEvents))
|
||||||
|
|
||||||
alerts.devices[deviceRow.fingerprint] = deviceAlerts
|
alerts.devices[deviceFingerprint] = deviceAlerts
|
||||||
|
alerts.deviceNames[deviceFingerprint] = deviceName
|
||||||
})
|
})
|
||||||
|
|
||||||
return alerts
|
return alerts
|
||||||
|
|
@ -155,7 +157,8 @@ function printEmailAlerts (alertRec) {
|
||||||
}
|
}
|
||||||
|
|
||||||
R.keys(alertRec.devices).forEach(function (device) {
|
R.keys(alertRec.devices).forEach(function (device) {
|
||||||
body = body + '\nErrors for ' + device + ':\n'
|
var deviceName = alertRec.deviceNames[device]
|
||||||
|
body = body + '\nErrors for ' + deviceName + ':\n'
|
||||||
body = body + emailAlerts(alertRec.devices[device])
|
body = body + emailAlerts(alertRec.devices[device])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
2
todo.txt
2
todo.txt
|
|
@ -1 +1 @@
|
||||||
- configure LOW_BALANCE_THRESHOLD, STALE_STATE, NETWORK_DOWN_TIME
|
- fix tests
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue