snmp: warn if snmp call timeout
If the snmp call timeout because the host is unreachable
just warn the operator.
We can't really known what happen with the snmp error.
That's why the change just filter on "timeout" word.
Change-Id: I564b290c1e07882a7591a003c4da3ac6034ac794
(cherry picked from commit 988a2f3f2d
)
This commit is contained in:
parent
aa6bd89077
commit
d9340c88f0
|
@ -161,11 +161,15 @@ class GenericHardwareDeclarativePollster(plugin_base.PollsterBase):
|
|||
parsed_url,
|
||||
i_cache[identifier]))
|
||||
except Exception as err:
|
||||
LOG.exception('inspector call failed for %(ident)s '
|
||||
'host %(host)s: %(err)s',
|
||||
dict(ident=identifier,
|
||||
host=parsed_url.hostname,
|
||||
err=err))
|
||||
msg = ('inspector call failed for %(ident)s '
|
||||
'host %(host)s: %(err)s' %
|
||||
dict(ident=identifier,
|
||||
host=parsed_url.hostname,
|
||||
err=err))
|
||||
if "timeout" in str(err):
|
||||
LOG.warning(msg)
|
||||
else:
|
||||
LOG.exception(msg)
|
||||
return itertools.chain(*sample_iters)
|
||||
|
||||
def generate_samples(self, host_url, data):
|
||||
|
|
Loading…
Reference in New Issue