collectd使用

Collectd是转为周期性收集统计数据和存储而设计的一种后台进程软件

 

安装EPEL源:

Su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm'

 

安装collectd

Yum install collectd

 

服务器配置collectd.conf

BaseDir     "/opt/collectd/var/lib/collectd"

PIDFile     "/opt/collectd/var/run/collectd.pid"

PluginDir   "/opt/collectd/lib/collectd"

TypesDB     "/opt/collectd/share/collectd/types.db"

<Plugin network>

        <Listen "0.0.0.0" "25826">

#               SecurityLevel Sign

#               AuthFile "/opt/collectd/etc/auth_file"

#               Interface "eth0"

        </Listen>

        MaxPacketSize 65535

</Plugin>

 

 客户端配置collectd.conf

 

LoadPlugin exec    #自定义脚本

<Plugin network>

#       # client setup:

        Server "aaaa.sina.com.cn" "25826"

        <Server "aaaa.sina.com.cn" "25826">

#               SecurityLevel Encrypt

#               Username "user"

#               Password "secret"

#               Interface "eth0"

        </Server>

</Plugin>

 

<Plugin exec>

        #Exec "user:group" "/path/to/exec"

        #NotificationExec "user:group" "/path/to/exec"

        Exec "nobody:nobody" "/data0/sbin/cxxx.sh"

</Plugin>

 

 启动collectd

Service collectd start

 

启动后,就可以在master的机器


上面看到相应的rrd文件了,以CPU为例

 

读取文件

 

 

绘图

Rrd文件的前端绘图可以选kcollectd、drraw、Collectd-web、CollectGraph、Visage等进行画图

你可能感兴趣的:(collectd使用)