collectd简述
下面简单介绍一下: collectd的部署以及与logstash对接的相关配置实例
源码安装collectd
wget http://collectd.org/files/collectd-5.4.1.tar.gz
tar zxvf collectd-5.4.1.tar.gz
cd collectd-5.4.1
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib --mandir=/usr/share/man --enable-all-plugins
启动collectd
service collectd start
以下配置实现通过 logstash 监听 25826
端口,接收从 collectd 发送过来的各项检测数据:
input {
collectd {
port => 25826 ## 端口号与发送端对应
}
示例二:(推荐)
{
"_index": "logstash-2014.12.11",
"_type": "collectd",
"_id": "dS6vVz4aRtK5xS86kwjZnw",
"_score": null,
"_source": {
"host": "host.example.com",
"@timestamp": "2014-12-11T06:28:52.118Z",
"plugin": "interface",
"rx": 19147144,
"tx": 3608629,
"@version": "1",
"type": "collectd",
"tags": [
"_grokparsefailure"
]
},
"sort": [
1418279332118
]
collectd支持收集的数据类型: