Archived
1
0
Fork 0

fix: Make monitoring build

Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
Julien Riou 2022-09-01 07:07:13 +02:00
parent 94eb400a28
commit 0c81963131
No known key found for this signature in database
GPG key ID: FF42D23B580C89F7

View file

@ -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"
}