forked from zentralwerk/network
implement stats collection with collectd
This commit is contained in:
parent
9a07ba6ec2
commit
0a443f6ad4
|
@ -0,0 +1,14 @@
|
||||||
|
collectd:
|
||||||
|
network: client
|
||||||
|
irq: True
|
||||||
|
cpu: True
|
||||||
|
load: True
|
||||||
|
memory: True
|
||||||
|
swap: True
|
||||||
|
entropy: True
|
||||||
|
disk: True
|
||||||
|
df: True
|
||||||
|
processes: True
|
||||||
|
hddtemp: True
|
||||||
|
sensors: True
|
||||||
|
thermal: True
|
|
@ -0,0 +1,8 @@
|
||||||
|
collectd:
|
||||||
|
network: server
|
||||||
|
disk: True
|
||||||
|
df: True
|
||||||
|
rrdtool:
|
||||||
|
DataDir: "/var/lib/collectd/rrd"
|
||||||
|
CacheTimeout: 300
|
||||||
|
CacheFlush: 600
|
|
@ -0,0 +1,8 @@
|
||||||
|
collectd:
|
||||||
|
network: client
|
||||||
|
interface: True
|
||||||
|
ping:
|
||||||
|
- google.de
|
||||||
|
- 8.8.8.8
|
||||||
|
- www.vodafone.de
|
||||||
|
conntrack: True
|
|
@ -142,3 +142,10 @@ containers:
|
||||||
type: veth
|
type: veth
|
||||||
gw: serv-gw
|
gw: serv-gw
|
||||||
gw6: serv-gw
|
gw6: serv-gw
|
||||||
|
|
||||||
|
stats:
|
||||||
|
interfaces:
|
||||||
|
serv:
|
||||||
|
type: veth
|
||||||
|
gw: serv-gw
|
||||||
|
gw6: serv-gw
|
||||||
|
|
|
@ -8,6 +8,7 @@ base:
|
||||||
- bird.ospf
|
- bird.ospf
|
||||||
- switches
|
- switches
|
||||||
- cpe.aps
|
- cpe.aps
|
||||||
|
- collectd.server1
|
||||||
'priv*-gw':
|
'priv*-gw':
|
||||||
- dhcp
|
- dhcp
|
||||||
- bird.radv
|
- bird.radv
|
||||||
|
@ -23,6 +24,7 @@ base:
|
||||||
- bird.bgp
|
- bird.bgp
|
||||||
'upstream*':
|
'upstream*':
|
||||||
- bird.ospf
|
- bird.ospf
|
||||||
|
- collectd.upstream
|
||||||
# for forward-zones in unbound
|
# for forward-zones in unbound
|
||||||
- bind.dns
|
- bind.dns
|
||||||
'upstream1':
|
'upstream1':
|
||||||
|
@ -33,5 +35,8 @@ base:
|
||||||
- bird.ospf
|
- bird.ospf
|
||||||
- vpn.anon1
|
- vpn.anon1
|
||||||
- upstream.anon1
|
- upstream.anon1
|
||||||
|
- collectd.upstream
|
||||||
'dns':
|
'dns':
|
||||||
- bind.dns
|
- bind.dns
|
||||||
|
'stats':
|
||||||
|
- collectd.stats-server
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
Hostname "{{ salt['grains.get']('id') }}"
|
||||||
|
FQDNLookup false
|
||||||
|
Interval 10
|
||||||
|
|
||||||
|
LoadPlugin logfile
|
||||||
|
<Plugin logfile>
|
||||||
|
LogLevel info
|
||||||
|
File STDOUT
|
||||||
|
</Plugin>
|
||||||
|
|
||||||
|
|
||||||
|
{%- for plugin, conf in pillar['collectd'].items() %}
|
||||||
|
|
||||||
|
{%- if plugin == 'network' and conf == 'client' %}
|
||||||
|
LoadPlugin network
|
||||||
|
<Plugin network>
|
||||||
|
Server "{{ pillar['hosts-inet6']['serv']['stats'] }}" "25826"
|
||||||
|
</Plugin>
|
||||||
|
{%- elif plugin == 'network' and conf == 'server' %}
|
||||||
|
LoadPlugin network
|
||||||
|
<Plugin network>
|
||||||
|
Listen "::" "25826"
|
||||||
|
</Plugin>
|
||||||
|
|
||||||
|
{%- elif plugin == 'ping' %}
|
||||||
|
LoadPlugin ping
|
||||||
|
<Plugin ping>
|
||||||
|
{%- for host in conf %}
|
||||||
|
Host "{{ host }}"
|
||||||
|
{%- endfor %}
|
||||||
|
Interval 10
|
||||||
|
</Plugin>
|
||||||
|
|
||||||
|
{%- elif type(conf) == dict %}
|
||||||
|
LoadPlugin {{ plugin }}
|
||||||
|
|
||||||
|
<Plugin {{ plugin }}>
|
||||||
|
{%- for k, v in conf.items() %}
|
||||||
|
{{ k }} "{{ v }}"
|
||||||
|
{%- endfor %}
|
||||||
|
</Plugin>
|
||||||
|
{%- else %}
|
||||||
|
LoadPlugin {{ plugin }}
|
||||||
|
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- endfor %}
|
|
@ -0,0 +1,17 @@
|
||||||
|
collectd-core:
|
||||||
|
pkg.installed: []
|
||||||
|
|
||||||
|
liboping0:
|
||||||
|
pkg.installed: []
|
||||||
|
|
||||||
|
collectd:
|
||||||
|
service:
|
||||||
|
- running
|
||||||
|
- watch:
|
||||||
|
- pkg: collectd-core
|
||||||
|
- file: /etc/collectd/collectd.conf
|
||||||
|
|
||||||
|
/etc/collectd/collectd.conf:
|
||||||
|
file.managed:
|
||||||
|
- source: salt://collectd/collectd.conf
|
||||||
|
- template: 'jinja'
|
|
@ -6,6 +6,7 @@ base:
|
||||||
- bird
|
- bird
|
||||||
- switches
|
- switches
|
||||||
- cpe
|
- cpe
|
||||||
|
- collectd
|
||||||
'priv*-gw':
|
'priv*-gw':
|
||||||
- no-ssh
|
- no-ssh
|
||||||
- forwarding
|
- forwarding
|
||||||
|
@ -31,6 +32,7 @@ base:
|
||||||
- unbound
|
- unbound
|
||||||
- upstream.dhcp
|
- upstream.dhcp
|
||||||
- upstream.shaping
|
- upstream.shaping
|
||||||
|
- collectd
|
||||||
'upstream1':
|
'upstream1':
|
||||||
- upstream.6to4
|
- upstream.6to4
|
||||||
- upstream.nat66
|
- upstream.nat66
|
||||||
|
@ -46,6 +48,10 @@ base:
|
||||||
- upstream.masquerade
|
- upstream.masquerade
|
||||||
- upstream.shaping
|
- upstream.shaping
|
||||||
- upstream.nat66
|
- upstream.nat66
|
||||||
|
- collectd
|
||||||
'dns':
|
'dns':
|
||||||
- no-ssh
|
- no-ssh
|
||||||
- bind
|
- bind
|
||||||
|
'stats':
|
||||||
|
- no-ssh
|
||||||
|
- collectd
|
||||||
|
|
Loading…
Reference in New Issue