problems with traps
DavidGL
se04532____salleURL.edu
Tue Jul 18 13:38:17 CEST 2000
Dear Frank and whole list,
I have a problem when sending traps: the snmp++ browser (which gave me
problems when get-next was over the whole mib) event notificator, shows
different data from which I send. Remember I'm using agent++ without
snmp_v3, over winNT 4.0, and the version is 3.4h.
The code is the following:
>-----------------------------------------------------------------------<
...
// Agent initialization
int status;
snmp=new Snmpx(status, 161);
if(status!=SNMP_CLASS_SUCCESS)
{
return;
}
mib=new Mib;
reqList=new RequestList;
mib->add( new MibLeaf(...) );
mib->set_request_list(reqList);
reqList->set_snmp(snmp);
AfxBeginThread( Agent, this );
...
// Trap alarm code
int status;
Pdux pdu;
CTarget target((IpAddress)MANAGER_ADDRESS);
Vbx varb((Oidx)"1.3.6.1.4.1.6517.1.2.4.2");
varb.set_value((OctetStr)"this is a log");
pdu+=varb;
pdu.set_notify_enterprise((Oidx)"1.3.6.1.4.1.6517");
pdu.set_notify_id((Oidx)"1.3.6.1.4.1.6517.1.2.4.1.2");
status = snmp->trap( pdu, target);
if( status!=SNMP_CLASS_SUCCESS )
{
return ERR_COULD_NOT_SEND_TRAP;
}
...
// Agent Thread does the following:
Request* req=NULL;
while(keepRunning)
{
req=reqList->receive(1);
if(req)
{
mib->process_request(req);
req=NULL;
}
}
...
>-----------------------------------------------------------------------<
But the received trap shows the following:
"Enterprise Specific (1.3.6.1.4.1.6517.1.2.4.1.0.2) from..."
"Enterprise = 1.3.6.1.4.1.6517.1.2.4.1"
So the enterprise specific notify_id has a '0' added,
and the enterprise_id has "1.2.4.1" added.
The varbind is ok.
Can anybody help me, please?
I've tried another trap receiver, named as this "TrapReceiver", but does
not receive anything (maybe for the specific notify_id).
Thank you very much!
David.
_________________________________________________________________________
__/~~~~\___/~~~\__/~\_/~\_/~~~~~\_/~~~~\______/~~~\________/~\___________
__/~\_/~\_/~\_/~\_/~\_/~\___/~\___/~\_/~\____/~\___________/~\___________
__/~\_/~\_/~~~~~\_/~\_/~\___/~\___/~\_/~\____/~\_/~\_______/~\___________
__/~\_/~\_/~\_/~\__/~~~\____/~\___/~\_/~\____/~\_/~\_/~~\__/~\_____/~~\__
__/~~~~\__/~\_/~\___/~\___/~~~~~\_/~~~~\______/~~~~\_/~~\__/~~~~~\_/~~\__
_________________________________________________________________________
David Gonzalez i Lesmes e-mail: se04532 at salleURL.edu
http: //welcome.to/DavidGL
Projecte FlowServer telf: (+34) 93.290.24.28
Centre de TeleVisió Digital (CeTVD)
Enginyeria i Arquitectura La Salle. Universitat Ramon Llull
More information about the AGENTPP
mailing list