On 03/03/2008, Rashid Noor wrote:
> In example-demon.c Why cant I send notification once? or this is not the
> right place?
> while(keep_running){
> send_nsTutorialNotifyStart_trap();
> agent_check_and_process(1);
> }

Think about what that code is actually doing.
It will send a "nsTutorialNotifyStart" trap every time round the loop.
I.e. *every* time the agent receives a new request.

If you want something to happen repeatedly, you put it inside a loop.
If you want it to happen once, then you put it *outside* the loop.

This is not specific to SNMP - it's very basic programming!

> Why mib2c.int_watch.conf & mib2c.scalar.conf implement same type OID
> differently?

The "mib2c.scalar.conf" file is aimed at implementing a general purpose
MIB scalar object. It includes a handler routine, which can be used to
process GET and SET requests for any type of MIB object (number, string
or OID), retrieving the appropriate value using any suitable interface code.

The "mib2c.int_watch.conf" file is a much more limited one.
It's aimed specifically at implementing an *integer* scalar object
(not string or OIDs) and one where the value is held in an internal
variable within the MIB module code.
This more focussed design means that a lot more of the processing
can be done automatically, so the generated code looks much simpler.
But it can only be used where the MIB object (and its value) match these


This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
Net-snmp-users mailing list
Please see the following page to unsubscribe or change other options: