2009/12/14 Jordi Gutiérrez Hermoso <jord...@gmail.com>

> 2009/12/14 Bart Van Assche <bart.vanass...@gmail.com>:
> > 2009/12/10 Jordi Gutiérrez Hermoso <jord...@gmail.com>
> >> Right now I have in my snmpd.conf a bunch of extend commands of the form
> >>
> >>     extend $oid $name $command --args $oid
> >>
> >> where $command is a C program we've written that fetches the value
> >> associated to $oid.
> >>
> >> For performance reasons, we would like to replace this with a
> >> subagent.
> >
> > An excellent example of how to extend the Net-SNMP agent can be found on
> >
> http://net-snmp.sourceforge.net/tutorial/tutorial-5/toolkit/demon/example-demon.c
> .
>
> As I said before, I think I don't understand what I'm doing. If "all"
> I want is to create a subagent that calls my already written that
> turns OIDs into their values, would this involve a simple change in
> the code you showed me?
>

The job of looking up and validating OIDs is handled by the Net-SNMP agent
itself. For reasons of conformance with the SNMP protocol it is even not
desirable to handle this yourself when writing a subagent.

Please have a look at the mib2c tool. Once you have written a MIB for the
OIDs that you are already using, this tool is able to convert your MIB into
template code in which you can easily insert your existing C code.

Also, where are the instructions on how to compile that sample code? I
> can't figure out the proper libraries to link to.
>

You can find these instructions, together with the locations where you can
download the additional source files nstAgentSubagentObject.h and
nstAgentSubagentObject.c, on
http://net-snmp.sourceforge.net/tutorial/tutorial-5/toolkit/demon/index.html
.

Bart.
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to