lib/zabbix.js
function init(startupTime, config, events, l) {
  logger = l;

  let targetBuilder;
  if (config.zabbixTargetHostname) {
    targetBuilder = targetStatic.bind(undefined, config.zabbixTargetHostname);
  } else {
    targetBuilder = targetDecode;
  }

  const sender = new ZabbixSender({
    host: config.zabbixHost || 'localhost',
    port: config.zabbixPort || '10051',
    with_timestamps: config.zabbixSendTimestamps || false,
  });

  stats.last_flush = 0;
  stats.last_exception = 0;
  stats.flush_time = 0;
  stats.flush_length = 0;

  events.on('flush', flush.bind(undefined, targetBuilder, sender, config.flushInterval));
  events.on('status', status);

  return true;
}
function init(startupTime, config, events, l) {
  logger = l;

  let targetBuilder;
  if (config.zabbixTargetHostname) {
    targetBuilder = targetStatic.bind(undefined, config.zabbixTargetHostname);
  } else {
    targetBuilder = targetDecode;
  }

  const sender = new ZabbixSender({
    host: config.zabbixHost || 'localhost',
    port: config.zabbixPort || '10051',
    with_timestamps: config.zabbixSendTimestamps || false,
  });

  stats.last_flush = 0;
  stats.last_exception = 0;
  stats.flush_time = 0;
  stats.flush_length = 0;

  events.on('flush', flush.bind(undefined, targetBuilder, sender, config.flushInterval));
  events.on('status', status);

  return true;
}
function init ( startupTime , config , events , l ) { logger = l ; let targetBuilder ; if ( config . zabbixTargetHostname ) { targetBuilder = targetStatic . bind ( undefined , config . zabbixTargetHostname ) ; } else { targetBuilder = targetDecode ; } const sender = new ZabbixSender ( { host : config . zabbixHost || 'localhost' , port : config . zabbixPort || '10051' , with_timestamps : config . zabbixSendTimestamps || false , } ) ; stats . last_flush = 0 ; stats . last_exception = 0 ; stats . flush_time = 0 ; stats . flush_length = 0 ; events . on ( 'flush' , flush . bind ( undefined , targetBuilder , sender , config . flushInterval ) ) ; events . on ( 'status' , status ) ; return true ; }
Initalize the plugin.
@param {number} startupTime Timestamp StatsD started.
@param {Object} config Global configuration provided to StatsD.
@param {Object} events Event handler to register actions on.
@param {Object} l Global logger instance.
@returns {boolean} Status of initialization.
Initalize the plugin .