Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 1013 Bytes

readme.md

File metadata and controls

46 lines (35 loc) · 1013 Bytes

td-agent-service-monitor

Usage

Enable td-agent Monitoring Agent by adding these lines to your td-agent configuration file

<source>
  @type monitor_agent
  bind 0.0.0.0
  port 24220
</source>

Start getting updates in node.js

const tdAgentServiceMonitor = require('td-agent-service-monitor')
const callback = (ServiceStatus) => { /* do something with ServiceStatus */ }
const config = { callback }
tdAgentServiceMonitor.start(config)

Stop updates

tdAgentServiceMonitor.stop()

More config options

option description default
host monitor-agent port '0.0.0.0'
port monitor-agent port '24220'
checkInterval interval in ms to check td-agent 10000
callback function to call with td-agent ServiceStatus no op

ServiceStatus

{
  alive: Boolean, // did monitor-agent respond?
  plugins: Plugin[] // see https://docs.fluentd.org/input/monitor_agent#output-example
}