[AGENT++] Can not Get dot1dBaseBridge when using vb::get_value function

Jochen Katz katz at agentpp.com
Mon Feb 21 23:14:08 CET 2005


Hi,

> In the code as follows,it can't get the 1.3.6.1.2.1.17.1.1.0 value.

> 	int status = snmpThread->get(pdu, *target);
> 	if (status==SNMP_CLASS_SUCCESS)
> 	{
> 		pdu.get_vb( vb,0);
> 		char mac[128];
> 		if(vb.get_value(mac)==SNMP_CLASS_SUCCESS)
> 		{
> 			cout<<"MAC "<<mac<<endl;
> 		}
> 	}

obviously something went wrong. You should add an "else" to the if, so 
you can see what happened:
    else
    {
      cout << "SNMP++ Get Error, " << snmpThread->error_msg(status)
           << " (" << status <<")" << endl;
    }

Regards,
   Jochen



More information about the AGENTPP mailing list