collectd配置

doc

https://collectd.org/wiki

configure

#Hostname    "localhost"
#FQDNLookup   true
#BaseDir     "/usr/var/lib/collectd"
#PIDFile     "/usr/var/run/collectd.pid"
#PluginDir   "/usr/lib/collectd"
#TypesDB     "/usr/share/collectd/types.db"

Interval     60
Timeout      2
ReadThreads  10
WriteThreads 10

Include "/etc/collectd.d"

LoadPlugin logfile
LoadPlugin cpu
LoadPlugin df
LoadPlugin disk
LoadPlugin interface
LoadPlugin load
LoadPlugin memory
LoadPlugin network
LoadPlugin Processes
LoadPlugin tcpconns

<Plugin logfile>
    LogLevel info
    File "/var/log/collectd.log"
    Timestamp true
    PrintSeverity false
</Plugin>

<Plugin df>
    FSType "ext3"
    FSType "ext4"
    FSType "xfs"
    IgnoreSelected false
    ReportReserved true
    ReportInodes true
</Plugin>

<Plugin disk>
    Disk "/^[hsv]d[a-f][0-9]?$/"
    IgnoreSelected false
</Plugin>

<Plugin interface>
    Interface "lo"
    IgnoreSelected true
</Plugin>

<Plugin network>
    Listen "0.0.0.0" "25826"  # server
    Server "127.0.0.1" "8089" # client
    Forward true # proxy
    ReportStats true
    CacheFlush 1800
</Plugin>

<Plugin tcpconns>
    ListeningPorts true
#   LocalPort "25"
#   RemotePort "25"
</Plugin>

push data to influxdb

https://github.com/collectd/collectd/issues/696

[collectd]
  enabled = true
  bind-address = ":8089"
  database = "collectd"
  typesdb = "/etc/opt/influxdb/types.db"

api

# create db
curl -G http://192.168.48.83:8086/query --data-urlencode "q=CREATE DATABASE collectd"

# show series
curl -G http://192.168.48.83:8086/query?pretty=true --data-urlencode "db=collectd" --data-urlencode "q=show series"

你可能感兴趣的:(配置)