Cookbook to automatically deploy the Gdash web interface for Graphite. Resources are provided for automated graph and dashboard creation.
- Debian
- Ubuntu
- build-essentials
- runit
- graphite
- unicorn
- optional dependency: iptables
node['gdash']['tarfile']
- Full path to store downloaded tgznode['gdash']['base']
- Full path for gdash rootnode['gdash']['url']
- Download url for gdash tarballnode['gdash']['templatedir']
- Dashboard template directorynode['gdash']['dashboards']
- Attributes defining the set of dashboards.node['gdash']['owner']
- User gdash runs asnode['gdash']['group']
- Group permission for gdashnode['gdash']['basic_auth']
- Toggle basic auth setting for dashboard accessnode['gdash']['username']
- Basic auth usernamenode['gdash']['password']
- Basic auth passwordnode['gdash']['title']
- Dashboard main titlenode['gdash']['refresh_rate']
- Refresh ratenode['gdash']['columns']
- Number of columnsnode['gdash']['graphite_whisperdb']
- Full path to graphite database
======= whisper database
node['gdash']['port']
- Port gdash is available onnode['gdash']['categories']
- Categories to group dashboards into
- gdash_dashboard - Create a dashboard with a category and description
- gdash_dashboard_component - Create a graph and add it to a dashboard
The default recipe performs basic setup of gdash and creates a runit service definition.
The firewall recipe uses iptables to open ports for the dashboard. This is optional and requires the iptables cookbook if used.
The basic_dashboard recipe is intended an example to get up and running with gdash and automatic graph creation. Use this recipe and the usage description to get started building your own dashboards with the resources provided by this cookbook.
Graph creation is left to the user but an recipe is provided to create a basic dashboard and provide usage examples.
First create a dashboard:
properties = { :timezone => "Europe/London" }
gdash_dashboard 'cpu_usage' do
category 'metrics'
description 'CPU Usages'
graph_properties properties
end
Next, add components to the dashboard. Dashboards are referenced by their name and category when adding components:
gdash_dashboard_component 'node1' do
dashboard_name 'cpu_usage'
dashboard_category 'metrics'
linemode 'slope'
description 'Node1 CPU usage'
fields(
:system => {
:scale => 0.001,
:color => 'orange',
:alias => 'System Usage 0',
:data => 'node1.cpu.0.system.value'
},
:user => {
:scale => 0.001,
:color => 'blue',
:alias => 'User Usage 0',
:data => 'node1.cpu.0.user.value'
}
)
end
Alternatively attributes can be used to define the set of dashboards
and the attribute_driven_dashboard
recipe can be used to managed the
dashboards. The recipe will remove categories, dashboards and dashboard
components that no longer exist and create all those as specified in
attributes. For example:
node.override['gdash']['dashboards']['cpu_usage'] =
{
'category' => 'metrics',
'description' => 'CPU Usages of the nodes across the cluster',
'display_name' => 'CPU Usages',
'graph_properties' => {
'timezone' => 'Europe/London'
},
'components' => {
'node1' => {
'linemode' => 'slope',
'description' => 'Node1 CPU usage',
'fields' => {
:system => {
:scale => 0.001,
:color => 'orange',
:alias => 'System Usage 0',
:data => 'node1.cpu.0.system.value'
},
:user => {
:scale => 0.001,
:color => 'blue',
:alias => 'User Usage 0',
:data => 'node1.cpu.0.user.value'
}
}
}
}
}
end