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()
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 |
{
alive: Boolean, // did monitor-agent respond?
plugins: Plugin[] // see https://docs.fluentd.org/input/monitor_agent#output-example
}