Fw:Re: net-snmp init_XXX() get data periodically( or cyclic ) problem
"Alexander King" <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
------------------ Original ------------------ From: "Dave Shield"<[email protected]>; Date: Tue, Aug 3, 2010 04:42 PM To: "Alexander King"<[email protected]>; Cc: "net-snmp-users"<[email protected]>; "林永听"<[email protected]>; Subject: Re: net-snmp init_XXX() get data periodically( or cyclic ) problem On 3 August 2010 09:04, Alexander King <[email protected]> wrote: > I want to the init_uit routine can get data periodically The "init_xxx" routine is called *once* to set up the module, when the agent first starts That's what the word initialise means. It will not be called repeatedly, and is not the right place to handle (re-)loading data. >>if so,How can I deal with this situation???I need more information ^_^ > Would you give me some hits? Look at using the cache helper. If you run 'mib2c -Scache=1 mib2c.iterate.conf myTable' >>sys-man mibs # mib2c -Scache=1 mib2c.iterat.conf uit no variable specified for -S flag. at /usr/local/bin/mib2c line 96. sys-man mibs # I use net-snmp 5.4.2.1 then this should generate a suitable template. I don't think the scalar mib2c template has a similar option, but you can always apply the same techniques there. As regards generating notifications, it would probably be more sensible to either pass the relevant data into the routine that generates the trap. Or else have this routine refresh the cached data itself. >> Yes,I have another routine to do this,and this routine get data is the newest,can call the function sent trap immediately when the data changed. There's no point in re-loading the data just in case the agent might possibly need to send a trap Dave ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm _______________________________________________ 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