#include "snmptable.h"
#include "logger.h"
-using GTS::SNMPTable;
+using SSMD::SNMPTable;
SNMPTable::SNMPTable(Snmp & snmp,
const CTarget & target,
Vb vb(oid);
Pdu pdu(&vb, 1);
while (true) {
- if (snmp.get_next(pdu, target) != SNMP_CLASS_SUCCESS) {
- logger << "SNMPTable::SNMPTable() - failed to invoke Snmp::get_next (oid: '" << oid.get_printable() << "')" << std::endl;
+ int c = snmp.get_next(pdu, target);
+ for (size_t i = 0; i < 3 && c != SNMP_CLASS_SUCCESS; ++i) {
+ c = snmp.get_next(pdu, target);
+ }
+ if (c != SNMP_CLASS_SUCCESS) {
+ logger << "SNMPTable::SNMPTable() - failed to invoke Snmp::get_next (oid: '" << oid.get_printable() << "'). Error message: '" << Snmp::error_msg(c) << "'" << std::endl;
return;
}
if (pdu.get_vb(0).get_oid().nCompare(oid.len(), oid) != 0) {