aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/moncheck/main.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/moncheck/main.go b/cmd/moncheck/main.go
index e292637..2c3ca27 100644
--- a/cmd/moncheck/main.go
+++ b/cmd/moncheck/main.go
@@ -147,15 +147,16 @@ func check(thread int, db *sql.DB, waitDuration, timeout time.Duration) {
state = 0
}
+ mappedState := state
err = db.QueryRow(`select target
from mapping_level
- where mapping_id = $1 and source = $2`, mapId, state).Scan(&state)
+ where mapping_id = $1 and source = $2`, mapId, state).Scan(&mappedState)
if err != nil {
- log.Printf("[%d] could not fetch error mapping for check '%d': %s", thread, id, err)
+ log.Printf("[%d] could not fetch error mapping for check '%d' and source code '%d': %s", thread, id, state, err)
tx.Rollback()
continue
}
- states.Add(state)
+ states.Add(mappedState)
msg := output.String()
if _, err := tx.Exec(`update active_checks ac