mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-12 06:24:10 +01:00
poller: specify number of OIDs we tried to get
This commit is contained in:
@@ -147,13 +147,18 @@ func (p *realPoller) Poll(ctx context.Context, sampler string, port uint16, comm
|
||||
}
|
||||
if err != nil {
|
||||
p.metrics.failures.WithLabelValues(sampler, "get").Inc()
|
||||
p.errLogger.Err(err).Str("sampler", sampler).Msg("unable to GET")
|
||||
p.errLogger.Err(err).
|
||||
Str("sampler", sampler).
|
||||
Msgf("unable to GET (%d OIDs)", len(requests))
|
||||
return err
|
||||
}
|
||||
if result.Error != gosnmp.NoError && result.ErrorIndex == 0 {
|
||||
// There is some error affecting the whole request
|
||||
p.metrics.failures.WithLabelValues(sampler, "get").Inc()
|
||||
p.errLogger.Error().Str("sampler", sampler).Stringer("code", result.Error).Msg("unable to GET")
|
||||
p.errLogger.Error().
|
||||
Str("sampler", sampler).
|
||||
Stringer("code", result.Error).
|
||||
Msgf("unable to GET (%d OIDs)", len(requests))
|
||||
return fmt.Errorf("SNMP error %s(%d)", result.Error, result.Error)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user