Re: Regarding agent extension

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 21/12/06, noopur tiwari <[email protected]> wrote:
> i am interested in extending the net-snmp agnet for a
>... table in this mib....i have used the mib2c utility with
> mib2c.iterate.conf file and ... now want that whenever an snmpget
> command is issued then value of the OID should be
> retrieved from a file

OK.
Then the "get_first" hook routine should open this file and
read the first line.  The "get_next" hook routine should read
the next line of the file each time.

You should be able to pass the line read in as 'data_context'
and the file handle as 'loop_context' (or else have this as
a global variable).

You don't say how the table is indexed, but that's the role of
the 'netsnmp_variable' index parameter.

When you get to the end of the file, "get_next" should return
NULL.

The helper would then be passed the relevant line of the file
and can return the appropriate value.

Dave

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.