Created
November 30, 2012 15:27
-
-
Save SEJeff/4176420 to your computer and use it in GitHub Desktop.
Alternate Pip install of Diamond
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
message_do_not_modify: Do not edit this file, this is handled by Salt | |
graphite_address: 127.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# {{ pillar['message_do_not_modify'] }} | |
[server] | |
# Handlers for published metrics. | |
handlers = diamond.handler.graphite.GraphiteHandler | |
#diamond.handler.stats_d.StatsdHandler | |
# Leave empty to use the current user | |
user = | |
# Leave empty to use the current group | |
group = | |
pid_file = /var/run/diamond.pid | |
# Directory to load collector modules from | |
collectors_path = /usr/local/diamond/src/diamond/src/collectors/ | |
# Directory to load collector config from | |
collectors_config_path = /etc/diamond/collectors/ | |
# Interval to reload collectors | |
collectors_reload_interval = 3600 | |
#handlers_config_path = /etc/diamond/handlers/ | |
### Options for handlers | |
[handlers] | |
# logging handlers | |
keys = handler | |
[[default]] | |
[[GraphiteHandler]] | |
host = {{ pillar['graphite_address'] }} | |
# Port to send metrics to | |
port = 2003 | |
batch = 256 | |
# Socket timeout (seconds) | |
timeout = 15 | |
#[[StatsdHandler]] | |
#host = 127.0.0.1 | |
#port = 8125 | |
[collectors] | |
[[default]] | |
hostname_method = uname_short | |
# All collectors are disabled by default | |
enabled = False | |
# Path Prefix | |
path_prefix = | |
path_suffix = os | |
# Default splay time (seconds) | |
splay = 1 | |
# Default Poll Interval (seconds) | |
interval = 60 | |
# Default collector threading model | |
method = Sequential | |
# Default numeric output | |
byte_unit = byte | |
[[ConnTrackCollector]] | |
enabled = True | |
[[CPUCollector]] | |
enabled = True | |
[[DiskSpaceCollector]] | |
enabled = True | |
[[DiskUsageCollector]] | |
enabled = True | |
# when the following comment is answered positively: | |
# https://github.com/BrightcoveOS/Diamond/commit/9ac782848dbfb5d25b4fcb7c59ce1228fb975350 | |
# this is required | |
devices = md[0-9]*$|sd[a-z][0-9]*$|xvd[a-z][0-9]*$|dm\-[0-9]*$ | |
[[FilestatCollector]] | |
enabled = True | |
[[InterruptCollector]] | |
enabled = True | |
[[LoadAverageCollector]] | |
enabled = True | |
[[MemoryCollector]] | |
enabled = True | |
[[NetworkCollector]] | |
enabled = True | |
interfaces = eth, tun, tap, lo, vmbr | |
[[ProcessStatCollector]] | |
enabled = True | |
[[SockstatCollector]] | |
enabled = True | |
[[TCPCollector]] | |
enabled = True | |
[[VMStatCollector]] | |
enabled = True | |
[loggers] | |
keys = root | |
[formatters] | |
keys = formatter | |
[logger_root] | |
# to increase verbosity, set DEBUG | |
level = INFO | |
handlers = handler | |
[handler_handler] | |
class=graypy.handler.GELFHandler | |
level=DEBUG | |
formatter=formatter | |
args = ('{{ pillar['graylog2_address'] }}', 12201) | |
[formatter_formatter] | |
class = logging.Formatter | |
format = %(message)s | |
datefmt = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# | |
# this state is just an example to use pip in a new fast way | |
# | |
# this example install Diamond https://github.com/BrightcoveOS/Diamond | |
# | |
# it assume that you already took care of installing python-dev, virtualenv, python-pip | |
# and all other dependencies. | |
# my real state do that. | |
# | |
# if you wonder why I use the .jinja2 extension, it's because my IDE gently handle the | |
# files that have this extension. | |
#} | |
/etc/diamond/collectors: | |
file: | |
- directory | |
- user: root | |
- group: root | |
- mode: 550 | |
diamond_upstart: | |
file: | |
- managed | |
- name: /etc/init/diamond.conf | |
- template: jinja | |
- user: root | |
- group: root | |
- mode: 440 | |
- source: salt://diamond/upstart.jinja2 | |
diamond_requirements: | |
file: | |
- managed | |
- name: /usr/local/diamond/salt-requirements.txt | |
- template: jinja | |
- user: root | |
- group: root | |
- mode: 440 | |
- source: salt://diamond/requirements.jinja2 | |
- require: | |
- virtualenv: diamond | |
diamond: | |
virtualenv: | |
- manage | |
- upgrade: True | |
- name: /usr/local/diamond | |
module: | |
- wait | |
- name: pip.install | |
- upgrade: True | |
- bin_env: /usr/local/diamond | |
- pkgs: '' | |
- requirements: /usr/local/diamond/salt-requirements.txt | |
- require: | |
- pkg: git | |
- pkg: python-virtualenv | |
- file: diamond_upstart | |
- watch: | |
- file: diamond_requirements | |
file: | |
- managed | |
- name: /etc/diamond/diamond.conf | |
- template: jinja | |
- user: root | |
- group: root | |
- mode: 440 | |
- source: salt://diamond/config.jinja2 | |
- require: | |
- virtualenv: diamond | |
service: | |
- running | |
- watch: | |
- virtualenv: diamond | |
- file: diamond | |
- file: diamond_upstart | |
- module: diamond |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-e git+git://github.com/BrightcoveOS/Diamond.git@2a8001546aff90258ac48d19e87cac44e163357b#egg=diamond | |
graypy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# {{ pillar['message_do_not_modify'] }} | |
# diamond - A system statistics collector for graphite | |
# | |
# Diamond is a daemon and toolset for gather system statistics | |
# and publishing them to graphite. | |
start on stopped rc RUNLEVEL=[2345] | |
stop on runlevel [!2345] | |
respawn | |
exec /usr/local/diamond/bin/python /usr/local/diamond/bin/diamond --foreground |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment