Hi, On Tue, Apr 03, 2012 at 07:24:08PM +0000, Sebastien Cramatte wrote: > We have created a complex perl plugin that scan over 1000 SNMP > equipments using multi threads. It's works except that I don't how > to handle properly interval execution. When I restart collectd > daemon, read method Is called every 10 o 20 seconds …. > > We need that this plugin read method be executed every 300 s (5mn). > How can I achieve this ?
Right now, this is not possible using any built-in mechanisms. (See the per plugin interval feature mentioned in another thread though, which is available as an RFC on Github.) However, you could simple skip a couple of intervals in the read callback function. I.e., use a global variable (for each instance of the callback) to count down the number of intervals to be skipped. Make sure to return 0 in case you skip the current interval. Then, manually set the interval appropriately when dispatching values. HTH, Sebastian -- Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/ Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin
signature.asc
Description: Digital signature
_______________________________________________ collectd mailing list [email protected] http://mailman.verplant.org/listinfo/collectd
