zoukankan      html  css  js  c++  java
  • collectd配置

    udp proxy - 192.168.48.112

    cat > /etc/collectd_25801.conf << EOF
    Hostname    "kvm-48-112"
    ReadThreads     5
    WriteThreads    5
    
    LoadPlugin network
    LoadPlugin rrdcached
    LoadPlugin unixsock
    
    <Plugin network>
        Listen "127.0.0.1" "25801"
        Forward true
    </Plugin>
    
    <Plugin rrdcached>
        DaemonAddress "unix:/tmp/rrdcached.sock"
        DataDir "/opt/rrd"
        CreateFiles true
        CreateFilesAsync true
        CollectStatistics true
    </Plugin>
    
    <Plugin unixsock>
        SocketFile "/var/run/collectd.sock"
        SocketGroup "root"
        SocketPerms "0644"
        DeleteSocket false
    </Plugin>
    EOF
    
    cat > /etc/collectd_25802.conf << EOF
    Hostname    "kvm-48-112"
    ReadThreads     5
    WriteThreads    5
    
    LoadPlugin network
    LoadPlugin rrdcached
    LoadPlugin unixsock
    
    <Plugin network>
        Listen "127.0.0.1" "25802"
        Forward true
    </Plugin>
    
    <Plugin rrdcached>
        DaemonAddress "unix:/tmp/rrdcached.sock"
        DataDir "/opt/rrd"
        CreateFiles true
        CreateFilesAsync true
        CollectStatistics true
    </Plugin>
    
    <Plugin unixsock>
        SocketFile "/var/run/collectd.sock"
        SocketGroup "root"
        SocketPerms "0644"
        DeleteSocket false
    </Plugin>
    EOF
    
    collectd -C /etc/collectd_25801.conf -P /var/run/collectd_25801.pid
    collectd -C /etc/collectd_25802.conf -P /var/run/collectd_25802.pid
    
    #nginx.conf
    stream {
        upstream collectd {
            #hash $remote_addr;
            least_conn;
    
            server 127.0.0.1:25801;
            server 127.0.0.1:25802;
        }
    
        server {
            listen 25826 udp;
            proxy_pass collectd;
            #proxy_responses 1;
            proxy_timeout   1s;
    
            #error_log /var/log/nginx/error.log info;
        }
    }
    
    

    collectd proxy - 192.168.48.113

    cat > /etc/collectd.conf << EOF
    Hostname    "kvm-48-113"
    ReadThreads     10
    WriteThreads    5
    
    LoadPlugin aggregation
    LoadPlugin cpu
    LoadPlugin df
    LoadPlugin disk
    LoadPlugin interface
    LoadPlugin load
    LoadPlugin memory
    LoadPlugin network
    LoadPlugin tcpconns
    <Plugin aggregation>
      <Aggregation>
        Plugin "cpu"
        Type "cpu"
    
        SetPlugin "cpu"
        SetPluginInstance "all"
    
        GroupBy "Host"
        GroupBy "TypeInstance"
    
        CalculateAverage true
      </Aggregation>
    </Plugin>
    
    <Plugin df>
      FSType rootfs
      FSType ext3
      FSType ext4
      FSType xfs
      IgnoreSelected false
    </Plugin>
    
    <Plugin disk>
        Disk "/^[hsv]d[a-z]+$/"
        IgnoreSelected false
    </Plugin>
    
    <Plugin load>
            ReportRelative true
    </Plugin>
    
    <Plugin memory>
    	ValuesAbsolute true
    	ValuesPercentage false
    </Plugin>
    
    <Plugin network>
    	Listen "192.168.48.113" "25826"
    	Server "192.168.48.112" "25826"
    	Forward true
    </Plugin>
    
    <Plugin "interface">
      Interface "lo"
      Interface "sit0"
      IgnoreSelected true
    </Plugin>
    
    <Plugin "tcpconns">
      ListeningPorts false
      AllPortsSummary true
    </Plugin>
    
    Include "/etc/collectd.d"
    EOF
    

    host - 192.168.48.114

    cat > /etc/collectd.conf << EOF
    Hostname    "kvm-48-114"
    ReadThreads     10
    WriteThreads    5
    
    LoadPlugin aggregation
    LoadPlugin cpu
    LoadPlugin df
    LoadPlugin disk
    LoadPlugin interface
    LoadPlugin load
    LoadPlugin memory
    LoadPlugin network
    LoadPlugin tcpconns
    
    <Plugin aggregation>
      <Aggregation>
        Plugin cpu
        Type cpu
    
        SetPlugin cpu
        SetPluginInstance all
    
        GroupBy Host
        GroupBy TypeInstance
    
        CalculateAverage true
      </Aggregation>
    </Plugin>
    
    <Plugin df>
        FSType rootfs
        FSType ext3
        FSType ext4
        FSType xfs
        IgnoreSelected false
    </Plugin>
    
    <Plugin disk>
        Disk "/^[hsv]d[a-z]+$/"
        IgnoreSelected false
    </Plugin>
    
    <Plugin load>
        ReportRelative true
    </Plugin>
    
    <Plugin memory>
        ValuesAbsolute true
        ValuesPercentage false
    </Plugin>
    
    <Plugin network>
        Server "192.168.48.113" "25826"
    </Plugin>
    
    <Plugin interface>
        Interface lo
        Interface sit0
        IgnoreSelected true
    </Plugin>
    
    <Plugin tcpconns>
        ListeningPorts false
        AllPortsSummary true
    </Plugin>
    
    Include "/etc/collectd.d"
    EOF
    
  • 相关阅读:
    每天都感觉很疲劳
    如果你决定要自己营销
    昨天忘记写日记了,今天补充一下!
    终于不用再去北仑了
    良好的程序架构
    最近的天气反复无常
    就这么着
    C# Socket 入门3 UPD
    让程序只启动一次 Mutex
    C# Socket 入门2
  • 原文地址:https://www.cnblogs.com/liujitao79/p/6672803.html
Copyright © 2011-2022 走看看