collectd简述

    下面简单介绍一下: collectd的部署以及与logstash对接的相关配置实例

    源码安装collectd

    1. wget http://collectd.org/files/collectd-5.4.1.tar.gz
    2. tar zxvf collectd-5.4.1.tar.gz
    3. cd collectd-5.4.1
    4. ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib --mandir=/usr/share/man --enable-all-plugins

    启动collectd

    1. service collectd start

    以下配置实现通过 logstash 监听 25826 端口,接收从 collectd 发送过来的各项检测数据:

    1. input {
    2. collectd {
    3. port => 25826 ## 端口号与发送端对应
    4. }

    示例二:(推荐)

    1. {
    2. "_index": "logstash-2014.12.11",
    3. "_type": "collectd",
    4. "_id": "dS6vVz4aRtK5xS86kwjZnw",
    5. "_score": null,
    6. "_source": {
    7. "host": "host.example.com",
    8. "@timestamp": "2014-12-11T06:28:52.118Z",
    9. "plugin": "interface",
    10. "rx": 19147144,
    11. "tx": 3608629,
    12. "@version": "1",
    13. "type": "collectd",
    14. "tags": [
    15. "_grokparsefailure"
    16. ]
    17. },
    18. "sort": [
    19. 1418279332118
    20. ]
    • collectd支持收集的数据类型: