两台ubuntu虚拟机,一台为server,一台client。server IP:192.168.91.130,拟接收数据端口25827.
server安装,版本为4.10
apt-get install collectd
/etc/collectd/collectd.conf配置(主要加入network plugin和rrdtool plugin):
LoadPlugin syslog
<Plugin syslog>
LogLevel info
</Plugin>
LoadPlugin cpu
LoadPlugin df
LoadPlugin disk
LoadPlugin interface
LoadPlugin load
LoadPlugin memory
LoadPlugin network
LoadPlugin rrdtool
<Plugin network>
# # client setup:
# Server "ff18::efc0:4a42" "25826"
# <Server "239.192.74.66" "25826">
# SecurityLevel Encrypt
# Username "user"
# Password "secret"
# Interface "eth0"
# </Server>
# TimeToLive "128"
#
# server setup:
Listen "192.168.91.130" "25827"
#<Listen "192.168.91.130" "25827">
# SecurityLevel Sign
# AuthFile "/etc/collectd/passwd"
# Interface "eth0"
#</Listen>
# MaxPacketSize 1024
#
# # proxy setup (client and server as above):
# Forward true
#
# # statistics about the network plugin itself
# ReportStats false
#
# # "garbage collection"
# CacheFlush 1800
</Plugin>
<Plugin rrdtool>
DataDir "/var/lib/collectd/rrd"
# CacheTimeout 120
# CacheFlush 900
# WritesPerSecond 30
# RandomTimeout 0
#
# The following settings are rather advanced
# and should usually not be touched:
# StepSize 10
# HeartBeat 20
# RRARows 1200
# RRATimespan 158112000
# XFF 0.1
</Plugin>
配置好保存启动:/etc/init.d/collectd start
client端配置:
安装:apt-get install collectd
同样在/etc/collectd/collectd.conf下配置:
不同的是在network插件里,配置
# client setup:
Server "192.168.91.130" "25827"
#<Server "192.168.91.130" "25827">
# SecurityLevel Encrypt
# Username "user"
# Password "secret"
# Interface "eth0"
#</Server>
配置好后重启,/etc/init.d/collectd start
在server端,用rrdtool查看数据。比如查看今天14:00——15:00的平均值,观察得知,collectd每700s产生一个新数据。
server安装,版本为4.10
apt-get install collectd
/etc/collectd/collectd.conf配置(主要加入network plugin和rrdtool plugin):
LoadPlugin syslog
<Plugin syslog>
LogLevel info
</Plugin>
LoadPlugin cpu
LoadPlugin df
LoadPlugin disk
LoadPlugin interface
LoadPlugin load
LoadPlugin memory
LoadPlugin network
LoadPlugin rrdtool
<Plugin network>
# # client setup:
# Server "ff18::efc0:4a42" "25826"
# <Server "239.192.74.66" "25826">
# SecurityLevel Encrypt
# Username "user"
# Password "secret"
# Interface "eth0"
# </Server>
# TimeToLive "128"
#
# server setup:
Listen "192.168.91.130" "25827"
#<Listen "192.168.91.130" "25827">
# SecurityLevel Sign
# AuthFile "/etc/collectd/passwd"
# Interface "eth0"
#</Listen>
# MaxPacketSize 1024
#
# # proxy setup (client and server as above):
# Forward true
#
# # statistics about the network plugin itself
# ReportStats false
#
# # "garbage collection"
# CacheFlush 1800
</Plugin>
<Plugin rrdtool>
DataDir "/var/lib/collectd/rrd"
# CacheTimeout 120
# CacheFlush 900
# WritesPerSecond 30
# RandomTimeout 0
#
# The following settings are rather advanced
# and should usually not be touched:
# StepSize 10
# HeartBeat 20
# RRARows 1200
# RRATimespan 158112000
# XFF 0.1
</Plugin>
配置好保存启动:/etc/init.d/collectd start
client端配置:
安装:apt-get install collectd
同样在/etc/collectd/collectd.conf下配置:
不同的是在network插件里,配置
# client setup:
Server "192.168.91.130" "25827"
#<Server "192.168.91.130" "25827">
# SecurityLevel Encrypt
# Username "user"
# Password "secret"
# Interface "eth0"
#</Server>
配置好后重启,/etc/init.d/collectd start
在server端,用rrdtool查看数据。比如查看今天14:00——15:00的平均值,观察得知,collectd每700s产生一个新数据。
目前不大明白shortterm等代表的含义。
第二次配置时犯了个小错误,plugin network在默认是被#屏蔽掉,当时配置好了network但是一直没有起作用,就是忘记消除屏蔽了。消除后一切正常。