Thoughts to migrate to AgentX...

Frank Fock Frank.Fock____t-online.de
Wed Nov 8 21:52:26 CET 2000


Hi Arie,

Please see my comments inline:

Arie Trost wrote:

> I am trying to evaluate how difficult it would be to migrate from our
> existing SNMP infrastructure to AGENT++ and AgentX.
> Currently, we are using a commercial SNMP toolkit to build our master agent
> and sub agent (which are not
> AgentX compliant of course).  The master agent is available as a binary. The
> process of building the sub agent is
> quite trivial (automatic) with these tools. The programmers need to deal
> with the management instrumentation only:

This should be just as simple with AGENT++/AgentX++.

>
>    We define a MIB module, compile it and generate a C code that is used by
> the run-time library, which is part of the toolkit.

The difference is that AgentGen generates C++ code.
I think you will gain from the object oriented approach.
(You only need to implement what differs from the default
behavior)

>
>    The generated C code contains access methods to the management
> information, this includes GET, SET,
>    GET-NEXT functions for each of the MIB objects in a MIB file, the
> function are called by the run-time library.

With AGENT++, there is one class for each MIB object, which
has methods that interface GET, SET (2 phase commit) and GETNEXT
operations.

> A few questions regarding this (apologise if some of this has been discussed
> already or if the questions are too general).
>
> 1. Does AGENT++/AgentX++ provides similar segregation between dispatch table
> and management instrumentation?
>

Yes. The interface is defined by the MibEntry class.
You can find it within the mib_entry.h file.

>
> 2. Should my code invoke the method routines (get, set, get-next) or they
> are invoked by AGENT++ ?

They are invoked by AGENT++. They are for example:
  /**
   * Let the receiver process a SNMP GET subrequest
   *
   * @param req - A pointer to the whole SNMP GET request.
   * @param ind - The index of the subrequest to be processed.
   */
  virtual void  get_request(Request*, int);

  /**
   * Let the receiver process a SNMP GETNEXT subrequest
   *
   * @param req - A pointer to the whole SNMP GETNEXT request.
   * @param ind - The index of the subrequest to be processed.
   */
  virtual void  get_next_request(Request*, int);

  /**
   * Let the receiver commit a SNMP SET subrequest
   *
   * @param req - A pointer to the whole SNMP SET request.
   * @param ind - The index of the subrequest to be processed.
   * @return SNMP_ERROR_SUCCESS on success and SNMP_ERROR_COMITFAIL on failure.
   */
  virtual int  commit_set_request(Request*, int);

  /**
   * Let the receiver prepare a SNMP SET subrequest
   *
   * @param req - A pointer to the whole SNMP SET request.
   * @param ind - The index of the subrequest to be processed.
   * @return SNMP_ERROR_SUCCESS on success and SNMP_ERROR_WRONG_VALUE,
   *         SNMP_ERROR_WRONG_TYPE, or SNMP_ERROR_NOT_WRITEABLE on failure.
   */
  virtual int  prepare_set_request(Request*, int&);

  /**
   * Let the receiver undo a SNMP SET subrequest
   *
   * @param req - A pointer to the whole SNMP SET request.
   * @param ind - The index of the subrequest to be processed.
   * @return SNMP_ERROR_SUCCESS on success and SNMP_ERROR_UNDO_FAIL on failure.
   */
  virtual int  undo_set_request(Request*, int&);

  /**
   * Clean up resources used for performing (or undoing) set requests.
   *
   * @param req - A pointer to the whole SNMP SET request.
   * @param ind - The index of the subrequest to be processed.
   */
  virtual void  cleanup_set_request(Request*, int&);

There are others to, but all of these methods have default implementations.

>
>
> 3. When implementing a sub-agent, whose classes call the method routines
> AGENT++'s or AgentX++'s?

AgentX++ extends AGENT++, but the interface to the
management instrumentation is backward compatible to AGENT++,
so its AGENT++ that calls the methods actually (triggered by AgentX++).

>
>
> 4. Is there an example showing how to implement an AgentX sub-agent using
> AgentGen? (The AgentGen documentation
>     gives only a few details about what is exactly generated by the mib
> compiler and how it's to be used by AGENT++/AgentX++).
>

AgentGen can be used in exactly the same way as when implementing
a master agent. Please see the AgentX++ documentation for details
on the differences between implementing an AgentX++ master or
subagent.

Hope this helps. (If not, please do not hesitate to ask again!)

Best regards,
Frank

--
Frank Fock - AGENT++
Email: frank____fock.de
Fax: +49 7195 177108





More information about the AGENTPP mailing list