Skip to content

Instantly share code, notes, and snippets.

@relekang
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save relekang/b99252726f9ceed6228c to your computer and use it in GitHub Desktop.
Save relekang/b99252726f9ceed6228c to your computer and use it in GitHub Desktop.
Uses https://github.com/saltstack-formulas/collectd-formula to set up collectd with whale.io

Will do the following

  1. Create whale-heartbeat script in /usr/local/bin with correct uuid.
  2. Set up collectd with network plugin pointed at whale.io

File structure

pillar/
  whale.sls
salt/
  whale.sls
  files/scripts/whale-heartbeat
whale:
{% if '<hostname>' %}
uuid: <uuid-hostname>
{% endif %}
collectd:
FQDNLookup: true
TypesDB: ['/usr/share/collectd/types.db']
plugins:
default: [cpu, entropy, load, memory, swap, load]
enable: false
syslog:
LogLevel: info
network:
host: 'whale.io'
port: 25826
#!/bin/sh
curl -H "Content-Type: application/json" -d '{"uuid": "{{ pillar['whale']['uuid'] }}"}' https://whale.io/api/clientlistener/keepalive > /dev/null 2>&1
include:
- collectd
- collectd.network
- collectd.syslog
/usr/local/bin/whale-heartbeat:
file.managed:
- source: salt://files/scripts/whale-heartbeat
- user: root
- group: root
- mode: 755
- template: jinja
cron.present:
- user: root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment