author | Pavel Rochnyack <pavel2000@ngs.ru> | |
Thu, 1 Jun 2017 07:39:24 +0000 (14:39 +0700) | ||
committer | Pavel Rochnyack <pavel2000@ngs.ru> | |
Tue, 26 Sep 2017 19:13:09 +0000 (02:13 +0700) | ||
commit | 9816488b3c779b85e285956e8a920bfceac43840 | |
tree | fd9eabe52aa874fa13c1536f57c8539e77e7cc71 | tree | snapshot |
parent | 4161e32300d9273e5c0d963a627fd7311dee5814 | commit | diff |
snmp plugin: Added res->errstat check
Collectd does not check for `res->errstat` value after
`snmp_sess_synch_response()` call. In case of error, there is no any data in
`res->variables` actually, but variables are tried to be processed as usual.
Suffix calculation will fail, so all subtrees will be marked as failed, not
only one subtree which caused an error.
The csnmp_instance_list_add() call will fail too, and, as result,
`csnmp_read_table` will finish it's work without any data submission.
The log message like
"snmp plugin: host HOSTNAME: csnmp_instance_list_add failed",
which is put into logs in this case, also has no enough diagnostic data.
Added code to proper check for `res->errstat` and to try to get available data.
Issue: #2291
Collectd does not check for `res->errstat` value after
`snmp_sess_synch_response()` call. In case of error, there is no any data in
`res->variables` actually, but variables are tried to be processed as usual.
Suffix calculation will fail, so all subtrees will be marked as failed, not
only one subtree which caused an error.
The csnmp_instance_list_add() call will fail too, and, as result,
`csnmp_read_table` will finish it's work without any data submission.
The log message like
"snmp plugin: host HOSTNAME: csnmp_instance_list_add failed",
which is put into logs in this case, also has no enough diagnostic data.
Added code to proper check for `res->errstat` and to try to get available data.
Issue: #2291
src/snmp.c | diff | blob | history |