X-Git-Url: https://git.stg.codes/ssmd.git/blobdiff_plain/ae26516a8828d54ab7c0e0bca92031a54a15ed62..25dd1ac0696ca47e586e58d4309fc4c36e11d1dc:/src/snmptable.cpp diff --git a/src/snmptable.cpp b/src/snmptable.cpp index b0aaba3..d9f8ae6 100644 --- a/src/snmptable.cpp +++ b/src/snmptable.cpp @@ -1,7 +1,7 @@ #include "snmptable.h" #include "logger.h" -using GTS::SNMPTable; +using SSMD::SNMPTable; SNMPTable::SNMPTable(Snmp & snmp, const CTarget & target, @@ -11,8 +11,12 @@ SNMPTable::SNMPTable(Snmp & snmp, 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) {