Last active
August 29, 2015 13:57
-
-
Save blkperl/9826382 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class role::leonardo::client { | |
| $dashboard_root = '/opt/leonardo/graphs/servers', | |
| $collectd_name = regsubst($::fqdn, '\.', '_', 'G'), | |
| $dashboard_dir = "${dashboard_root}/${::hostname}", | |
| # Each dashboard needs a directory to hold the graph files | |
| @@file { $dashboard_dir: | |
| ensure => directory, | |
| mode => '0755', | |
| tag => "env_leonardo_${environment}", | |
| } | |
| # Each dashboard needs a a dash.yaml file | |
| @@leonardo::dashboard { $::hostname: | |
| target => "${dashboard_dir}/dash.yaml", | |
| name => $::hostname, | |
| description => 'System Metrics', | |
| include_properties => ['common.yaml'], | |
| tag => "env_leonardo_${environment}", | |
| require => File[$dashboard_dir], | |
| } | |
| # Export a cpu graph | |
| @@leonardo::graph { "${::hostname}-cpu": | |
| target => "${dashboard_dir}/10-cpu.graph", | |
| parameters => { 'title' => 'Combined CPU Usage', | |
| 'vtitle' => 'percent', | |
| 'area' => 'stacked' }, | |
| fields => { | |
| 'iowait' => { 'data' => "sumSeries(collectd.${collectd_name}.cpu*.cpu-wait)",}, | |
| 'system' => { 'data' => "sumSeries(collectd.${collectd_name}.cpu*.cpu-system)",}, | |
| 'user' => { 'data' => "sumSeries(collectd.${collectd_name}.cpu*.cpu-user)",}, | |
| }, | |
| tag => "env_leonardo_${environment}", | |
| require => File[$dashboard_dir], | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment