Phil Endecott wrote:
> Is there any way to have collectd write values more frequently
> to one writer than another?

I have hacked together the following plugin.  It matches only 
data whose timestamp is within the first interval of each ten 
minute period.  It has some obvious flaws but it does what I 

#include "collectd.h"

#include "common.h"
#include "filter_chain.h"

static int mi_match(const data_set_t *      ds        __attribute__((unused)),
                    const value_list_t *    vl,
                    notification_meta_t * * meta      __attribute__((unused)),
                    void * *                user_data __attribute__((unused)))
  cdtime_t time = vl->time;
  cdtime_t interval = vl->interval;
  // cdtime_t is a 64-bit unsigned integer with 30 fractional bits.
  cdtime_t ten_minutes = ((uint64_t)600) << 30;

  if (time % ten_minutes < interval) return FC_MATCH_MATCHES;
  else return FC_MATCH_NO_MATCH;

void module_register(void)
  match_proc_t mproc = {0};
  mproc.match = mi_match;
  fc_register_match("interval", mproc);


PostCacheChain Filter
<Chain "Filter">
        <Rule "xxxx">
                <Match "interval">
                <Target "write">
                        Plugin "postgresql-xxx"
        <Target "write">
                Plugin "rrdtool"

Regards, Phil.

collectd mailing list

Reply via email to