fix: Make monitoring build
Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
94eb400a28
commit
0c81963131
1 changed files with 2 additions and 2 deletions
|
@ -83,7 +83,7 @@ func Monitor(db *gorm.DB, warningTimeout int, criticalTimeout int) (rc int) {
|
|||
}
|
||||
|
||||
// Compare to thresholds and add to result map
|
||||
result := MonitoringResult{ShopName: shop.Name, UpdatedAt: product.UpdatedAt, ReturnCode: NAGIOS_OK}
|
||||
result := MonitoringResult{ShopName: shop.Name, UpdatedAt: product.UpdatedAt, ReturnCode: NagiosOk}
|
||||
if product.UpdatedAt.Before(criticalTime) {
|
||||
log.Infof("%s has been updated at %s (before time of %s) (crit)", shop.Name, product.UpdatedAt, criticalTime)
|
||||
result.ReturnCode = NagiosCritical
|
||||
|
@ -107,7 +107,7 @@ func Monitor(db *gorm.DB, warningTimeout int, criticalTimeout int) (rc int) {
|
|||
prefix = "CRIT"
|
||||
message = FormatMonitoringResults(resultMap[NagiosCritical])
|
||||
} else {
|
||||
rc = NagiosOK
|
||||
rc = NagiosOk
|
||||
prefix = "OK"
|
||||
message = "All shops have been updated recently"
|
||||
}
|
||||
|
|
Reference in a new issue