[AGENT++] [SNMP++] how to handle SNMPv3 authentication error in callback function?

Peter petcazay at iitp.ru
Sat Nov 13 13:32:02 CET 2010


Hello!

Would u be so kind to explain to me SNMPv3 authentication errors (like 
wrong security name or wrong authentication password) handling mechanism 
in callback function?

I use SNMP++ v 3.2 library and I found only one method to handle 
above-mentioned errors:

void callback(int reason, Snmp *_snmp, Pdu &pdu, SnmpTarget &target, 
void *cd)
{
...
if (pdu.get_type() == sNMP_PDU_REPORT)
     {
         QString errstr(Snmp::error_msg(pdu.get_vb(0).get_oid()));

         if (errstr == QString("SNMPv3: USM: Unknown SecurityName"))
             status = 1;    //    We detect "wrong user name" error
         if (errstr == QString("SNMPv3: USM: Authentication failure"))
             status = 2;    //    We detect "wrong password" error
     }
....
}
Is that only one method to handle this kind of error or there are some 
other mechanisms?

For example, in NET-SNMP library such error codes can be obtained 
directly from SNMP session structure but in SNMP++ I've not found other 
methods except listed above.

Thanks!



More information about the AGENTPP mailing list