From affbe8c4206437b265e322aafaa74d39f0278d57 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Wed, 12 Dec 2018 14:05:46 +0100 Subject: moncheck - log the state which wasn't found --- cmd/moncheck/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'cmd/moncheck') 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 -- cgit v1.2.3-70-g09d2