Skip to content
corywright edited this page Oct 11, 2012 · 11 revisions

Configuration

If you've installed diamond via a package, a example configuration file is /etc/diamond/diamond.cfg.example. Please copy this to /etc/diamond/diamond.cfg and configure at will. By default, diamond will push to a graphite server host "graphite". You should probably change this to point to your own graphite server.

Other configuration should not be necessary.

By default diamond publishes metrics using the following form:

systems.<hostname>.<metrics>.<metric>

You can override the "systems" portion of the metric path by changing the "path_prefix" setting in the configuration file.

Configuration is handled via diamond.cfg and collector specific files in /etc/diamond/collectors/ by default. Each collector's defaults are overridden by /etc/diamond.cfg and then by the specific collector config file, so if you want to make a change to all the collectors, please edit the default collector section in diamond.cfg. If you want to change a specific collector, please edit the specific collector config in /etc/diamond/collectors/.

We also have diamond-setup. It will walk you though setting up diamond and it's collectors. It will display information about the collector, ask you to enable or disable it, and any collector specfiic settings it might have. This should be a easy way for one to setup and run diamond.

If you have any questions at all, please feel free to stop by and talk to us on irc, #python-diamond on freenode. Webchat

Logging

Diamond defaults to logging at /var/log/diamond/diamond.log

Sample of configuration to have log sent to both /var/log/diamond/diamond.log AND local syslog daemon:

[handlers]
keys = rotated_file,syslog

[loggers]
keys = root

[formatters]
keys = syslog,default

[logger_root]
level = INFO
handlers = syslog,rotated_file

[handler_syslog]
class = handlers.SysLogHandler
level = DEBUG
formatter = syslog
args = ('/dev/log',)

[formatter_syslog]
format = %(asctime)-15s diamond[%(process)d] %(message)s
datefmt = %b %d %H:%M:%S

[handler_rotated_file]
class = handlers.TimedRotatingFileHandler
level = DEBUG
formatter = default
# rotate at midnight, each day and keep 7 days
args = ('/var/log/diamond/diamond.log', 'midnight', 1, 7)

[formatter_default]
format = [%(asctime)s] [%(threadName)s] %(message)s
datefmt =

Collector Settings

Every collector has some default options

  • enabled - True or False - Run this collector?
  • path_prefix - Base path to put all metrics
  • path - Path on the tree to place the metrics
  • interval - Default Poll Interval (seconds)
  • splay - Default splay time (seconds)
  • method - Threading model to use, Sequential or Threaded
  • byte_unit - List of units to convert bit/byte numeric types to. Defaults to bytes
  • hostname - Hardcode an hostname rather then finding one
  • hostname_method - Change the method to find the hostname. Valid options are
    • fqdn = Hostname with . replaced by _ (www_example_com)
    • fqdn_short = Default. Similar to hostname -s
    • fqdn_rev = Hostname in reverse (com.example.www)
    • uname_short = Similar to uname -n, but only the first part
    • uname_rev = uname -r in reverse (com.example.www)
    • none = no hostname autodetection. just use the statically defined hostname
Clone this wiki locally