Agent trying to receive SET request only gets timeout
christel.sohnemann____philips.com
christel.sohnemann____philips.com
Wed Sep 6 11:22:02 CEST 2000
Hello,
I use Agent++ in the latest version and I am using SNMP v2c. I try to receive a SET request.
I initialize the SNMP connection with class Snmpx and use port 0 (which is default in base class Snmp).
I set a enterprise specific variable with the management application. My problem: I do not receive any request on Agent site. Both, manager and agent run on NT4.0 platform (both on the same host).
I wonder, if I must set the SNMP version? I do not find that in any example code....
I wonder if there is anything essential I forgot during initialization? Is port 0 really correct? I cannot initialize with port 161 or 162, these are already in use (indicated by the error I get).
Any help is really appreciated, as debugging this is really nasty...
Best regards and many thanx in advance!
Christel Sohnemann
The code how to receive the request is as follows:
// Initialization of SNMP session
int iStatus(0);
// create SNMP socket connection
m_pSnmpConnection = new Snmpx( iStatus, 0 );
if ( SNMP_CLASS_SUCCESS != iStatus )
{
//... error handling
}
// create SNMP request list
m_pRequestList = new RequestList;
m_pRequestList->set_snmp(m_pSnmpConnection);
// create the one and only mib
m_pParentMib = new Mib;
// register request list used by mib for outgoing requests
m_pParentMib->set_request_list( m_pRequestList );
// add snmpGroup
m_pParentMib->add(new snmpGroup()); // (provided with AGENT++) to mib ...
// add specific mib to parent mib
m_pParentMib->add(pMib );
[...]
// receive request (runs in loop, this is only an extract)
Request* pRequest; // pointer to an incoming SNMP request
// wait for incoming request max timeout sec
pRequest = m_pRequestList->receive(m_iRequestListenTimeout);
if (pRequest)
{
// check if request comes from one of those snmp managers being allowed
// to send requests!
CTarget* pOriginAddress = pRequest->get_address();
if ( isValidIPAddress(pOriginAddress) )
{
try
{
m_pParentMib->process_request(pRequest); // process the request
}
catch(const DSException& e)
{
// ... error handling
}
}
}
Christel Sohnemann
Software Development
Philips Speech Processing Aachen, Zweigniederlassung der Philips GmbH
Kackertstr. 10, 52072 Aachen, Germany
mailTo: christel.sohnemann____philips.com
Tel: +49 - (0)241 - 8871 191, Fax: +49 - (0)241 - 8871 140
http://www.speech.philips.com/
More information about the AGENTPP
mailing list