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
|
// 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) {
|
if product.UpdatedAt.Before(criticalTime) {
|
||||||
log.Infof("%s has been updated at %s (before time of %s) (crit)", shop.Name, product.UpdatedAt, criticalTime)
|
log.Infof("%s has been updated at %s (before time of %s) (crit)", shop.Name, product.UpdatedAt, criticalTime)
|
||||||
result.ReturnCode = NagiosCritical
|
result.ReturnCode = NagiosCritical
|
||||||
|
@ -107,7 +107,7 @@ func Monitor(db *gorm.DB, warningTimeout int, criticalTimeout int) (rc int) {
|
||||||
prefix = "CRIT"
|
prefix = "CRIT"
|
||||||
message = FormatMonitoringResults(resultMap[NagiosCritical])
|
message = FormatMonitoringResults(resultMap[NagiosCritical])
|
||||||
} else {
|
} else {
|
||||||
rc = NagiosOK
|
rc = NagiosOk
|
||||||
prefix = "OK"
|
prefix = "OK"
|
||||||
message = "All shops have been updated recently"
|
message = "All shops have been updated recently"
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue