implementing dynamic variable
Mauro Restante
restante____cefriel.it
Sat Apr 7 12:00:56 CEST 2001
Hi frank, and hi to all mailing list,
In order to implement a Mib with Agent++, I first try to implement a dynamic
variable, only a mib leaf.
I used AgentGen to compile a Disman-Schedule-Mib.
Now I try to implement SchedLocalTime variable, and I look the
implementation of sysUpTime system-group leaf.
It should be the same!!??!?!?
When I interrogate the agent I receive a "zero length" answer!!!! The SNMP
PDU is empty!!!!! Why?
Should someone help me??
This is my code.......it is the same of sysUpTime....
>>> schedLocalTime::schedLocalTime()
MibLeaf(oidSchedLocalTime, READONLY, new OctetStr())
>>> {
>>> // This leaf object is a singleton. In order to access it use
>>> // the static pointer schedLocalTime::instance.
>>> instance = this;
>>> start=get();
>>> //--AgentGen BEGIN=schedLocalTime::schedLocalTime
>>> //--AgentGen END
>>>
>>> }
>>> schedLocalTime::~schedLocalTime()
>>> {
>>>
>>> //--AgentGen BEGIN=schedLocalTime::~schedLocalTime
>>> //--AgentGen END
>>> }
>>> //§§ MR
>>> time_t schedLocalTime::get_currentTime()
>>> {
>>> time_t now;
>>> time (&now);
>>>
>>> return now;
>>> }
>>> u_int schedLocalTime::get()
>>> {
>>> return get_currentTime();
>>> }
>>> //§§ MR finish
>>> void schedLocalTime::get_request(Request* req, int index)
>>> {
>>>
>>> //--AgentGen BEGIN=schedLocalTime::get_request
>>> //--AgentGen END
>>> //§§ MR
>>>
>>> *((TimeTicks*)value) = (unsigned long)get(); /*This is the right
assignament to retrive the value????*/
>>>
>>> //§§ MR finish
>>>
>>> MibLeaf::get_request(req, index);
>>>
>>> }
Thanks to ALL and forgive my bad english
Mauro Restante
More information about the AGENTPP
mailing list