Skip to content

Instantly share code, notes, and snippets.

@TanyaCouture
Created February 9, 2016 17:10
Show Gist options
  • Save TanyaCouture/3b577f54dbfdc9286e77 to your computer and use it in GitHub Desktop.
Save TanyaCouture/3b577f54dbfdc9286e77 to your computer and use it in GitHub Desktop.
mantl-collectd package
# collectd
Hostname "{{ inventory_hostname }}"
FQDNLookup false
Interval 10
Include "/etc/collectd.d/"
TypesDB "/usr/share/collectd/types.db"
LoadPlugin "cpu"
LoadPlugin "disk"
LoadPlugin "df"
LoadPlugin "interface"
LoadPlugin "load"
LoadPlugin "memory"
LoadPlugin "network"
LoadPlugin "processes"
LoadPlugin "swap"
LoadPlugin "syslog"
LoadPlugin "uptime"
LoadPlugin "users"
<Plugin "cpu">
ReportByState true
ReportByCpu true
ValuesPercentage true
</Plugin>
<Plugin "memory">
ValuesPercentage true
</Plugin>
<Plugin "df">
FSType anon_inodefs
FSType bdev
FSType cgroup
FSType cpuset
FSType debugfs
FSType devpts
FSType devtmpfs
FSType ecryptfs
FSType fuse
FSType fusectl
FSType hugetlbfs
FSType mqueue
FSType nfs
FSType nfs4
FSType nfsd
FSType pipefs
FSType proc
FSType pstore
FSType ramfs
FSType rootfs
FSType rpc_pipefs
FSType securityfs
FSType sockfs
FSType sysfs
FSType tmpfs
FSType vboxsf
IgnoreSelected true
ReportByDevice false
ValuesAbsolute true
ReportInodes true
</Plugin>
<Plugin "interface">
Interface "/^veth/"
IgnoreSelected true
</Plugin>
<Plugin "syslog">
LogLevel "err"
</Plugin>
<Plugin "network">
Server "localhost" "25826"
</Plugin>
# EOF
---
name: mantl-collectd
version: 1.0.0
license: ASL 2.0
iteration: 1
vendor: Asteris
url: https://github.com/asteris-llc/mantl-packaging
description: Collectd integration with Mantl
type: rpm
depends:
- collectd
- libsemanage-python
targets:
- src: "{{.SpecRoot}}/collectd.conf"
dest: /etc/collectd.conf
config: true
# delete Hostname setting so that the hostname will be determined using the gethostname(2) system call
# mkdir -p /usr/share/collectd/plugins && chmod 0755 /usr/share/collectd/plugins
scripts:
before-install: |
mkdir -p /usr/share/collectd/plugins
find /etc -name collectd.conf -exec sed -i '' '/Hostname "{{ inventory_hostname }}"/d' {} \;
# authorize collectd to make tcp connections
# start collectd on boot
after-install: |
setsebool -P collectd_tcp_network_connect 1
systemctl enable collectd 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment