Fluentd部署:使用REST接口监控Fluentd
Fluentd提供了REST风格的监控接口,我们简单介绍一下相关用法。
-
监控代理 Fluentd提供了一个HTTP代理用于接收内部的统计数据。在配置文件中增加以下配置项启用此代理。 <source>@type monitor_agentbind 0.0.0.0port 24220</source>重启td-agent,就可以通过HTTP获取内部统计数据。
$ curl http://host:24220/api/plugins.json{"plugins":[{"plugin_id":"object:3fec669d6ac4","type":"forward","output_plugin":false,"config":{"type":"forward"}},{"plugin_id":"object:3fec669dfa48","type":"monitor_agent","output_plugin":false,"config":{"type":"monitor_agent","port":"24220"}},{"plugin_id":"object:3fec66aead48","type":"forward","output_plugin":true,"buffer_queue_length":0,"buffer_total_queued_size":0,"retry_count":0,"config":{"type":"forward","host":"192.168.0.11"}}]} -
监控事件流 对于Fluentd事件的统计,可以使用flowcounter或flowcounter_simple插件。这里不对插件的具体用法做介绍,可在GitHub上查看使用文档。
