[AGENT++] Trap implemantation puzzles
Dario maljur
dmaljur at elma.hr
Wed Jul 12 16:00:54 CEST 2006
Hi.
I have successfully managed to get over GET/SET/GET_NEXT type of changing
and setting objects.
And now I'm doing traps but have some doubts on implementation of same.
Please correct me if I'm wrong, but this is what I figured out for now on
traps.
Initiation of trap mechanism is done on done on manager and it is done
pretty much like this in pseudo code:
InitTraps()
{
set traps targets // withch are target agents (on different computers) to
listen to for traps and infos
then set oids // witch are object identifiers of mib-objects we want to
listen to
then register callback function that will be triggered when trap that has
been registered fires from agent.
}
Int reason, Snmp *session, Pdu &pdu , TimeTicks ×tamp, CTarget &target,
void *cbd
Callback (Int reason, Snmp *session, Pdu &pdu , TimeTicks ×tamp,
CTarget &target, void *cbd)
This is callback function I'm using and if I understood correctly this is
where trap finishes it's journey from agent.
And I belive that trap id and value is in the Pdu.
And what about notify mechanism on agent, Do I implement notify in the from
object derived from MibLeaf or this is done somewhere else?
Say I got my RoomTemperature : MibLeaf object with some value of temperature
that is subdue to changes.
And now I want to set a trap on value of temperature to fire a notification
whenever value changes. Or to set trap when
Value exceeds 30 degrees or when is less then 0. Where do I Implement that.
Tnanks.
More information about the AGENTPP
mailing list